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
4c63cbf5
Unverified
Commit
4c63cbf5
authored
Oct 20, 2023
by
takatost
Committed by
GitHub
Oct 20, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: adjust anthropic (#1387)
parent
288705fe
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
7 deletions
+7
-7
anthropic_provider.py
api/core/model_providers/providers/anthropic_provider.py
+1
-1
azure_openai_provider.py
api/core/model_providers/providers/azure_openai_provider.py
+1
-1
hosted.py
api/core/model_providers/providers/hosted.py
+3
-3
openai_provider.py
api/core/model_providers/providers/openai_provider.py
+1
-1
anthropic.json
api/core/model_providers/rules/anthropic.json
+1
-1
No files found.
api/core/model_providers/providers/anthropic_provider.py
View file @
4c63cbf5
...
...
@@ -172,7 +172,7 @@ class AnthropicProvider(BaseModelProvider):
def
should_deduct_quota
(
self
):
if
hosted_model_providers
.
anthropic
and
\
hosted_model_providers
.
anthropic
.
quota_limit
and
hosted_model_providers
.
anthropic
.
quota_limit
>
0
:
hosted_model_providers
.
anthropic
.
quota_limit
and
hosted_model_providers
.
anthropic
.
quota_limit
>
-
1
:
return
True
return
False
...
...
api/core/model_providers/providers/azure_openai_provider.py
View file @
4c63cbf5
...
...
@@ -329,7 +329,7 @@ class AzureOpenAIProvider(BaseModelProvider):
def
should_deduct_quota
(
self
):
if
hosted_model_providers
.
azure_openai
\
and
hosted_model_providers
.
azure_openai
.
quota_limit
and
hosted_model_providers
.
azure_openai
.
quota_limit
>
0
:
and
hosted_model_providers
.
azure_openai
.
quota_limit
and
hosted_model_providers
.
azure_openai
.
quota_limit
>
-
1
:
return
True
return
False
...
...
api/core/model_providers/providers/hosted.py
View file @
4c63cbf5
...
...
@@ -11,7 +11,7 @@ class HostedOpenAI(BaseModel):
api_organization
:
str
=
None
api_key
:
str
quota_limit
:
int
=
0
"""Quota limit for the openai hosted model.
0
means unlimited."""
"""Quota limit for the openai hosted model.
-1
means unlimited."""
paid_enabled
:
bool
=
False
paid_stripe_price_id
:
str
=
None
paid_increase_quota
:
int
=
1
...
...
@@ -21,14 +21,14 @@ class HostedAzureOpenAI(BaseModel):
api_base
:
str
api_key
:
str
quota_limit
:
int
=
0
"""Quota limit for the azure openai hosted model.
0
means unlimited."""
"""Quota limit for the azure openai hosted model.
-1
means unlimited."""
class
HostedAnthropic
(
BaseModel
):
api_base
:
str
=
None
api_key
:
str
quota_limit
:
int
=
0
"""Quota limit for the anthropic hosted model.
0
means unlimited."""
"""Quota limit for the anthropic hosted model.
-1
means unlimited."""
paid_enabled
:
bool
=
False
paid_stripe_price_id
:
str
=
None
paid_increase_quota
:
int
=
1000000
...
...
api/core/model_providers/providers/openai_provider.py
View file @
4c63cbf5
...
...
@@ -250,7 +250,7 @@ class OpenAIProvider(BaseModelProvider):
def
should_deduct_quota
(
self
):
if
hosted_model_providers
.
openai
\
and
hosted_model_providers
.
openai
.
quota_limit
and
hosted_model_providers
.
openai
.
quota_limit
>
0
:
and
hosted_model_providers
.
openai
.
quota_limit
and
hosted_model_providers
.
openai
.
quota_limit
>
-
1
:
return
True
return
False
...
...
api/core/model_providers/rules/anthropic.json
View file @
4c63cbf5
...
...
@@ -9,7 +9,7 @@
"trial"
],
"quota_unit"
:
"tokens"
,
"quota_limit"
:
60000
0
"quota_limit"
:
0
},
"model_flexibility"
:
"fixed"
,
"price_config"
:
{
...
...
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