Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: replicate text generation model validate (#923)

takatost95b179fb39f0
diff --git a/api/core/model_providers/providers/replicate_provider.py b/api/core/model_providers/providers/replicate_provider.py
index 404ca1c57ca..a5c62e77f13 100644
--- a/api/core/model_providers/providers/replicate_provider.py
+++ b/api/core/model_providers/providers/replicate_provider.py
@@ -116,7 +116,8 @@ class ReplicateProvider(BaseModelProvider):
and 'Embedding' not in rst.openapi_schema['components']['schemas']:
raise CredentialsValidateFailedError(f"Model {model_name}:{version} is not a Embedding model.")
elif model_type == ModelType.TEXT_GENERATION \
- and ('type' not in rst.openapi_schema['components']['schemas']['Output']['items']
+ and ('items' not in rst.openapi_schema['components']['schemas']['Output']
+ or 'type' not in rst.openapi_schema['components']['schemas']['Output']['items']
or rst.openapi_schema['components']['schemas']['Output']['items']['type'] != 'string'):
raise CredentialsValidateFailedError(f"Model {model_name}:{version} is not a Text Generation model.")
except ReplicateError as e: