mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-05-02 15:52:34 +00:00
Fix : short_term_memory with bedrock - using user defined model(when passed as attribute) rather than default (#1959)
* Update embedding_configurator.py Modified _configure_bedrock method to use user submitted model_name rather than default amazon.titan-embed-text-v1. Sending model_name in short_term_memory (embedder_config/config) was not working. # Passing model_name to use model_name provide by user than using default. Added if/else for backward compatibility * Update embedding_configurator.py Incorporated review comments --------- Co-authored-by: Brandon Hancock (bhancock_ai) <109994880+bhancockio@users.noreply.github.com>
This commit is contained in:
@@ -141,9 +141,11 @@ class EmbeddingConfigurator:
|
|||||||
AmazonBedrockEmbeddingFunction,
|
AmazonBedrockEmbeddingFunction,
|
||||||
)
|
)
|
||||||
|
|
||||||
return AmazonBedrockEmbeddingFunction(
|
# Allow custom model_name override with backwards compatibility
|
||||||
session=config.get("session"),
|
kwargs = {"session": config.get("session")}
|
||||||
)
|
if model_name is not None:
|
||||||
|
kwargs["model_name"] = model_name
|
||||||
|
return AmazonBedrockEmbeddingFunction(**kwargs)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _configure_huggingface(config, model_name):
|
def _configure_huggingface(config, model_name):
|
||||||
|
|||||||
Reference in New Issue
Block a user