azure openai add gpt-4-1106-preview、gpt-4-vision-preview models (#1751)

Co-authored-by: luowei <glpat-EjySCyNjWiLqAED-YmwM>
Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
This commit is contained in:
Charlie.Wei
2023-12-14 09:55:30 +08:00
committed by GitHub
parent 7c43123956
commit b0d8d196e1
8 changed files with 811 additions and 336 deletions

View File

@@ -23,7 +23,8 @@ FUNCTION_CALL_MODELS = [
'gpt-4',
'gpt-4-32k',
'gpt-35-turbo',
'gpt-35-turbo-16k'
'gpt-35-turbo-16k',
'gpt-4-1106-preview'
]
class AzureOpenAIModel(BaseLLM):

View File

@@ -122,6 +122,22 @@ class AzureOpenAIProvider(BaseModelProvider):
ModelFeature.AGENT_THOUGHT.value
]
},
{
'id': 'gpt-4-1106-preview',
'name': 'gpt-4-1106-preview',
'mode': ModelMode.CHAT.value,
'features': [
ModelFeature.AGENT_THOUGHT.value
]
},
{
'id': 'gpt-4-vision-preview',
'name': 'gpt-4-vision-preview',
'mode': ModelMode.CHAT.value,
'features': [
ModelFeature.VISION.value
]
},
{
'id': 'text-davinci-003',
'name': 'text-davinci-003',
@@ -171,6 +187,8 @@ class AzureOpenAIProvider(BaseModelProvider):
base_model_max_tokens = {
'gpt-4': 8192,
'gpt-4-32k': 32768,
'gpt-4-1106-preview': 4096,
'gpt-4-vision-preview': 4096,
'gpt-35-turbo': 4096,
'gpt-35-turbo-16k': 16384,
'text-davinci-003': 4097,
@@ -376,6 +394,18 @@ class AzureOpenAIProvider(BaseModelProvider):
provider_credentials=credentials
)
self._add_provider_model(
model_name='gpt-4-1106-preview',
model_type=ModelType.TEXT_GENERATION,
provider_credentials=credentials
)
self._add_provider_model(
model_name='gpt-4-vision-preview',
model_type=ModelType.TEXT_GENERATION,
provider_credentials=credentials
)
self._add_provider_model(
model_name='text-davinci-003',
model_type=ModelType.TEXT_GENERATION,

View File

@@ -21,6 +21,18 @@
"unit": "0.001",
"currency": "USD"
},
"gpt-4-1106-preview": {
"prompt": "0.01",
"completion": "0.03",
"unit": "0.001",
"currency": "USD"
},
"gpt-4-vision-preview": {
"prompt": "0.01",
"completion": "0.03",
"unit": "0.001",
"currency": "USD"
},
"gpt-35-turbo": {
"prompt": "0.002",
"completion": "0.0015",