mirror of
https://github.com/langgenius/dify.git
synced 2026-04-27 02:36:29 +08:00
Merge branch 'refs/heads/fix/chore-fix' into dev/plugin-deploy
This commit is contained in:
commit
0b2b6a3ef3
@ -409,7 +409,7 @@ class ModelManager:
|
|||||||
|
|
||||||
return ModelInstance(provider_model_bundle, model)
|
return ModelInstance(provider_model_bundle, model)
|
||||||
|
|
||||||
def get_default_provider_model_name(self, tenant_id: str, model_type: ModelType) -> tuple[str, str]:
|
def get_default_provider_model_name(self, tenant_id: str, model_type: ModelType) -> tuple[str | None, str | None]:
|
||||||
"""
|
"""
|
||||||
Return first provider and the first model in the provider
|
Return first provider and the first model in the provider
|
||||||
:param tenant_id: tenant id
|
:param tenant_id: tenant id
|
||||||
|
|||||||
@ -270,7 +270,7 @@ class ProviderManager:
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_first_provider_first_model(self, tenant_id: str, model_type: ModelType) -> tuple[str, str]:
|
def get_first_provider_first_model(self, tenant_id: str, model_type: ModelType) -> tuple[str | None, str | None]:
|
||||||
"""
|
"""
|
||||||
Get names of first model and its provider
|
Get names of first model and its provider
|
||||||
|
|
||||||
@ -283,6 +283,9 @@ class ProviderManager:
|
|||||||
# get available models from provider_configurations
|
# get available models from provider_configurations
|
||||||
all_models = provider_configurations.get_models(model_type=model_type, only_active=False)
|
all_models = provider_configurations.get_models(model_type=model_type, only_active=False)
|
||||||
|
|
||||||
|
if not all_models:
|
||||||
|
return None, None
|
||||||
|
|
||||||
return all_models[0].provider.provider, all_models[0].model
|
return all_models[0].provider.provider, all_models[0].model
|
||||||
|
|
||||||
def update_default_model_record(
|
def update_default_model_record(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user