Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
60e7e17c
Unverified
Commit
60e7e17c
authored
Mar 08, 2024
by
洪朔
Committed by
GitHub
Mar 08, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Add new Azure OpenAI Embedding models (#2758)
parent
237bb851
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
0 deletions
+54
-0
hosting_configuration.py
api/core/hosting_configuration.py
+2
-0
_constant.py
...e/model_runtime/model_providers/azure_openai/_constant.py
+40
-0
azure_openai.yaml
...el_runtime/model_providers/azure_openai/azure_openai.yaml
+12
-0
No files found.
api/core/hosting_configuration.py
View file @
60e7e17c
...
...
@@ -82,6 +82,8 @@ class HostingConfiguration:
RestrictModel
(
model
=
"gpt-35-turbo-16k"
,
base_model_name
=
"gpt-35-turbo-16k"
,
model_type
=
ModelType
.
LLM
),
RestrictModel
(
model
=
"text-davinci-003"
,
base_model_name
=
"text-davinci-003"
,
model_type
=
ModelType
.
LLM
),
RestrictModel
(
model
=
"text-embedding-ada-002"
,
base_model_name
=
"text-embedding-ada-002"
,
model_type
=
ModelType
.
TEXT_EMBEDDING
),
RestrictModel
(
model
=
"text-embedding-3-small"
,
base_model_name
=
"text-embedding-3-small"
,
model_type
=
ModelType
.
TEXT_EMBEDDING
),
RestrictModel
(
model
=
"text-embedding-3-large"
,
base_model_name
=
"text-embedding-3-large"
,
model_type
=
ModelType
.
TEXT_EMBEDDING
),
]
)
quotas
.
append
(
trial_quota
)
...
...
api/core/model_runtime/model_providers/azure_openai/_constant.py
View file @
60e7e17c
...
...
@@ -524,6 +524,46 @@ EMBEDDING_BASE_MODELS = [
currency
=
'USD'
,
)
)
),
AzureBaseModel
(
base_model_name
=
'text-embedding-3-small'
,
entity
=
AIModelEntity
(
model
=
'fake-deployment-name'
,
label
=
I18nObject
(
en_US
=
'fake-deployment-name-label'
),
fetch_from
=
FetchFrom
.
CUSTOMIZABLE_MODEL
,
model_type
=
ModelType
.
TEXT_EMBEDDING
,
model_properties
=
{
ModelPropertyKey
.
CONTEXT_SIZE
:
8191
,
ModelPropertyKey
.
MAX_CHUNKS
:
32
,
},
pricing
=
PriceConfig
(
input
=
0.00002
,
unit
=
0.001
,
currency
=
'USD'
,
)
)
),
AzureBaseModel
(
base_model_name
=
'text-embedding-3-large'
,
entity
=
AIModelEntity
(
model
=
'fake-deployment-name'
,
label
=
I18nObject
(
en_US
=
'fake-deployment-name-label'
),
fetch_from
=
FetchFrom
.
CUSTOMIZABLE_MODEL
,
model_type
=
ModelType
.
TEXT_EMBEDDING
,
model_properties
=
{
ModelPropertyKey
.
CONTEXT_SIZE
:
8191
,
ModelPropertyKey
.
MAX_CHUNKS
:
32
,
},
pricing
=
PriceConfig
(
input
=
0.00013
,
unit
=
0.001
,
currency
=
'USD'
,
)
)
)
]
SPEECH2TEXT_BASE_MODELS
=
[
...
...
api/core/model_runtime/model_providers/azure_openai/azure_openai.yaml
View file @
60e7e17c
...
...
@@ -100,6 +100,18 @@ model_credential_schema:
show_on
:
-
variable
:
__model_type
value
:
text-embedding
-
label
:
en_US
:
text-embedding-3-small
value
:
text-embedding-3-small
show_on
:
-
variable
:
__model_type
value
:
text-embedding
-
label
:
en_US
:
text-embedding-3-large
value
:
text-embedding-3-large
show_on
:
-
variable
:
__model_type
value
:
text-embedding
-
label
:
en_US
:
whisper-1
value
:
whisper-1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment