mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 00:28:31 +00:00
Drop patch
This commit is contained in:
@@ -46,4 +46,5 @@ class BaseKnowledgeSource(BaseModel, ABC):
|
|||||||
Save the documents to the storage.
|
Save the documents to the storage.
|
||||||
This method should be called after the chunks and embeddings are generated.
|
This method should be called after the chunks and embeddings are generated.
|
||||||
"""
|
"""
|
||||||
|
print("CHUNKS: ", self.chunks)
|
||||||
self.storage.save(self.chunks)
|
self.storage.save(self.chunks)
|
||||||
|
|||||||
@@ -1592,18 +1592,18 @@ def test_agent_execute_task_with_ollama():
|
|||||||
assert "AI" in result or "artificial intelligence" in result.lower()
|
assert "AI" in result or "artificial intelligence" in result.lower()
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.vcr(filter_headers=["authorization"])
|
# @pytest.mark.vcr(filter_headers=["authorization"])
|
||||||
def test_agent_with_knowledge_sources():
|
def test_agent_with_knowledge_sources():
|
||||||
# Create a knowledge source with some content
|
# Create a knowledge source with some content
|
||||||
content = "Brandon's favorite color is red and he likes Mexican food."
|
content = "Brandon's favorite color is red and he likes Mexican food."
|
||||||
string_source = StringKnowledgeSource(content=content)
|
string_source = StringKnowledgeSource(content=content)
|
||||||
|
|
||||||
with patch(
|
# with patch(
|
||||||
"crewai.knowledge.storage.knowledge_storage.KnowledgeStorage"
|
# "crewai.knowledge.storage.knowledge_storage.KnowledgeStorage"
|
||||||
) as MockKnowledge:
|
# ) as MockKnowledge:
|
||||||
mock_knowledge_instance = MockKnowledge.return_value
|
# mock_knowledge_instance = MockKnowledge.return_value
|
||||||
mock_knowledge_instance.sources = [string_source]
|
# mock_knowledge_instance.sources = [string_source]
|
||||||
mock_knowledge_instance.query.return_value = [{"content": content}]
|
# mock_knowledge_instance.query.return_value = [{"content": content}]
|
||||||
|
|
||||||
agent = Agent(
|
agent = Agent(
|
||||||
role="Information Agent",
|
role="Information Agent",
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user