mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-12 06:29:03 +08:00
feat: adjust anthropic (#1387)
This commit is contained in:
parent
288705fefd
commit
4c63cbf5b1
@ -172,7 +172,7 @@ class AnthropicProvider(BaseModelProvider):
|
|||||||
|
|
||||||
def should_deduct_quota(self):
|
def should_deduct_quota(self):
|
||||||
if hosted_model_providers.anthropic and \
|
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 True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
@ -329,7 +329,7 @@ class AzureOpenAIProvider(BaseModelProvider):
|
|||||||
|
|
||||||
def should_deduct_quota(self):
|
def should_deduct_quota(self):
|
||||||
if hosted_model_providers.azure_openai \
|
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 True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
@ -11,7 +11,7 @@ class HostedOpenAI(BaseModel):
|
|||||||
api_organization: str = None
|
api_organization: str = None
|
||||||
api_key: str
|
api_key: str
|
||||||
quota_limit: int = 0
|
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_enabled: bool = False
|
||||||
paid_stripe_price_id: str = None
|
paid_stripe_price_id: str = None
|
||||||
paid_increase_quota: int = 1
|
paid_increase_quota: int = 1
|
||||||
@ -21,14 +21,14 @@ class HostedAzureOpenAI(BaseModel):
|
|||||||
api_base: str
|
api_base: str
|
||||||
api_key: str
|
api_key: str
|
||||||
quota_limit: int = 0
|
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):
|
class HostedAnthropic(BaseModel):
|
||||||
api_base: str = None
|
api_base: str = None
|
||||||
api_key: str
|
api_key: str
|
||||||
quota_limit: int = 0
|
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_enabled: bool = False
|
||||||
paid_stripe_price_id: str = None
|
paid_stripe_price_id: str = None
|
||||||
paid_increase_quota: int = 1000000
|
paid_increase_quota: int = 1000000
|
||||||
|
@ -250,7 +250,7 @@ class OpenAIProvider(BaseModelProvider):
|
|||||||
|
|
||||||
def should_deduct_quota(self):
|
def should_deduct_quota(self):
|
||||||
if hosted_model_providers.openai \
|
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 True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
"trial"
|
"trial"
|
||||||
],
|
],
|
||||||
"quota_unit": "tokens",
|
"quota_unit": "tokens",
|
||||||
"quota_limit": 600000
|
"quota_limit": 0
|
||||||
},
|
},
|
||||||
"model_flexibility": "fixed",
|
"model_flexibility": "fixed",
|
||||||
"price_config": {
|
"price_config": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user