mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-05-03 00:02:36 +00:00
Fix #2746: Add URL protocol validation for Huggingface embedder
Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
@@ -140,8 +140,15 @@ class EmbeddingConfigurator:
|
||||
HuggingFaceEmbeddingServer,
|
||||
)
|
||||
|
||||
api_url = config.get("api_url")
|
||||
if api_url:
|
||||
if not (api_url.startswith("http://") or api_url.startswith("https://")):
|
||||
api_url = f"http://{api_url}"
|
||||
else:
|
||||
api_url = None
|
||||
|
||||
return HuggingFaceEmbeddingServer(
|
||||
url=config.get("api_url"),
|
||||
url=api_url,
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in New Issue
Block a user