mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 08:08:32 +00:00
updating readme
This commit is contained in:
@@ -86,10 +86,12 @@ researcher = Agent(
|
|||||||
# model like OpenAI, Mistral, Antrophic or others (https://python.langchain.com/docs/integrations/llms/)
|
# model like OpenAI, Mistral, Antrophic or others (https://python.langchain.com/docs/integrations/llms/)
|
||||||
#
|
#
|
||||||
# Examples:
|
# Examples:
|
||||||
|
#
|
||||||
|
# from langchain.llms import Ollama
|
||||||
# llm=ollama_llm # was defined above in the file
|
# llm=ollama_llm # was defined above in the file
|
||||||
# llm=OpenAI(model_name="gpt-3.5", temperature=0.7)
|
#
|
||||||
# For the OpenAI model you would need to import
|
# from langchain_openai import ChatOpenAI
|
||||||
# from langchain_openai import OpenAI
|
# llm=ChatOpenAI(model_name="gpt-3.5", temperature=0.7)
|
||||||
)
|
)
|
||||||
writer = Agent(
|
writer = Agent(
|
||||||
role='Tech Content Strategist',
|
role='Tech Content Strategist',
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ from unittest.mock import patch
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from langchain.tools import tool
|
from langchain.tools import tool
|
||||||
from langchain_openai import ChatOpenAI as OpenAI
|
from langchain_openai import ChatOpenAI
|
||||||
|
|
||||||
from crewai import Agent, Crew, Task
|
from crewai import Agent, Crew, Task
|
||||||
from crewai.agents.cache import CacheHandler
|
from crewai.agents.cache import CacheHandler
|
||||||
@@ -24,7 +24,7 @@ def test_agent_creation():
|
|||||||
def test_agent_default_values():
|
def test_agent_default_values():
|
||||||
agent = Agent(role="test role", goal="test goal", backstory="test backstory")
|
agent = Agent(role="test role", goal="test goal", backstory="test backstory")
|
||||||
|
|
||||||
assert isinstance(agent.llm, OpenAI)
|
assert isinstance(agent.llm, ChatOpenAI)
|
||||||
assert agent.llm.model_name == "gpt-4"
|
assert agent.llm.model_name == "gpt-4"
|
||||||
assert agent.llm.temperature == 0.7
|
assert agent.llm.temperature == 0.7
|
||||||
assert agent.llm.verbose == False
|
assert agent.llm.verbose == False
|
||||||
@@ -36,10 +36,10 @@ def test_custom_llm():
|
|||||||
role="test role",
|
role="test role",
|
||||||
goal="test goal",
|
goal="test goal",
|
||||||
backstory="test backstory",
|
backstory="test backstory",
|
||||||
llm=OpenAI(temperature=0, model="gpt-4"),
|
llm=ChatOpenAI(temperature=0, model="gpt-4"),
|
||||||
)
|
)
|
||||||
|
|
||||||
assert isinstance(agent.llm, OpenAI)
|
assert isinstance(agent.llm, ChatOpenAI)
|
||||||
assert agent.llm.model_name == "gpt-4"
|
assert agent.llm.model_name == "gpt-4"
|
||||||
assert agent.llm.temperature == 0
|
assert agent.llm.temperature == 0
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ def test_agent_without_memory():
|
|||||||
goal="test goal",
|
goal="test goal",
|
||||||
backstory="test backstory",
|
backstory="test backstory",
|
||||||
memory=False,
|
memory=False,
|
||||||
llm=OpenAI(temperature=0, model="gpt-4"),
|
llm=ChatOpenAI(temperature=0, model="gpt-4"),
|
||||||
)
|
)
|
||||||
|
|
||||||
memory_agent = Agent(
|
memory_agent = Agent(
|
||||||
@@ -59,7 +59,7 @@ def test_agent_without_memory():
|
|||||||
goal="test goal",
|
goal="test goal",
|
||||||
backstory="test backstory",
|
backstory="test backstory",
|
||||||
memory=True,
|
memory=True,
|
||||||
llm=OpenAI(temperature=0, model="gpt-4"),
|
llm=ChatOpenAI(temperature=0, model="gpt-4"),
|
||||||
)
|
)
|
||||||
|
|
||||||
result = no_memory_agent.execute_task("How much is 1 + 1?")
|
result = no_memory_agent.execute_task("How much is 1 + 1?")
|
||||||
|
|||||||
Reference in New Issue
Block a user