test: Add embedder_config to knowledge source tests

Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
Devin AI
2025-02-19 15:42:50 +00:00
parent 615a6795b3
commit 2f3e5e0803
2 changed files with 19 additions and 1 deletions

View File

@@ -1596,6 +1596,12 @@ def test_agent_with_knowledge_sources():
backstory="You have access to specific knowledge sources.",
llm=LLM(model="gpt-4o-mini"),
knowledge_sources=[string_source],
embedder_config={
"provider": "openai",
"config": {
"api_key": "fake-api-key"
}
}
)
# Create a task that requires the agent to use the knowledge
@@ -1631,6 +1637,12 @@ def test_agent_with_knowledge_sources_works_with_copy():
backstory="You have access to specific knowledge sources.",
llm=LLM(model="gpt-4o-mini"),
knowledge_sources=[string_source],
embedder_config={
"provider": "openai",
"config": {
"api_key": "fake-api-key"
}
}
)
with patch(

View File

@@ -45,7 +45,13 @@ def test_knowledge_included_in_planning(mock_chroma):
StringKnowledgeSource(
content="AI systems require careful training and validation."
)
]
],
embedder_config={
"provider": "openai",
"config": {
"api_key": "fake-api-key"
}
}
)
# Create a task for the agent