Skip to main content
  • Model provider rules are based on the Provider entity.
  • Model rules are based on the AIModelEntity entity.
All entities below are based on Pydantic BaseModel, and can be found in the entities module.

Provider

provider
string
Provider identifier, e.g.: openai
label
object
Provider display name, i18n, can set both en_US (English) and zh_Hans (Chinese) languages
zh_Hans
string
Chinese label, if not set, will default to using en_US
en_US
string
required
English label
description
object
Provider description, i18n
zh_Hans
string
Chinese description
en_US
string
required
English description
icon_small
object
Provider small icon, stored in the _assets directory under the corresponding provider implementation directory
zh_Hans
string
Chinese icon
en_US
string
required
English icon
icon_large
object
Provider large icon, stored in the _assets directory under the corresponding provider implementation directory
zh_Hans
string
Chinese icon
en_US
string
required
English icon
background
string
Background color value, e.g.: #FFFFFF, if empty, will display the frontend default color value
help
object
Help information
title
object
Help title, i18n
zh_Hans
string
Chinese title
en_US
string
required
English title
url
object
Help link, i18n
zh_Hans
string
Chinese link
en_US
string
required
English link
supported_model_types
array[ModelType]
required
Supported model types
configurate_methods
array[ConfigurateMethod]
required
Configuration methods
provider_credential_schema
ProviderCredentialSchema
required
Provider credential specifications
model_credential_schema
ModelCredentialSchema
Model credential specifications

AIModelEntity

model
string
required
Model identifier, e.g.: gpt-3.5-turbo
label
object
Model display name, i18n, can set both en_US (English) and zh_Hans (Chinese) languages
zh_Hans
string
Chinese label
en_US
string
required
English label
model_type
ModelType
required
Model type
features
array[ModelFeature]
List of supported features
model_properties
object
required
Model properties
mode
LLMMode
Mode (available for model type llm)
context_size
integer
Context size (available for model types llm and text-embedding)
max_chunks
integer
Maximum number of chunks (available for model types text-embedding and moderation)
file_upload_limit
integer
Maximum file upload limit, unit: MB. (available for model type speech2text)
supported_file_extensions
string
Supported file extension formats, e.g.: mp3,mp4 (available for model type speech2text)
default_voice
string
Default voice, required: alloy,echo,fable,onyx,nova,shimmer (available for model type tts)
voices
array
List of available voices (available for model type tts)
mode
string
Voice model
name
string
Voice model display name
language
string
Supported languages for voice model
word_limit
integer
Word limit for single conversion, defaults to paragraph segmentation (available for model type tts)
audio_type
string
Supported audio file extension formats, e.g.: mp3,wav (available for model type tts)
max_workers
integer
Number of concurrent tasks supported for text-to-audio conversion (available for model type tts)
max_characters_per_chunk
integer
Maximum characters per chunk (available for model type moderation)
parameter_rules
array[ParameterRule]
Model call parameter rules
pricing
PriceConfig
Pricing information
deprecated
boolean
Whether deprecated. If deprecated, the model list will no longer display it, but those already configured can continue to be used. Default is False.

ModelType

llm
string
Text generation model
text-embedding
string
Text embedding model
rerank
string
Rerank model
speech2text
string
Speech to text
tts
string
Text to speech
moderation
string
Content moderation

ConfigurateMethod

predefined-model
string
Predefined model - Indicates that the user only needs to configure unified provider credentials to use predefined models under the provider.
customizable-model
string
Customizable model - The user needs to add credential configuration for each model.
fetch-from-remote
string
Fetch from remote - Similar to the predefined-model configuration method, only unified provider credentials are needed, but the models are fetched from the provider using the credential information.

ModelFeature

agent-thought
string
Agent reasoning, generally models over 70B have chain-of-thought capabilities.
vision
string
Vision, i.e.: image understanding.
tool-call
string
Tool calling
multi-tool-call
string
Multiple tool calling
stream-tool-call
string
Streaming tool calling

FetchFrom

predefined-model
string
Predefined model
fetch-from-remote
string
Remote model

LLMMode

completion
string
Text completion
chat
string
Chat

ParameterRule

name
string
required
Actual parameter name for model call
use_template
string
Use template
For details on using templates, you can refer to the examples in Creating a New Model Provider.
There are 5 pre-configured variable content templates by default:
  • temperature
  • top_p
  • frequency_penalty
  • presence_penalty
  • max_tokens
You can directly set the template variable name in use_template, which will use the default configuration from entities.defaults.PARAMETER_RULE_TEMPLATE without needing to set any parameters other than name and use_template. If additional configuration parameters are set, they will override the default configuration. You can refer to openai/llm/gpt-3.5-turbo.yaml for examples.
label
object
Label, i18n
zh_Hans
string
Chinese label
en_US
string
required
English label
type
string
Parameter type
int
string
Integer
float
string
Floating point
string
string
String
boolean
string
Boolean
help
object
Help information
zh_Hans
string
Chinese help information
en_US
string
required
English help information
required
boolean
Whether required, default is False
default
int/float/string/boolean
Default value
min
int/float
Minimum value, only applicable to numeric types
max
int/float
Maximum value, only applicable to numeric types
precision
integer
Precision, decimal places to retain, only applicable to numeric types
options
array[string]
Dropdown option values, only applicable when type is string, if not set or is null, then option values are not restricted

PriceConfig

input
float
Input unit price, i.e., Prompt unit price
output
float
Output unit price, i.e., returned content unit price
unit
float
Price unit, e.g., if priced per 1M tokens, then the unit token number corresponding to the unit price is 0.000001
currency
string
Currency unit

ProviderCredentialSchema

credential_form_schemas
array[CredentialFormSchema]
required
Credential form specifications

ModelCredentialSchema

model
object
required
Model identifier, default variable name is model
label
object
required
Model form item display name
en_US
string
required
English
zh_Hans
string
Chinese
placeholder
object
required
Model prompt content
en_US
string
required
English
zh_Hans
string
Chinese
credential_form_schemas
array[CredentialFormSchema]
required
Credential form specifications

CredentialFormSchema

variable
string
required
Form item variable name
label
object
required
Form item label
en_US
string
required
English
zh_Hans
string
Chinese
type
FormType
required
Form item type
required
boolean
Whether required
default
string
Default value
options
array[FormOption]
Form item attribute specific to select or radio, defines dropdown content
placeholder
object
Form item attribute specific to text-input, form item placeholder
en_US
string
required
English
zh_Hans
string
Chinese
max_length
integer
Form item attribute specific to text-input, defines maximum input length, 0 means no limit
show_on
array[FormShowOnObject]
Display when other form item values meet conditions, empty means always display

FormType

text-input
string
Text input component
secret-input
string
Password input component
select
string
Single-select dropdown
radio
string
Radio component
switch
string
Switch component, only supports true and false

FormOption

label
object
required
Label
en_US
string
required
English
zh_Hans
string
Chinese
value
string
required
Dropdown option value
show_on
array[FormShowOnObject]
Display when other form item values meet conditions, empty means always display

FormShowOnObject

variable
string
required
Other form item variable name
value
string
required
Other form item variable value

Edit this page | Report an issue