mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 08:08:32 +00:00
Merge branch 'main' of https://github.com/joaomdmoura/crewAI
This commit is contained in:
10
.github/workflows/black.yml
vendored
10
.github/workflows/black.yml
vendored
@@ -1,10 +0,0 @@
|
|||||||
name: Lint
|
|
||||||
|
|
||||||
on: [pull_request]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
lint:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: psf/black@stable
|
|
||||||
16
.github/workflows/linter.yml
vendored
Normal file
16
.github/workflows/linter.yml
vendored
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
name: Lint
|
||||||
|
|
||||||
|
on: [pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Install Requirements
|
||||||
|
run: |
|
||||||
|
pip install ruff
|
||||||
|
|
||||||
|
- name: Run Ruff Linter
|
||||||
|
run: ruff check --exclude "templates","__init__.py"
|
||||||
4
.github/workflows/tests.yml
vendored
4
.github/workflows/tests.yml
vendored
@@ -14,12 +14,12 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.10'
|
python-version: "3.10"
|
||||||
|
|
||||||
- name: Install Requirements
|
- name: Install Requirements
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
12
.github/workflows/type-checker.yml
vendored
12
.github/workflows/type-checker.yml
vendored
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
name: Run Type Checks
|
name: Run Type Checks
|
||||||
|
|
||||||
on: [pull_request]
|
on: [pull_request]
|
||||||
@@ -12,19 +11,16 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.10'
|
python-version: "3.10"
|
||||||
|
|
||||||
- name: Install Requirements
|
- name: Install Requirements
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update &&
|
pip install mypy
|
||||||
pip install poetry &&
|
|
||||||
poetry lock &&
|
|
||||||
poetry install
|
|
||||||
|
|
||||||
- name: Run type checks
|
- name: Run type checks
|
||||||
run: poetry run pyright
|
run: mypy src
|
||||||
|
|||||||
@@ -1,21 +1,7 @@
|
|||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/psf/black-pre-commit-mirror
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
rev: 23.12.1
|
rev: v0.4.4
|
||||||
hooks:
|
hooks:
|
||||||
- id: black
|
# Run the linter.
|
||||||
language_version: python3.11
|
- id: ruff
|
||||||
files: \.(py)$
|
args: [--fix]
|
||||||
exclude: 'src/crewai/cli/templates/(crew|main)\.py'
|
|
||||||
|
|
||||||
- repo: https://github.com/pycqa/isort
|
|
||||||
rev: 5.13.2
|
|
||||||
hooks:
|
|
||||||
- id: isort
|
|
||||||
name: isort (python)
|
|
||||||
args: ["--profile", "black", "--filter-files"]
|
|
||||||
|
|
||||||
- repo: https://github.com/PyCQA/autoflake
|
|
||||||
rev: v2.2.1
|
|
||||||
hooks:
|
|
||||||
- id: autoflake
|
|
||||||
args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variables', '--ignore-init-module-imports']
|
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ poetry run pytest
|
|||||||
### Running static type checks
|
### Running static type checks
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
poetry run pyright
|
poetry run mypy
|
||||||
```
|
```
|
||||||
|
|
||||||
### Packaging
|
### Packaging
|
||||||
|
|||||||
@@ -103,7 +103,8 @@ general_agent = Agent(role = "Math Professor",
|
|||||||
verbose = True,
|
verbose = True,
|
||||||
llm = llm)
|
llm = llm)
|
||||||
task = Task (description="""what is 3 + 5""",
|
task = Task (description="""what is 3 + 5""",
|
||||||
agent = general_agent)
|
agent = general_agent,
|
||||||
|
expected_output="A numerical answer.")
|
||||||
|
|
||||||
crew = Crew(
|
crew = Crew(
|
||||||
agents=[general_agent],
|
agents=[general_agent],
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ tool = CSVSearchTool(
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
embedder=dict(
|
embedder=dict(
|
||||||
provider="google",
|
provider="google", # or openai, ollama, ...
|
||||||
config=dict(
|
config=dict(
|
||||||
model="models/embedding-001",
|
model="models/embedding-001",
|
||||||
task_type="retrieval_document",
|
task_type="retrieval_document",
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ tool = CodeDocsSearchTool(
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
embedder=dict(
|
embedder=dict(
|
||||||
provider="google",
|
provider="google", # or openai, ollama, ...
|
||||||
config=dict(
|
config=dict(
|
||||||
model="models/embedding-001",
|
model="models/embedding-001",
|
||||||
task_type="retrieval_document",
|
task_type="retrieval_document",
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ tool = DOCXSearchTool(
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
embedder=dict(
|
embedder=dict(
|
||||||
provider="google",
|
provider="google", # or openai, ollama, ...
|
||||||
config=dict(
|
config=dict(
|
||||||
model="models/embedding-001",
|
model="models/embedding-001",
|
||||||
task_type="retrieval_document",
|
task_type="retrieval_document",
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ tool = DirectorySearchTool(
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
embedder=dict(
|
embedder=dict(
|
||||||
provider="google",
|
provider="google", # or openai, ollama, ...
|
||||||
config=dict(
|
config=dict(
|
||||||
model="models/embedding-001",
|
model="models/embedding-001",
|
||||||
task_type="retrieval_document",
|
task_type="retrieval_document",
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ tool = GithubSearchTool(
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
embedder=dict(
|
embedder=dict(
|
||||||
provider="google",
|
provider="google", # or openai, ollama, ...
|
||||||
config=dict(
|
config=dict(
|
||||||
model="models/embedding-001",
|
model="models/embedding-001",
|
||||||
task_type="retrieval_document",
|
task_type="retrieval_document",
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ tool = JSONSearchTool(
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
"embedder": {
|
"embedder": {
|
||||||
"provider": "google",
|
"provider": "google", # or openai, ollama, ...
|
||||||
"config": {
|
"config": {
|
||||||
"model": "models/embedding-001",
|
"model": "models/embedding-001",
|
||||||
"task_type": "retrieval_document",
|
"task_type": "retrieval_document",
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ tool = MDXSearchTool(
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
embedder=dict(
|
embedder=dict(
|
||||||
provider="google",
|
provider="google", # or openai, ollama, ...
|
||||||
config=dict(
|
config=dict(
|
||||||
model="models/embedding-001",
|
model="models/embedding-001",
|
||||||
task_type="retrieval_document",
|
task_type="retrieval_document",
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ tool = PDFSearchTool(
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
embedder=dict(
|
embedder=dict(
|
||||||
provider="google",
|
provider="google", # or openai, ollama, ...
|
||||||
config=dict(
|
config=dict(
|
||||||
model="models/embedding-001",
|
model="models/embedding-001",
|
||||||
task_type="retrieval_document",
|
task_type="retrieval_document",
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ tool = PGSearchTool(
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
embedder=dict(
|
embedder=dict(
|
||||||
provider="google",
|
provider="google", # or openai, ollama, ...
|
||||||
config=dict(
|
config=dict(
|
||||||
model="models/embedding-001",
|
model="models/embedding-001",
|
||||||
task_type="retrieval_document",
|
task_type="retrieval_document",
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ tool = TXTSearchTool(
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
embedder=dict(
|
embedder=dict(
|
||||||
provider="google",
|
provider="google", # or openai, ollama, ...
|
||||||
config=dict(
|
config=dict(
|
||||||
model="models/embedding-001",
|
model="models/embedding-001",
|
||||||
task_type="retrieval_document",
|
task_type="retrieval_document",
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ tool = WebsiteSearchTool(
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
embedder=dict(
|
embedder=dict(
|
||||||
provider="google",
|
provider="google", # or openai, ollama, ...
|
||||||
config=dict(
|
config=dict(
|
||||||
model="models/embedding-001",
|
model="models/embedding-001",
|
||||||
task_type="retrieval_document",
|
task_type="retrieval_document",
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ tool = XMLSearchTool(
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
embedder=dict(
|
embedder=dict(
|
||||||
provider="google",
|
provider="google", # or openai, ollama, ...
|
||||||
config=dict(
|
config=dict(
|
||||||
model="models/embedding-001",
|
model="models/embedding-001",
|
||||||
task_type="retrieval_document",
|
task_type="retrieval_document",
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ tool = YoutubeChannelSearchTool(
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
embedder=dict(
|
embedder=dict(
|
||||||
provider="google",
|
provider="google", # or openai, ollama, ...
|
||||||
config=dict(
|
config=dict(
|
||||||
model="models/embedding-001",
|
model="models/embedding-001",
|
||||||
task_type="retrieval_document",
|
task_type="retrieval_document",
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ tool = YoutubeVideoSearchTool(
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
embedder=dict(
|
embedder=dict(
|
||||||
provider="google",
|
provider="google", # or openai, ollama, ...
|
||||||
config=dict(
|
config=dict(
|
||||||
model="models/embedding-001",
|
model="models/embedding-001",
|
||||||
task_type="retrieval_document",
|
task_type="retrieval_document",
|
||||||
|
|||||||
1234
poetry.lock
generated
1234
poetry.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,12 +1,10 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "crewai"
|
name = "crewai"
|
||||||
version = "0.30.0rc6"
|
version = "0.30.11"
|
||||||
description = "Cutting-edge framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks."
|
description = "Cutting-edge framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks."
|
||||||
authors = ["Joao Moura <joao@crewai.com>"]
|
authors = ["Joao Moura <joao@crewai.com>"]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
packages = [
|
packages = [{ include = "crewai", from = "src" }]
|
||||||
{ include = "crewai", from = "src" },
|
|
||||||
]
|
|
||||||
|
|
||||||
[tool.poetry.urls]
|
[tool.poetry.urls]
|
||||||
Homepage = "https://crewai.com"
|
Homepage = "https://crewai.com"
|
||||||
@@ -23,7 +21,7 @@ opentelemetry-sdk = "^1.22.0"
|
|||||||
opentelemetry-exporter-otlp-proto-http = "^1.22.0"
|
opentelemetry-exporter-otlp-proto-http = "^1.22.0"
|
||||||
instructor = "^0.5.2"
|
instructor = "^0.5.2"
|
||||||
regex = "^2023.12.25"
|
regex = "^2023.12.25"
|
||||||
crewai-tools = { version = "^0.2.3", optional = true }
|
crewai-tools = { version = "^0.2.6", optional = true }
|
||||||
click = "^8.1.7"
|
click = "^8.1.7"
|
||||||
python-dotenv = "^1.0.0"
|
python-dotenv = "^1.0.0"
|
||||||
embedchain = "^0.1.98"
|
embedchain = "^0.1.98"
|
||||||
@@ -36,22 +34,17 @@ agentops = ["agentops"]
|
|||||||
|
|
||||||
[tool.poetry.group.dev.dependencies]
|
[tool.poetry.group.dev.dependencies]
|
||||||
isort = "^5.13.2"
|
isort = "^5.13.2"
|
||||||
pyright = ">=1.1.350,<2.0.0"
|
mypy = "1.10.0"
|
||||||
autoflake = "^2.2.1"
|
autoflake = "^2.2.1"
|
||||||
pre-commit = "^3.6.0"
|
pre-commit = "^3.6.0"
|
||||||
mkdocs = "^1.4.3"
|
mkdocs = "^1.4.3"
|
||||||
mkdocstrings = "^0.22.0"
|
mkdocstrings = "^0.22.0"
|
||||||
mkdocstrings-python = "^1.1.2"
|
mkdocstrings-python = "^1.1.2"
|
||||||
mkdocs-material = {extras = ["imaging"], version = "^9.5.7"}
|
mkdocs-material = { extras = ["imaging"], version = "^9.5.7" }
|
||||||
mkdocs-material-extensions = "^1.3.1"
|
mkdocs-material-extensions = "^1.3.1"
|
||||||
pillow = "^10.2.0"
|
pillow = "^10.2.0"
|
||||||
cairosvg = "^2.7.1"
|
cairosvg = "^2.7.1"
|
||||||
crewai-tools = "^0.2.3"
|
crewai-tools = "^0.2.6"
|
||||||
|
|
||||||
[tool.isort]
|
|
||||||
profile = "black"
|
|
||||||
known_first_party = ["crewai"]
|
|
||||||
|
|
||||||
|
|
||||||
[tool.poetry.group.test.dependencies]
|
[tool.poetry.group.test.dependencies]
|
||||||
pytest = "^8.0.0"
|
pytest = "^8.0.0"
|
||||||
@@ -61,6 +54,11 @@ python-dotenv = "1.0.0"
|
|||||||
[tool.poetry.scripts]
|
[tool.poetry.scripts]
|
||||||
crewai = "crewai.cli.cli:crewai"
|
crewai = "crewai.cli.cli:crewai"
|
||||||
|
|
||||||
|
[tool.mypy]
|
||||||
|
ignore_missing_imports = true
|
||||||
|
disable_error_code = 'import-untyped'
|
||||||
|
exclude = ["cli/templates/main.py", "cli/templates/crew.py"]
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry-core"]
|
requires = ["poetry-core"]
|
||||||
build-backend = "poetry.core.masonry.api"
|
build-backend = "poetry.core.masonry.api"
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ class Agent(BaseModel):
|
|||||||
Output of the agent
|
Output of the agent
|
||||||
"""
|
"""
|
||||||
if self.tools_handler:
|
if self.tools_handler:
|
||||||
self.tools_handler.last_used_tool = {}
|
self.tools_handler.last_used_tool = {} # type: ignore # Incompatible types in assignment (expression has type "dict[Never, Never]", variable has type "ToolCalling")
|
||||||
|
|
||||||
task_prompt = task.prompt()
|
task_prompt = task.prompt()
|
||||||
|
|
||||||
@@ -246,7 +246,7 @@ class Agent(BaseModel):
|
|||||||
task_prompt += self.i18n.slice("memory").format(memory=memory)
|
task_prompt += self.i18n.slice("memory").format(memory=memory)
|
||||||
|
|
||||||
tools = tools or self.tools
|
tools = tools or self.tools
|
||||||
parsed_tools = self._parse_tools(tools)
|
parsed_tools = self._parse_tools(tools) # type: ignore # Argument 1 to "_parse_tools" of "Agent" has incompatible type "list[Any] | None"; expected "list[Any]"
|
||||||
|
|
||||||
self.create_agent_executor(tools=tools)
|
self.create_agent_executor(tools=tools)
|
||||||
self.agent_executor.tools = parsed_tools
|
self.agent_executor.tools = parsed_tools
|
||||||
@@ -386,7 +386,7 @@ class Agent(BaseModel):
|
|||||||
thoughts += f"\n{observation_prefix}{observation}\n{llm_prefix}"
|
thoughts += f"\n{observation_prefix}{observation}\n{llm_prefix}"
|
||||||
return thoughts
|
return thoughts
|
||||||
|
|
||||||
def _parse_tools(self, tools: List[Any]) -> List[LangChainTool]:
|
def _parse_tools(self, tools: List[Any]) -> List[LangChainTool]: # type: ignore # Function "langchain_core.tools.tool" is not valid as a type
|
||||||
"""Parse tools to be used for the task."""
|
"""Parse tools to be used for the task."""
|
||||||
# tentatively try to import from crewai_tools import BaseTool as CrewAITool
|
# tentatively try to import from crewai_tools import BaseTool as CrewAITool
|
||||||
tools_list = []
|
tools_list = []
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class CrewAgentExecutor(AgentExecutor):
|
|||||||
crew: Any = None
|
crew: Any = None
|
||||||
function_calling_llm: Any = None
|
function_calling_llm: Any = None
|
||||||
request_within_rpm_limit: Any = None
|
request_within_rpm_limit: Any = None
|
||||||
tools_handler: InstanceOf[ToolsHandler] = None
|
tools_handler: Optional[InstanceOf[ToolsHandler]] = None
|
||||||
max_iterations: Optional[int] = 15
|
max_iterations: Optional[int] = 15
|
||||||
have_forced_answer: bool = False
|
have_forced_answer: bool = False
|
||||||
force_answer_max_iterations: Optional[int] = None
|
force_answer_max_iterations: Optional[int] = None
|
||||||
@@ -189,7 +189,7 @@ class CrewAgentExecutor(AgentExecutor):
|
|||||||
intermediate_steps = self._prepare_intermediate_steps(intermediate_steps)
|
intermediate_steps = self._prepare_intermediate_steps(intermediate_steps)
|
||||||
|
|
||||||
# Call the LLM to see what to do.
|
# Call the LLM to see what to do.
|
||||||
output = self.agent.plan(
|
output = self.agent.plan( # type: ignore # Incompatible types in assignment (expression has type "AgentAction | AgentFinish | list[AgentAction]", variable has type "AgentAction")
|
||||||
intermediate_steps,
|
intermediate_steps,
|
||||||
callbacks=run_manager.get_child() if run_manager else None,
|
callbacks=run_manager.get_child() if run_manager else None,
|
||||||
**inputs,
|
**inputs,
|
||||||
@@ -275,8 +275,8 @@ class CrewAgentExecutor(AgentExecutor):
|
|||||||
run_manager.on_agent_action(agent_action, color="green")
|
run_manager.on_agent_action(agent_action, color="green")
|
||||||
|
|
||||||
tool_usage = ToolUsage(
|
tool_usage = ToolUsage(
|
||||||
tools_handler=self.tools_handler,
|
tools_handler=self.tools_handler, # type: ignore # Argument "tools_handler" to "ToolUsage" has incompatible type "ToolsHandler | None"; expected "ToolsHandler"
|
||||||
tools=self.tools,
|
tools=self.tools, # type: ignore # Argument "tools" to "ToolUsage" has incompatible type "Sequence[BaseTool]"; expected "list[BaseTool]"
|
||||||
original_tools=self.original_tools,
|
original_tools=self.original_tools,
|
||||||
tools_description=self.tools_description,
|
tools_description=self.tools_description,
|
||||||
tools_names=self.tools_names,
|
tools_names=self.tools_names,
|
||||||
|
|||||||
@@ -8,13 +8,13 @@ from .cache.cache_handler import CacheHandler
|
|||||||
class ToolsHandler:
|
class ToolsHandler:
|
||||||
"""Callback handler for tool usage."""
|
"""Callback handler for tool usage."""
|
||||||
|
|
||||||
last_used_tool: ToolCalling = {}
|
last_used_tool: ToolCalling = {} # type: ignore # BUG?: Incompatible types in assignment (expression has type "Dict[...]", variable has type "ToolCalling")
|
||||||
cache: CacheHandler
|
cache: Optional[CacheHandler]
|
||||||
|
|
||||||
def __init__(self, cache: Optional[CacheHandler] = None):
|
def __init__(self, cache: Optional[CacheHandler] = None):
|
||||||
"""Initialize the callback handler."""
|
"""Initialize the callback handler."""
|
||||||
self.cache = cache
|
self.cache = cache
|
||||||
self.last_used_tool = {}
|
self.last_used_tool = {} # type: ignore # BUG?: same as above
|
||||||
|
|
||||||
def on_tool_use(
|
def on_tool_use(
|
||||||
self,
|
self,
|
||||||
@@ -23,7 +23,7 @@ class ToolsHandler:
|
|||||||
should_cache: bool = True,
|
should_cache: bool = True,
|
||||||
) -> Any:
|
) -> Any:
|
||||||
"""Run when tool ends running."""
|
"""Run when tool ends running."""
|
||||||
self.last_used_tool = calling
|
self.last_used_tool = calling # type: ignore # BUG?: Incompatible types in assignment (expression has type "Union[ToolCalling, InstructorToolCalling]", variable has type "ToolCalling")
|
||||||
if self.cache and should_cache and calling.tool_name != CacheTools().name:
|
if self.cache and should_cache and calling.tool_name != CacheTools().name:
|
||||||
self.cache.add(
|
self.cache.add(
|
||||||
tool=calling.tool_name,
|
tool=calling.tool_name,
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import click
|
import click
|
||||||
|
import pkg_resources
|
||||||
|
|
||||||
from .create_crew import create_crew
|
from .create_crew import create_crew
|
||||||
|
|
||||||
@@ -15,5 +16,22 @@ def create(project_name):
|
|||||||
create_crew(project_name)
|
create_crew(project_name)
|
||||||
|
|
||||||
|
|
||||||
|
@crewai.command()
|
||||||
|
@click.option(
|
||||||
|
"--tools", is_flag=True, help="Show the installed version of crewai tools"
|
||||||
|
)
|
||||||
|
def version(tools):
|
||||||
|
"""Show the installed version of crewai."""
|
||||||
|
crewai_version = pkg_resources.get_distribution("crewai").version
|
||||||
|
click.echo(f"crewai version: {crewai_version}")
|
||||||
|
|
||||||
|
if tools:
|
||||||
|
try:
|
||||||
|
tools_version = pkg_resources.get_distribution("crewai[tools]").version
|
||||||
|
click.echo(f"crewai tools version: {tools_version}")
|
||||||
|
except pkg_resources.DistributionNotFound:
|
||||||
|
click.echo("crewai tools not installed")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
crewai()
|
crewai()
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ authors = ["Your Name <you@example.com>"]
|
|||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = ">=3.10,<=3.13"
|
python = ">=3.10,<=3.13"
|
||||||
crewai = {extras = ["tools"], version = "^0.28.8"}
|
crewai = {extras = ["tools"], version = "^0.30.11"}
|
||||||
|
|
||||||
[tool.poetry.scripts]
|
[tool.poetry.scripts]
|
||||||
{{folder_name}} = "{{folder_name}}.main:run"
|
{{folder_name}} = "{{folder_name}}.main:run"
|
||||||
|
|||||||
0
src/crewai/cli/train_crew.py
Normal file
0
src/crewai/cli/train_crew.py
Normal file
@@ -169,8 +169,8 @@ class Crew(BaseModel):
|
|||||||
"""Set private attributes."""
|
"""Set private attributes."""
|
||||||
if self.memory:
|
if self.memory:
|
||||||
self._long_term_memory = LongTermMemory()
|
self._long_term_memory = LongTermMemory()
|
||||||
self._short_term_memory = ShortTermMemory(embedder_config=self.embedder)
|
self._short_term_memory = ShortTermMemory(crew=self, embedder_config=self.embedder)
|
||||||
self._entity_memory = EntityMemory(embedder_config=self.embedder)
|
self._entity_memory = EntityMemory(crew=self, embedder_config=self.embedder)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
@model_validator(mode="after")
|
@model_validator(mode="after")
|
||||||
@@ -247,7 +247,7 @@ class Crew(BaseModel):
|
|||||||
def kickoff(self, inputs: Optional[Dict[str, Any]] = {}) -> str:
|
def kickoff(self, inputs: Optional[Dict[str, Any]] = {}) -> str:
|
||||||
"""Starts the crew to work on its assigned tasks."""
|
"""Starts the crew to work on its assigned tasks."""
|
||||||
self._execution_span = self._telemetry.crew_execution_span(self)
|
self._execution_span = self._telemetry.crew_execution_span(self)
|
||||||
self._interpolate_inputs(inputs)
|
self._interpolate_inputs(inputs) # type: ignore # Argument 1 to "_interpolate_inputs" of "Crew" has incompatible type "dict[str, Any] | None"; expected "dict[str, Any]"
|
||||||
self._set_tasks_callbacks()
|
self._set_tasks_callbacks()
|
||||||
|
|
||||||
i18n = I18N(prompt_file=self.prompt_file)
|
i18n = I18N(prompt_file=self.prompt_file)
|
||||||
@@ -270,8 +270,8 @@ class Crew(BaseModel):
|
|||||||
if self.process == Process.sequential:
|
if self.process == Process.sequential:
|
||||||
result = self._run_sequential_process()
|
result = self._run_sequential_process()
|
||||||
elif self.process == Process.hierarchical:
|
elif self.process == Process.hierarchical:
|
||||||
result, manager_metrics = self._run_hierarchical_process()
|
result, manager_metrics = self._run_hierarchical_process() # type: ignore # Unpacking a string is disallowed
|
||||||
metrics.append(manager_metrics)
|
metrics.append(manager_metrics) # type: ignore # Cannot determine type of "manager_metrics"
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise NotImplementedError(
|
raise NotImplementedError(
|
||||||
@@ -291,7 +291,7 @@ class Crew(BaseModel):
|
|||||||
"""Executes tasks sequentially and returns the final output."""
|
"""Executes tasks sequentially and returns the final output."""
|
||||||
task_output = ""
|
task_output = ""
|
||||||
for task in self.tasks:
|
for task in self.tasks:
|
||||||
if task.agent.allow_delegation:
|
if task.agent.allow_delegation: # type: ignore # Item "None" of "Agent | None" has no attribute "allow_delegation"
|
||||||
agents_for_delegation = [
|
agents_for_delegation = [
|
||||||
agent for agent in self.agents if agent != task.agent
|
agent for agent in self.agents if agent != task.agent
|
||||||
]
|
]
|
||||||
@@ -364,23 +364,23 @@ class Crew(BaseModel):
|
|||||||
)
|
)
|
||||||
|
|
||||||
self._finish_execution(task_output)
|
self._finish_execution(task_output)
|
||||||
return self._format_output(task_output), manager._token_process.get_summary()
|
return self._format_output(task_output), manager._token_process.get_summary() # type: ignore # Incompatible return value type (got "tuple[str, Any]", expected "str")
|
||||||
|
|
||||||
def _set_tasks_callbacks(self) -> str:
|
def _set_tasks_callbacks(self) -> None:
|
||||||
"""Sets callback for every task suing task_callback"""
|
"""Sets callback for every task suing task_callback"""
|
||||||
for task in self.tasks:
|
for task in self.tasks:
|
||||||
if not task.callback:
|
if not task.callback:
|
||||||
task.callback = self.task_callback
|
task.callback = self.task_callback
|
||||||
|
|
||||||
def _interpolate_inputs(self, inputs: Dict[str, Any]) -> str:
|
def _interpolate_inputs(self, inputs: Dict[str, Any]) -> None:
|
||||||
"""Interpolates the inputs in the tasks and agents."""
|
"""Interpolates the inputs in the tasks and agents."""
|
||||||
[task.interpolate_inputs(inputs) for task in self.tasks]
|
[task.interpolate_inputs(inputs) for task in self.tasks] # type: ignore # "interpolate_inputs" of "Task" does not return a value (it only ever returns None)
|
||||||
[agent.interpolate_inputs(inputs) for agent in self.agents]
|
[agent.interpolate_inputs(inputs) for agent in self.agents] # type: ignore # "interpolate_inputs" of "Agent" does not return a value (it only ever returns None)
|
||||||
|
|
||||||
def _format_output(self, output: str) -> str:
|
def _format_output(self, output: str) -> str:
|
||||||
"""Formats the output of the crew execution."""
|
"""Formats the output of the crew execution."""
|
||||||
if self.full_output:
|
if self.full_output:
|
||||||
return {
|
return { # type: ignore # Incompatible return value type (got "dict[str, Sequence[str | TaskOutput | None]]", expected "str")
|
||||||
"final_output": output,
|
"final_output": output,
|
||||||
"tasks_outputs": [task.output for task in self.tasks if task],
|
"tasks_outputs": [task.output for task in self.tasks if task],
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
from typing import Optional
|
||||||
|
|
||||||
from crewai.memory import EntityMemory, LongTermMemory, ShortTermMemory
|
from crewai.memory import EntityMemory, LongTermMemory, ShortTermMemory
|
||||||
|
|
||||||
|
|
||||||
@@ -32,7 +34,7 @@ class ContextualMemory:
|
|||||||
formatted_results = "\n".join([f"- {result}" for result in stm_results])
|
formatted_results = "\n".join([f"- {result}" for result in stm_results])
|
||||||
return f"Recent Insights:\n{formatted_results}" if stm_results else ""
|
return f"Recent Insights:\n{formatted_results}" if stm_results else ""
|
||||||
|
|
||||||
def _fetch_ltm_context(self, task) -> str:
|
def _fetch_ltm_context(self, task) -> Optional[str]:
|
||||||
"""
|
"""
|
||||||
Fetches historical data or insights from LTM that are relevant to the task's description and expected_output,
|
Fetches historical data or insights from LTM that are relevant to the task's description and expected_output,
|
||||||
formatted as bullet points.
|
formatted as bullet points.
|
||||||
@@ -44,10 +46,10 @@ class ContextualMemory:
|
|||||||
formatted_results = [
|
formatted_results = [
|
||||||
suggestion
|
suggestion
|
||||||
for result in ltm_results
|
for result in ltm_results
|
||||||
for suggestion in result["metadata"]["suggestions"]
|
for suggestion in result["metadata"]["suggestions"] # type: ignore # Invalid index type "str" for "str"; expected type "SupportsIndex | slice"
|
||||||
]
|
]
|
||||||
formatted_results = list(dict.fromkeys(formatted_results))
|
formatted_results = list(dict.fromkeys(formatted_results))
|
||||||
formatted_results = "\n".join([f"- {result}" for result in formatted_results])
|
formatted_results = "\n".join([f"- {result}" for result in formatted_results]) # type: ignore # Incompatible types in assignment (expression has type "str", variable has type "list[str]")
|
||||||
|
|
||||||
return f"Historical Data:\n{formatted_results}" if ltm_results else ""
|
return f"Historical Data:\n{formatted_results}" if ltm_results else ""
|
||||||
|
|
||||||
@@ -58,6 +60,6 @@ class ContextualMemory:
|
|||||||
"""
|
"""
|
||||||
em_results = self.em.search(query)
|
em_results = self.em.search(query)
|
||||||
formatted_results = "\n".join(
|
formatted_results = "\n".join(
|
||||||
[f"- {result['context']}" for result in em_results]
|
[f"- {result['context']}" for result in em_results] # type: ignore # Invalid index type "str" for "str"; expected type "SupportsIndex | slice"
|
||||||
)
|
)
|
||||||
return f"Entities:\n{formatted_results}" if em_results else ""
|
return f"Entities:\n{formatted_results}" if em_results else ""
|
||||||
|
|||||||
@@ -10,13 +10,13 @@ class EntityMemory(Memory):
|
|||||||
Inherits from the Memory class.
|
Inherits from the Memory class.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, embedder_config=None):
|
def __init__(self, crew=None, embedder_config=None):
|
||||||
storage = RAGStorage(
|
storage = RAGStorage(
|
||||||
type="entities", allow_reset=False, embedder_config=embedder_config
|
type="entities", allow_reset=False, embedder_config=embedder_config, crew=crew
|
||||||
)
|
)
|
||||||
super().__init__(storage)
|
super().__init__(storage)
|
||||||
|
|
||||||
def save(self, item: EntityMemoryItem) -> None:
|
def save(self, item: EntityMemoryItem) -> None: # type: ignore # BUG?: Signature of "save" incompatible with supertype "Memory"
|
||||||
"""Saves an entity item into the SQLite storage."""
|
"""Saves an entity item into the SQLite storage."""
|
||||||
data = f"{item.name}({item.type}): {item.description}"
|
data = f"{item.name}({item.type}): {item.description}"
|
||||||
super().save(data, item.metadata)
|
super().save(data, item.metadata)
|
||||||
|
|||||||
@@ -18,10 +18,10 @@ class LongTermMemory(Memory):
|
|||||||
storage = LTMSQLiteStorage()
|
storage = LTMSQLiteStorage()
|
||||||
super().__init__(storage)
|
super().__init__(storage)
|
||||||
|
|
||||||
def save(self, item: LongTermMemoryItem) -> None:
|
def save(self, item: LongTermMemoryItem) -> None: # type: ignore # BUG?: Signature of "save" incompatible with supertype "Memory"
|
||||||
metadata = item.metadata
|
metadata = item.metadata
|
||||||
metadata.update({"agent": item.agent, "expected_output": item.expected_output})
|
metadata.update({"agent": item.agent, "expected_output": item.expected_output})
|
||||||
self.storage.save(
|
self.storage.save( # type: ignore # BUG?: Unexpected keyword argument "task_description","score","datetime" for "save" of "Storage"
|
||||||
task_description=item.task,
|
task_description=item.task,
|
||||||
score=metadata["quality"],
|
score=metadata["quality"],
|
||||||
metadata=metadata,
|
metadata=metadata,
|
||||||
@@ -29,4 +29,4 @@ class LongTermMemory(Memory):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def search(self, task: str, latest_n: int = 3) -> Dict[str, Any]:
|
def search(self, task: str, latest_n: int = 3) -> Dict[str, Any]:
|
||||||
return self.storage.load(task, latest_n)
|
return self.storage.load(task, latest_n) # type: ignore # BUG?: "Storage" has no attribute "load"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
from typing import Any, Dict, Union
|
from typing import Any, Dict, Optional, Union
|
||||||
|
|
||||||
|
|
||||||
class LongTermMemoryItem:
|
class LongTermMemoryItem:
|
||||||
@@ -8,8 +8,8 @@ class LongTermMemoryItem:
|
|||||||
task: str,
|
task: str,
|
||||||
expected_output: str,
|
expected_output: str,
|
||||||
datetime: str,
|
datetime: str,
|
||||||
quality: Union[int, float] = None,
|
quality: Optional[Union[int, float]] = None,
|
||||||
metadata: Dict[str, Any] = None,
|
metadata: Optional[Dict[str, Any]] = None,
|
||||||
):
|
):
|
||||||
self.task = task
|
self.task = task
|
||||||
self.agent = agent
|
self.agent = agent
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
from typing import Any, Dict
|
from typing import Any, Dict, Optional
|
||||||
|
|
||||||
from crewai.memory.storage.interface import Storage
|
from crewai.memory.storage.interface import Storage
|
||||||
|
|
||||||
@@ -12,12 +12,16 @@ class Memory:
|
|||||||
self.storage = storage
|
self.storage = storage
|
||||||
|
|
||||||
def save(
|
def save(
|
||||||
self, value: Any, metadata: Dict[str, Any] = None, agent: str = None
|
self,
|
||||||
|
value: Any,
|
||||||
|
metadata: Optional[Dict[str, Any]] = None,
|
||||||
|
agent: Optional[str] = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
metadata = metadata or {}
|
metadata = metadata or {}
|
||||||
if agent:
|
if agent:
|
||||||
metadata["agent"] = agent
|
metadata["agent"] = agent
|
||||||
self.storage.save(value, metadata)
|
|
||||||
|
self.storage.save(value, metadata) # type: ignore # Maybe BUG? Should be self.storage.save(key, value, metadata)
|
||||||
|
|
||||||
def search(self, query: str) -> Dict[str, Any]:
|
def search(self, query: str) -> Dict[str, Any]:
|
||||||
return self.storage.search(query)
|
return self.storage.search(query)
|
||||||
|
|||||||
@@ -12,12 +12,12 @@ class ShortTermMemory(Memory):
|
|||||||
MemoryItem instances.
|
MemoryItem instances.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, embedder_config=None):
|
def __init__(self, crew=None, embedder_config=None):
|
||||||
storage = RAGStorage(type="short_term", embedder_config=embedder_config)
|
storage = RAGStorage(type="short_term", embedder_config=embedder_config, crew=crew)
|
||||||
super().__init__(storage)
|
super().__init__(storage)
|
||||||
|
|
||||||
def save(self, item: ShortTermMemoryItem) -> None:
|
def save(self, item: ShortTermMemoryItem) -> None: # type: ignore # BUG?: Signature of "save" incompatible with supertype "Memory"
|
||||||
super().save(item.data, item.metadata, item.agent)
|
super().save(item.data, item.metadata, item.agent)
|
||||||
|
|
||||||
def search(self, query: str, score_threshold: float = 0.35):
|
def search(self, query: str, score_threshold: float = 0.35):
|
||||||
return self.storage.search(query=query, score_threshold=score_threshold)
|
return self.storage.search(query=query, score_threshold=score_threshold) # type: ignore # BUG? The reference is to the parent class, but the parent class does not have this parameters
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
from typing import Any, Dict
|
from typing import Any, Dict, Optional
|
||||||
|
|
||||||
|
|
||||||
class ShortTermMemoryItem:
|
class ShortTermMemoryItem:
|
||||||
def __init__(self, data: Any, agent: str, metadata: Dict[str, Any] = None):
|
def __init__(
|
||||||
|
self, data: Any, agent: str, metadata: Optional[Dict[str, Any]] = None
|
||||||
|
):
|
||||||
self.data = data
|
self.data = data
|
||||||
self.agent = agent
|
self.agent = agent
|
||||||
self.metadata = metadata if metadata is not None else {}
|
self.metadata = metadata if metadata is not None else {}
|
||||||
|
|||||||
@@ -7,5 +7,5 @@ class Storage:
|
|||||||
def save(self, key: str, value: Any, metadata: Dict[str, Any]) -> None:
|
def save(self, key: str, value: Any, metadata: Dict[str, Any]) -> None:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def search(self, key: str) -> Dict[str, Any]:
|
def search(self, key: str) -> Dict[str, Any]: # type: ignore
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import json
|
import json
|
||||||
import sqlite3
|
import sqlite3
|
||||||
from typing import Any, Dict, Union
|
from typing import Any, Dict, List, Optional, Union
|
||||||
|
|
||||||
from crewai.utilities import Printer
|
from crewai.utilities import Printer
|
||||||
from crewai.utilities.paths import db_storage_path
|
from crewai.utilities.paths import db_storage_path
|
||||||
@@ -11,7 +11,9 @@ class LTMSQLiteStorage:
|
|||||||
An updated SQLite storage class for LTM data storage.
|
An updated SQLite storage class for LTM data storage.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, db_path=f"{db_storage_path()}/long_term_memory_storage.db"):
|
def __init__(
|
||||||
|
self, db_path: str = f"{db_storage_path()}/long_term_memory_storage.db"
|
||||||
|
) -> None:
|
||||||
self.db_path = db_path
|
self.db_path = db_path
|
||||||
self._printer: Printer = Printer()
|
self._printer: Printer = Printer()
|
||||||
self._initialize_db()
|
self._initialize_db()
|
||||||
@@ -67,7 +69,9 @@ class LTMSQLiteStorage:
|
|||||||
color="red",
|
color="red",
|
||||||
)
|
)
|
||||||
|
|
||||||
def load(self, task_description: str, latest_n: int) -> Dict[str, Any]:
|
def load(
|
||||||
|
self, task_description: str, latest_n: int
|
||||||
|
) -> Optional[List[Dict[str, Any]]]:
|
||||||
"""Queries the LTM table by task description with error handling."""
|
"""Queries the LTM table by task description with error handling."""
|
||||||
try:
|
try:
|
||||||
with sqlite3.connect(self.db_path) as conn:
|
with sqlite3.connect(self.db_path) as conn:
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import contextlib
|
|||||||
import io
|
import io
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
from typing import Any, Dict
|
from typing import Any, Dict, List, Optional
|
||||||
|
|
||||||
from embedchain import App
|
from embedchain import App
|
||||||
from embedchain.llm.base import BaseLlm
|
from embedchain.llm.base import BaseLlm
|
||||||
@@ -37,13 +37,18 @@ class RAGStorage(Storage):
|
|||||||
search efficiency.
|
search efficiency.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, type, allow_reset=True, embedder_config=None):
|
def __init__(self, type, allow_reset=True, embedder_config=None, crew=None):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
if (
|
if (
|
||||||
not os.getenv("OPENAI_API_KEY")
|
not os.getenv("OPENAI_API_KEY")
|
||||||
and not os.getenv("OPENAI_BASE_URL") == "https://api.openai.com/v1"
|
and not os.getenv("OPENAI_BASE_URL") == "https://api.openai.com/v1"
|
||||||
):
|
):
|
||||||
os.environ["OPENAI_API_KEY"] = "fake"
|
os.environ["OPENAI_API_KEY"] = "fake"
|
||||||
|
|
||||||
|
agents = crew.agents if crew else []
|
||||||
|
agents = [agent.role for agent in agents]
|
||||||
|
agents = "_".join(agents)
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
"app": {
|
"app": {
|
||||||
"config": {"name": type, "collect_metrics": False, "log_level": "ERROR"}
|
"config": {"name": type, "collect_metrics": False, "log_level": "ERROR"}
|
||||||
@@ -58,7 +63,7 @@ class RAGStorage(Storage):
|
|||||||
"provider": "chroma",
|
"provider": "chroma",
|
||||||
"config": {
|
"config": {
|
||||||
"collection_name": type,
|
"collection_name": type,
|
||||||
"dir": f"{db_storage_path()}/{type}",
|
"dir": f"{db_storage_path()}/{type}/{agents}",
|
||||||
"allow_reset": allow_reset,
|
"allow_reset": allow_reset,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -72,16 +77,16 @@ class RAGStorage(Storage):
|
|||||||
if allow_reset:
|
if allow_reset:
|
||||||
self.app.reset()
|
self.app.reset()
|
||||||
|
|
||||||
def save(self, value: Any, metadata: Dict[str, Any]) -> None:
|
def save(self, value: Any, metadata: Dict[str, Any]) -> None: # type: ignore # BUG?: Should be save(key, value, metadata) Signature of "save" incompatible with supertype "Storage"
|
||||||
self._generate_embedding(value, metadata)
|
self._generate_embedding(value, metadata)
|
||||||
|
|
||||||
def search(
|
def search( # type: ignore # BUG?: Signature of "search" incompatible with supertype "Storage"
|
||||||
self,
|
self,
|
||||||
query: str,
|
query: str,
|
||||||
limit: int = 3,
|
limit: int = 3,
|
||||||
filter: dict = None,
|
filter: Optional[dict] = None,
|
||||||
score_threshold: float = 0.35,
|
score_threshold: float = 0.35,
|
||||||
) -> Dict[str, Any]:
|
) -> List[Any]:
|
||||||
with suppress_logging():
|
with suppress_logging():
|
||||||
try:
|
try:
|
||||||
results = (
|
results = (
|
||||||
|
|||||||
@@ -1,16 +1,18 @@
|
|||||||
import inspect
|
import inspect
|
||||||
import os
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
import yaml
|
import yaml
|
||||||
from dotenv import load_dotenv
|
import os
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
|
from pydantic import ConfigDict
|
||||||
|
|
||||||
|
from dotenv import load_dotenv
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
||||||
|
|
||||||
def CrewBase(cls):
|
def CrewBase(cls):
|
||||||
class WrappedClass(cls):
|
class WrappedClass(cls):
|
||||||
is_crew_class = True
|
model_config = ConfigDict(arbitrary_types_allowed=True)
|
||||||
|
is_crew_class: bool = True
|
||||||
|
|
||||||
base_directory = None
|
base_directory = None
|
||||||
for frame_info in inspect.stack():
|
for frame_info in inspect.stack():
|
||||||
@@ -40,6 +42,7 @@ def CrewBase(cls):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def load_yaml(config_path: str):
|
def load_yaml(config_path: str):
|
||||||
with open(config_path, "r") as file:
|
with open(config_path, "r") as file:
|
||||||
|
# parsedContent = YamlParser.parse(file) # type: ignore # Argument 1 to "parse" has incompatible type "TextIOWrapper"; expected "YamlParser"
|
||||||
return yaml.safe_load(file)
|
return yaml.safe_load(file)
|
||||||
|
|
||||||
return WrappedClass
|
return WrappedClass
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
|
import os
|
||||||
import re
|
import re
|
||||||
import threading
|
import threading
|
||||||
import uuid
|
import uuid
|
||||||
from typing import Any, Dict, List, Optional, Type
|
from typing import Any, Dict, List, Optional, Type
|
||||||
import os
|
|
||||||
|
|
||||||
from langchain_openai import ChatOpenAI
|
from langchain_openai import ChatOpenAI
|
||||||
from pydantic import UUID4, BaseModel, Field, field_validator, model_validator
|
from pydantic import UUID4, BaseModel, Field, field_validator, model_validator
|
||||||
@@ -41,7 +41,7 @@ class Task(BaseModel):
|
|||||||
tools_errors: int = 0
|
tools_errors: int = 0
|
||||||
delegations: int = 0
|
delegations: int = 0
|
||||||
i18n: I18N = I18N()
|
i18n: I18N = I18N()
|
||||||
thread: threading.Thread = None
|
thread: Optional[threading.Thread] = None
|
||||||
prompt_context: Optional[str] = None
|
prompt_context: Optional[str] = None
|
||||||
description: str = Field(description="Description of the actual task.")
|
description: str = Field(description="Description of the actual task.")
|
||||||
expected_output: str = Field(
|
expected_output: str = Field(
|
||||||
@@ -109,6 +109,14 @@ class Task(BaseModel):
|
|||||||
"may_not_set_field", "This field is not to be set by the user.", {}
|
"may_not_set_field", "This field is not to be set by the user.", {}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@field_validator("output_file")
|
||||||
|
@classmethod
|
||||||
|
def output_file_validattion(cls, value: str) -> str:
|
||||||
|
"""Validate the output file path by removing the / from the beginning of the path."""
|
||||||
|
if value.startswith("/"):
|
||||||
|
return value[1:]
|
||||||
|
return value
|
||||||
|
|
||||||
@model_validator(mode="after")
|
@model_validator(mode="after")
|
||||||
def set_attributes_based_on_config(self) -> "Task":
|
def set_attributes_based_on_config(self) -> "Task":
|
||||||
"""Set attributes based on the agent configuration."""
|
"""Set attributes based on the agent configuration."""
|
||||||
@@ -136,7 +144,7 @@ class Task(BaseModel):
|
|||||||
)
|
)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def execute(
|
def execute( # type: ignore # Missing return statement
|
||||||
self,
|
self,
|
||||||
agent: Agent | None = None,
|
agent: Agent | None = None,
|
||||||
context: Optional[str] = None,
|
context: Optional[str] = None,
|
||||||
@@ -155,12 +163,15 @@ class Task(BaseModel):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if self.context:
|
if self.context:
|
||||||
|
# type: ignore # Incompatible types in assignment (expression has type "list[Never]", variable has type "str | None")
|
||||||
context = []
|
context = []
|
||||||
for task in self.context:
|
for task in self.context:
|
||||||
if task.async_execution:
|
if task.async_execution:
|
||||||
task.thread.join()
|
task.thread.join() # type: ignore # Item "None" of "Thread | None" has no attribute "join"
|
||||||
if task and task.output:
|
if task and task.output:
|
||||||
|
# type: ignore # Item "str" of "str | None" has no attribute "append"
|
||||||
context.append(task.output.raw_output)
|
context.append(task.output.raw_output)
|
||||||
|
# type: ignore # Argument 1 to "join" of "str" has incompatible type "str | None"; expected "Iterable[str]"
|
||||||
context = "\n".join(context)
|
context = "\n".join(context)
|
||||||
|
|
||||||
self.prompt_context = context
|
self.prompt_context = context
|
||||||
@@ -193,6 +204,7 @@ class Task(BaseModel):
|
|||||||
description=self.description,
|
description=self.description,
|
||||||
exported_output=exported_output,
|
exported_output=exported_output,
|
||||||
raw_output=result,
|
raw_output=result,
|
||||||
|
agent=agent.role,
|
||||||
)
|
)
|
||||||
|
|
||||||
if self.callback:
|
if self.callback:
|
||||||
@@ -242,25 +254,29 @@ class Task(BaseModel):
|
|||||||
|
|
||||||
# try to convert task_output directly to pydantic/json
|
# try to convert task_output directly to pydantic/json
|
||||||
try:
|
try:
|
||||||
|
# type: ignore # Item "None" of "type[BaseModel] | None" has no attribute "model_validate_json"
|
||||||
exported_result = model.model_validate_json(result)
|
exported_result = model.model_validate_json(result)
|
||||||
if self.output_json:
|
if self.output_json:
|
||||||
return exported_result.model_dump()
|
return exported_result.model_dump() # type: ignore # "str" has no attribute "model_dump"
|
||||||
return exported_result
|
return exported_result
|
||||||
except Exception:
|
except Exception:
|
||||||
# sometimes the response contains valid JSON in the middle of text
|
# sometimes the response contains valid JSON in the middle of text
|
||||||
match = re.search(r"({.*})", result, re.DOTALL)
|
match = re.search(r"({.*})", result, re.DOTALL)
|
||||||
if match:
|
if match:
|
||||||
try:
|
try:
|
||||||
|
# type: ignore # Item "None" of "type[BaseModel] | None" has no attribute "model_validate_json"
|
||||||
exported_result = model.model_validate_json(match.group(0))
|
exported_result = model.model_validate_json(match.group(0))
|
||||||
if self.output_json:
|
if self.output_json:
|
||||||
return exported_result.model_dump()
|
return exported_result.model_dump() # type: ignore # "str" has no attribute "model_dump"
|
||||||
return exported_result
|
return exported_result
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
# type: ignore # Item "None" of "Agent | None" has no attribute "function_calling_llm"
|
||||||
llm = self.agent.function_calling_llm or self.agent.llm
|
llm = self.agent.function_calling_llm or self.agent.llm
|
||||||
|
|
||||||
if not self._is_gpt(llm):
|
if not self._is_gpt(llm):
|
||||||
|
# type: ignore # Argument "model" to "PydanticSchemaParser" has incompatible type "type[BaseModel] | None"; expected "type[BaseModel]"
|
||||||
model_schema = PydanticSchemaParser(model=model).get_schema()
|
model_schema = PydanticSchemaParser(model=model).get_schema()
|
||||||
instructions = f"{instructions}\n\nThe json should have the following structure, with the following keys:\n{model_schema}"
|
instructions = f"{instructions}\n\nThe json should have the following structure, with the following keys:\n{model_schema}"
|
||||||
|
|
||||||
@@ -282,22 +298,24 @@ class Task(BaseModel):
|
|||||||
|
|
||||||
if self.output_file:
|
if self.output_file:
|
||||||
content = (
|
content = (
|
||||||
exported_result if not self.output_pydantic else exported_result.json()
|
exported_result if not self.output_pydantic else exported_result.json() # type: ignore # "str" has no attribute "json"
|
||||||
)
|
)
|
||||||
self._save_file(content)
|
self._save_file(content)
|
||||||
|
|
||||||
return exported_result
|
return exported_result
|
||||||
|
|
||||||
def _is_gpt(self, llm) -> bool:
|
def _is_gpt(self, llm) -> bool:
|
||||||
return isinstance(llm, ChatOpenAI) and llm.openai_api_base == None
|
return isinstance(llm, ChatOpenAI) and llm.openai_api_base is None
|
||||||
|
|
||||||
def _save_file(self, result: Any) -> None:
|
def _save_file(self, result: Any) -> None:
|
||||||
|
# type: ignore # Value of type variable "AnyOrLiteralStr" of "dirname" cannot be "str | None"
|
||||||
directory = os.path.dirname(self.output_file)
|
directory = os.path.dirname(self.output_file)
|
||||||
|
|
||||||
if not os.path.exists(directory):
|
if directory and not os.path.exists(directory):
|
||||||
os.makedirs(directory)
|
os.makedirs(directory)
|
||||||
|
|
||||||
with open(self.output_file, "w") as file:
|
# type: ignore # Argument 1 to "open" has incompatible type "str | None"; expected "int | str | bytes | PathLike[str] | PathLike[bytes]"
|
||||||
|
with open(self.output_file, "w", encoding='utf-8') as file:
|
||||||
file.write(result)
|
file.write(result)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ class TaskOutput(BaseModel):
|
|||||||
exported_output: Union[str, BaseModel] = Field(
|
exported_output: Union[str, BaseModel] = Field(
|
||||||
description="Output of the task", default=None
|
description="Output of the task", default=None
|
||||||
)
|
)
|
||||||
|
agent: str = Field(description="Agent that executed the task")
|
||||||
raw_output: str = Field(description="Result of the task")
|
raw_output: str = Field(description="Result of the task")
|
||||||
|
|
||||||
@model_validator(mode="after")
|
@model_validator(mode="after")
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
from typing import List
|
from typing import List, Union
|
||||||
|
|
||||||
from langchain.tools import StructuredTool
|
from langchain.tools import StructuredTool
|
||||||
from pydantic import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
@@ -33,12 +33,20 @@ class AgentTools(BaseModel):
|
|||||||
]
|
]
|
||||||
return tools
|
return tools
|
||||||
|
|
||||||
def delegate_work(self, coworker: str, task: str, context: str):
|
def delegate_work(self, task: str, context: str, coworker: Union[str, None] = None, **kwargs):
|
||||||
"""Useful to delegate a specific task to a co-worker passing all necessary context and names."""
|
"""Useful to delegate a specific task to a co-worker passing all necessary context and names."""
|
||||||
|
coworker = coworker or kwargs.get("co_worker") or kwargs.get("co-worker")
|
||||||
|
is_list = coworker.startswith("[") and coworker.endswith("]")
|
||||||
|
if is_list:
|
||||||
|
coworker = coworker[1:-1].split(",")[0]
|
||||||
return self._execute(coworker, task, context)
|
return self._execute(coworker, task, context)
|
||||||
|
|
||||||
def ask_question(self, coworker: str, question: str, context: str):
|
def ask_question(self, question: str, context: str, coworker: Union[str, None] = None, **kwargs):
|
||||||
"""Useful to ask a question, opinion or take from a co-worker passing all necessary context and names."""
|
"""Useful to ask a question, opinion or take from a co-worker passing all necessary context and names."""
|
||||||
|
coworker = coworker or kwargs.get("co_worker") or kwargs.get("co-worker")
|
||||||
|
is_list = coworker.startswith("[") and coworker.endswith("]")
|
||||||
|
if is_list:
|
||||||
|
coworker = coworker[1:-1].split(",")[0]
|
||||||
return self._execute(coworker, question, context)
|
return self._execute(coworker, question, context)
|
||||||
|
|
||||||
def _execute(self, agent, task, context):
|
def _execute(self, agent, task, context):
|
||||||
@@ -49,7 +57,7 @@ class AgentTools(BaseModel):
|
|||||||
for available_agent in self.agents
|
for available_agent in self.agents
|
||||||
if available_agent.role.casefold().strip() == agent.casefold().strip()
|
if available_agent.role.casefold().strip() == agent.casefold().strip()
|
||||||
]
|
]
|
||||||
except:
|
except Exception as _:
|
||||||
return self.i18n.errors("agent_tool_unexsiting_coworker").format(
|
return self.i18n.errors("agent_tool_unexsiting_coworker").format(
|
||||||
coworkers="\n".join(
|
coworkers="\n".join(
|
||||||
[f"- {agent.role.casefold()}" for agent in self.agents]
|
[f"- {agent.role.casefold()}" for agent in self.agents]
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ class ToolUsage:
|
|||||||
|
|
||||||
# Set the maximum parsing attempts for bigger models
|
# Set the maximum parsing attempts for bigger models
|
||||||
if (isinstance(self.function_calling_llm, ChatOpenAI)) and (
|
if (isinstance(self.function_calling_llm, ChatOpenAI)) and (
|
||||||
self.function_calling_llm.openai_api_base == None
|
self.function_calling_llm.openai_api_base is None
|
||||||
):
|
):
|
||||||
if self.function_calling_llm.model_name in OPENAI_BIGGER_MODELS:
|
if self.function_calling_llm.model_name in OPENAI_BIGGER_MODELS:
|
||||||
self._max_parsing_attempts = 2
|
self._max_parsing_attempts = 2
|
||||||
@@ -88,6 +88,8 @@ class ToolUsage:
|
|||||||
self._printer.print(content=f"\n\n{error}\n", color="red")
|
self._printer.print(content=f"\n\n{error}\n", color="red")
|
||||||
self.task.increment_tools_errors()
|
self.task.increment_tools_errors()
|
||||||
return error
|
return error
|
||||||
|
|
||||||
|
# BUG? The code below seems to be unreachable
|
||||||
try:
|
try:
|
||||||
tool = self._select_tool(calling.tool_name)
|
tool = self._select_tool(calling.tool_name)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@@ -95,6 +97,7 @@ class ToolUsage:
|
|||||||
self.task.increment_tools_errors()
|
self.task.increment_tools_errors()
|
||||||
self._printer.print(content=f"\n\n{error}\n", color="red")
|
self._printer.print(content=f"\n\n{error}\n", color="red")
|
||||||
return error
|
return error
|
||||||
|
# type: ignore # BUG?: "_use" of "ToolUsage" does not return a value (it only ever returns None)
|
||||||
return f"{self._use(tool_string=tool_string, tool=tool, calling=calling)}"
|
return f"{self._use(tool_string=tool_string, tool=tool, calling=calling)}"
|
||||||
|
|
||||||
def _use(
|
def _use(
|
||||||
@@ -102,8 +105,9 @@ class ToolUsage:
|
|||||||
tool_string: str,
|
tool_string: str,
|
||||||
tool: BaseTool,
|
tool: BaseTool,
|
||||||
calling: Union[ToolCalling, InstructorToolCalling],
|
calling: Union[ToolCalling, InstructorToolCalling],
|
||||||
) -> None:
|
) -> None: # TODO: Fix this return type
|
||||||
tool_event = agentops.ToolEvent(name=calling.tool_name) if agentops else None
|
tool_event = agentops.ToolEvent(name=calling.tool_name) if agentops else None
|
||||||
|
# type: ignore # _check_tool_repeated_usage of "ToolUsage" does not return a value (it only ever returns None)
|
||||||
if self._check_tool_repeated_usage(calling=calling):
|
if self._check_tool_repeated_usage(calling=calling):
|
||||||
try:
|
try:
|
||||||
result = self._i18n.errors("task_repeated_usage").format(
|
result = self._i18n.errors("task_repeated_usage").format(
|
||||||
@@ -115,15 +119,18 @@ class ToolUsage:
|
|||||||
tool_name=tool.name,
|
tool_name=tool.name,
|
||||||
attempts=self._run_attempts,
|
attempts=self._run_attempts,
|
||||||
)
|
)
|
||||||
|
# type: ignore # "_format_result" of "ToolUsage" does not return a value (it only ever returns None)
|
||||||
result = self._format_result(result=result)
|
result = self._format_result(result=result)
|
||||||
return result
|
return result # type: ignore # Fix the reutrn type of this function
|
||||||
|
|
||||||
except Exception:
|
except Exception:
|
||||||
self.task.increment_tools_errors()
|
self.task.increment_tools_errors()
|
||||||
|
|
||||||
|
# type: ignore # Incompatible types in assignment (expression has type "None", variable has type "str")
|
||||||
result = None
|
result = None
|
||||||
|
|
||||||
if self.tools_handler.cache:
|
if self.tools_handler.cache:
|
||||||
result = self.tools_handler.cache.read(
|
result = self.tools_handler.cache.read( # type: ignore # Incompatible types in assignment (expression has type "str | None", variable has type "str")
|
||||||
tool=calling.tool_name, input=calling.arguments
|
tool=calling.tool_name, input=calling.arguments
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -137,6 +144,7 @@ class ToolUsage:
|
|||||||
|
|
||||||
if calling.arguments:
|
if calling.arguments:
|
||||||
try:
|
try:
|
||||||
|
# type: ignore # Item "None" of "type[BaseModel] | None" has no attribute "schema"
|
||||||
acceptable_args = tool.args_schema.schema()["properties"].keys()
|
acceptable_args = tool.args_schema.schema()["properties"].keys()
|
||||||
arguments = {
|
arguments = {
|
||||||
k: v
|
k: v
|
||||||
@@ -149,6 +157,7 @@ class ToolUsage:
|
|||||||
arguments = calling.arguments
|
arguments = calling.arguments
|
||||||
result = tool._run(**arguments)
|
result = tool._run(**arguments)
|
||||||
else:
|
else:
|
||||||
|
# type: ignore # Incompatible types in assignment (expression has type "dict_values[str, Any]", variable has type "dict[str, Any]")
|
||||||
arguments = calling.arguments.values()
|
arguments = calling.arguments.values()
|
||||||
result = tool._run(*arguments)
|
result = tool._run(*arguments)
|
||||||
else:
|
else:
|
||||||
@@ -165,13 +174,14 @@ class ToolUsage:
|
|||||||
).message
|
).message
|
||||||
self.task.increment_tools_errors()
|
self.task.increment_tools_errors()
|
||||||
self._printer.print(content=f"\n\n{error_message}\n", color="red")
|
self._printer.print(content=f"\n\n{error_message}\n", color="red")
|
||||||
return error
|
return error # type: ignore # No return value expected
|
||||||
|
|
||||||
self.task.increment_tools_errors()
|
self.task.increment_tools_errors()
|
||||||
if agentops:
|
if agentops:
|
||||||
agentops.record(
|
agentops.record(
|
||||||
agentops.ErrorEvent(exception=e, trigger_event=tool_event)
|
agentops.ErrorEvent(exception=e, trigger_event=tool_event)
|
||||||
)
|
)
|
||||||
return self.use(calling=calling, tool_string=tool_string)
|
return self.use(calling=calling, tool_string=tool_string) # type: ignore # No return value expected
|
||||||
|
|
||||||
if self.tools_handler:
|
if self.tools_handler:
|
||||||
should_cache = True
|
should_cache = True
|
||||||
@@ -180,9 +190,9 @@ class ToolUsage:
|
|||||||
)
|
)
|
||||||
if (
|
if (
|
||||||
hasattr(original_tool, "cache_function")
|
hasattr(original_tool, "cache_function")
|
||||||
and original_tool.cache_function
|
and original_tool.cache_function # type: ignore # Item "None" of "Any | None" has no attribute "cache_function"
|
||||||
):
|
):
|
||||||
should_cache = original_tool.cache_function(
|
should_cache = original_tool.cache_function( # type: ignore # Item "None" of "Any | None" has no attribute "cache_function"
|
||||||
calling.arguments, result
|
calling.arguments, result
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -198,12 +208,14 @@ class ToolUsage:
|
|||||||
tool_name=tool.name,
|
tool_name=tool.name,
|
||||||
attempts=self._run_attempts,
|
attempts=self._run_attempts,
|
||||||
)
|
)
|
||||||
|
# type: ignore # "_format_result" of "ToolUsage" does not return a value (it only ever returns None)
|
||||||
result = self._format_result(result=result)
|
result = self._format_result(result=result)
|
||||||
return result
|
return result # type: ignore # No return value expected
|
||||||
|
|
||||||
def _format_result(self, result: Any) -> None:
|
def _format_result(self, result: Any) -> None:
|
||||||
self.task.used_tools += 1
|
self.task.used_tools += 1
|
||||||
if self._should_remember_format():
|
if self._should_remember_format(): # type: ignore # "_should_remember_format" of "ToolUsage" does not return a value (it only ever returns None)
|
||||||
|
# type: ignore # "_remember_format" of "ToolUsage" does not return a value (it only ever returns None)
|
||||||
result = self._remember_format(result=result)
|
result = self._remember_format(result=result)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@@ -215,26 +227,33 @@ class ToolUsage:
|
|||||||
result += "\n\n" + self._i18n.slice("tools").format(
|
result += "\n\n" + self._i18n.slice("tools").format(
|
||||||
tools=self.tools_description, tool_names=self.tools_names
|
tools=self.tools_description, tool_names=self.tools_names
|
||||||
)
|
)
|
||||||
return result
|
return result # type: ignore # No return value expected
|
||||||
|
|
||||||
def _check_tool_repeated_usage(
|
def _check_tool_repeated_usage(
|
||||||
self, calling: Union[ToolCalling, InstructorToolCalling]
|
self, calling: Union[ToolCalling, InstructorToolCalling]
|
||||||
) -> None:
|
) -> None:
|
||||||
if not self.tools_handler:
|
if not self.tools_handler:
|
||||||
return False
|
return False # type: ignore # No return value expected
|
||||||
if last_tool_usage := self.tools_handler.last_used_tool:
|
if last_tool_usage := self.tools_handler.last_used_tool:
|
||||||
return (calling.tool_name == last_tool_usage.tool_name) and (
|
return (calling.tool_name == last_tool_usage.tool_name) and ( # type: ignore # No return value expected
|
||||||
calling.arguments == last_tool_usage.arguments
|
calling.arguments == last_tool_usage.arguments
|
||||||
)
|
)
|
||||||
|
|
||||||
def _select_tool(self, tool_name: str) -> BaseTool:
|
def _select_tool(self, tool_name: str) -> BaseTool:
|
||||||
for tool in self.tools:
|
order_tools = sorted(
|
||||||
|
self.tools,
|
||||||
|
key=lambda tool: SequenceMatcher(
|
||||||
|
None, tool.name.lower().strip(), tool_name.lower().strip()
|
||||||
|
).ratio(),
|
||||||
|
reverse=True,
|
||||||
|
)
|
||||||
|
for tool in order_tools:
|
||||||
if (
|
if (
|
||||||
tool.name.lower().strip() == tool_name.lower().strip()
|
tool.name.lower().strip() == tool_name.lower().strip()
|
||||||
or SequenceMatcher(
|
or SequenceMatcher(
|
||||||
None, tool.name.lower().strip(), tool_name.lower().strip()
|
None, tool.name.lower().strip(), tool_name.lower().strip()
|
||||||
).ratio()
|
).ratio()
|
||||||
> 0.9
|
> 0.85
|
||||||
):
|
):
|
||||||
return tool
|
return tool
|
||||||
self.task.increment_tools_errors()
|
self.task.increment_tools_errors()
|
||||||
@@ -267,7 +286,7 @@ class ToolUsage:
|
|||||||
return "\n--\n".join(descriptions)
|
return "\n--\n".join(descriptions)
|
||||||
|
|
||||||
def _is_gpt(self, llm) -> bool:
|
def _is_gpt(self, llm) -> bool:
|
||||||
return isinstance(llm, ChatOpenAI) and llm.openai_api_base == None
|
return isinstance(llm, ChatOpenAI) and llm.openai_api_base is None
|
||||||
|
|
||||||
def _tool_calling(
|
def _tool_calling(
|
||||||
self, tool_string: str
|
self, tool_string: str
|
||||||
@@ -305,14 +324,14 @@ class ToolUsage:
|
|||||||
tool_input = self._validate_tool_input(self.action.tool_input)
|
tool_input = self._validate_tool_input(self.action.tool_input)
|
||||||
arguments = ast.literal_eval(tool_input)
|
arguments = ast.literal_eval(tool_input)
|
||||||
except Exception:
|
except Exception:
|
||||||
return ToolUsageErrorException(
|
return ToolUsageErrorException( # type: ignore # Incompatible return value type (got "ToolUsageErrorException", expected "ToolCalling | InstructorToolCalling")
|
||||||
f'{self._i18n.errors("tool_arguments_error")}'
|
f'{self._i18n.errors("tool_arguments_error")}'
|
||||||
)
|
)
|
||||||
if not isinstance(arguments, dict):
|
if not isinstance(arguments, dict):
|
||||||
return ToolUsageErrorException(
|
return ToolUsageErrorException( # type: ignore # Incompatible return value type (got "ToolUsageErrorException", expected "ToolCalling | InstructorToolCalling")
|
||||||
f'{self._i18n.errors("tool_arguments_error")}'
|
f'{self._i18n.errors("tool_arguments_error")}'
|
||||||
)
|
)
|
||||||
calling = ToolCalling(
|
calling = ToolCalling( # type: ignore # Unexpected keyword argument "log" for "ToolCalling"
|
||||||
tool_name=tool.name,
|
tool_name=tool.name,
|
||||||
arguments=arguments,
|
arguments=arguments,
|
||||||
log=tool_string,
|
log=tool_string,
|
||||||
@@ -323,7 +342,7 @@ class ToolUsage:
|
|||||||
self._telemetry.tool_usage_error(llm=self.function_calling_llm)
|
self._telemetry.tool_usage_error(llm=self.function_calling_llm)
|
||||||
self.task.increment_tools_errors()
|
self.task.increment_tools_errors()
|
||||||
self._printer.print(content=f"\n\n{e}\n", color="red")
|
self._printer.print(content=f"\n\n{e}\n", color="red")
|
||||||
return ToolUsageErrorException(
|
return ToolUsageErrorException( # type: ignore # Incompatible return value type (got "ToolUsageErrorException", expected "ToolCalling | InstructorToolCalling")
|
||||||
f'{self._i18n.errors("tool_usage_error").format(error=e)}\nMoving on then. {self._i18n.slice("format").format(tool_names=self.tools_names)}'
|
f'{self._i18n.errors("tool_usage_error").format(error=e)}\nMoving on then. {self._i18n.slice("format").format(tool_names=self.tools_names)}'
|
||||||
)
|
)
|
||||||
return self._tool_calling(tool_string)
|
return self._tool_calling(tool_string)
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
"tool_usage_exception": "I encountered an error while trying to use the tool. This was the error: {error}.\n Tool {tool} accepts these inputs: {tool_inputs}"
|
"tool_usage_exception": "I encountered an error while trying to use the tool. This was the error: {error}.\n Tool {tool} accepts these inputs: {tool_inputs}"
|
||||||
},
|
},
|
||||||
"tools": {
|
"tools": {
|
||||||
"delegate_work": "Delegate a specific task to one of the following co-workers: {coworkers}\nThe input to this tool should be the co-worker, the task you want them to do, and ALL necessary context to exectue the task, they know nothing about the task, so share absolute everything you know, don't reference things but instead explain them.",
|
"delegate_work": "Delegate a specific task to one of the following co-workers: {coworkers}\nThe input to this tool should be the co-worker, the task you want them to do, and ALL necessary context to execute the task, they know nothing about the task, so share absolute everything you know, don't reference things but instead explain them.",
|
||||||
"ask_question": "Ask a specific question to one of the following co-workers: {coworkers}\nThe input to this tool should be the co-worker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don't reference things but instead explain them."
|
"ask_question": "Ask a specific question to one of the following co-workers: {coworkers}\nThe input to this tool should be the co-worker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don't reference things but instead explain them."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,3 +6,4 @@ from .printer import Printer
|
|||||||
from .prompts import Prompts
|
from .prompts import Prompts
|
||||||
from .rpm_controller import RPMController
|
from .rpm_controller import RPMController
|
||||||
from .fileHandler import FileHandler
|
from .fileHandler import FileHandler
|
||||||
|
from .parser import YamlParser
|
||||||
|
|||||||
@@ -83,5 +83,5 @@ class Converter(BaseModel):
|
|||||||
)
|
)
|
||||||
return new_prompt | self.llm | parser
|
return new_prompt | self.llm | parser
|
||||||
|
|
||||||
def _is_gpt(self, llm) -> bool:
|
def _is_gpt(self, llm) -> bool: # type: ignore # BUG? Name "_is_gpt" defined on line 20 hides name from outer scope
|
||||||
return isinstance(llm, ChatOpenAI) and llm.openai_api_base == None
|
return isinstance(llm, ChatOpenAI) and llm.openai_api_base is None
|
||||||
|
|||||||
@@ -70,4 +70,4 @@ class TaskEvaluator:
|
|||||||
return converter.to_pydantic()
|
return converter.to_pydantic()
|
||||||
|
|
||||||
def _is_gpt(self, llm) -> bool:
|
def _is_gpt(self, llm) -> bool:
|
||||||
return isinstance(llm, ChatOpenAI) and llm.openai_api_base == None
|
return isinstance(llm, ChatOpenAI) and llm.openai_api_base is None
|
||||||
|
|||||||
@@ -21,14 +21,14 @@ class I18N(BaseModel):
|
|||||||
self._prompts = json.load(f)
|
self._prompts = json.load(f)
|
||||||
else:
|
else:
|
||||||
dir_path = os.path.dirname(os.path.realpath(__file__))
|
dir_path = os.path.dirname(os.path.realpath(__file__))
|
||||||
prompts_path = os.path.join(dir_path, f"../translations/en.json")
|
prompts_path = os.path.join(dir_path, "../translations/en.json")
|
||||||
|
|
||||||
with open(prompts_path, "r") as f:
|
with open(prompts_path, "r") as f:
|
||||||
self._prompts = json.load(f)
|
self._prompts = json.load(f)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
raise Exception(f"Prompt file '{self.prompt_file}' not found.")
|
raise Exception(f"Prompt file '{self.prompt_file}' not found.")
|
||||||
except json.JSONDecodeError:
|
except json.JSONDecodeError:
|
||||||
raise Exception(f"Error decoding JSON from the prompts file.")
|
raise Exception("Error decoding JSON from the prompts file.")
|
||||||
|
|
||||||
if not self._prompts:
|
if not self._prompts:
|
||||||
self._prompts = {}
|
self._prompts = {}
|
||||||
@@ -47,5 +47,5 @@ class I18N(BaseModel):
|
|||||||
def retrieve(self, kind, key) -> str:
|
def retrieve(self, kind, key) -> str:
|
||||||
try:
|
try:
|
||||||
return self._prompts[kind][key]
|
return self._prompts[kind][key]
|
||||||
except:
|
except Exception as _:
|
||||||
raise Exception(f"Prompt for '{kind}':'{key}' not found.")
|
raise Exception(f"Prompt for '{kind}':'{key}' not found.")
|
||||||
|
|||||||
17
src/crewai/utilities/parser.py
Normal file
17
src/crewai/utilities/parser.py
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import re
|
||||||
|
|
||||||
|
|
||||||
|
class YamlParser:
|
||||||
|
def parse(file):
|
||||||
|
content = file.read()
|
||||||
|
# Replace single { and } with doubled ones, while leaving already doubled ones intact and the other special characters {# and {%
|
||||||
|
modified_content = re.sub(r"(?<!\{){(?!\{)(?!\#)(?!\%)", "{{", content)
|
||||||
|
modified_content = re.sub(
|
||||||
|
r"(?<!\})(?<!\%)(?<!\#)\}(?!})", "}}", modified_content
|
||||||
|
)
|
||||||
|
# Check for 'context:' not followed by '[' and raise an error
|
||||||
|
if re.search(r"context:(?!\s*\[)", modified_content):
|
||||||
|
raise ValueError(
|
||||||
|
"Context is currently only supported in code when creating a task. Please use the 'context' key in the task configuration."
|
||||||
|
)
|
||||||
|
return modified_content
|
||||||
@@ -22,7 +22,7 @@ class TokenProcess:
|
|||||||
def sum_successful_requests(self, requests: int):
|
def sum_successful_requests(self, requests: int):
|
||||||
self.successful_requests = self.successful_requests + requests
|
self.successful_requests = self.successful_requests + requests
|
||||||
|
|
||||||
def get_summary(self) -> str:
|
def get_summary(self) -> Dict[str, Any]:
|
||||||
return {
|
return {
|
||||||
"total_tokens": self.total_tokens,
|
"total_tokens": self.total_tokens,
|
||||||
"prompt_tokens": self.prompt_tokens,
|
"prompt_tokens": self.prompt_tokens,
|
||||||
@@ -42,12 +42,12 @@ class TokenCalcHandler(BaseCallbackHandler):
|
|||||||
def on_llm_start(
|
def on_llm_start(
|
||||||
self, serialized: Dict[str, Any], prompts: List[str], **kwargs: Any
|
self, serialized: Dict[str, Any], prompts: List[str], **kwargs: Any
|
||||||
) -> None:
|
) -> None:
|
||||||
if "gpt" in self.model:
|
try:
|
||||||
encoding = tiktoken.encoding_for_model(self.model)
|
encoding = tiktoken.encoding_for_model(self.model)
|
||||||
else:
|
except KeyError:
|
||||||
encoding = tiktoken.get_encoding("cl100k_base")
|
encoding = tiktoken.get_encoding("cl100k_base")
|
||||||
|
|
||||||
if self.token_cost_process == None:
|
if self.token_cost_process is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
for prompt in prompts:
|
for prompt in prompts:
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ def test_agent_default_values():
|
|||||||
assert isinstance(agent.llm, ChatOpenAI)
|
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 is False
|
||||||
assert agent.allow_delegation == True
|
assert agent.allow_delegation is True
|
||||||
|
|
||||||
|
|
||||||
def test_custom_llm():
|
def test_custom_llm():
|
||||||
@@ -751,7 +751,7 @@ def test_agent_definition_based_on_dict():
|
|||||||
assert agent.role == "test role"
|
assert agent.role == "test role"
|
||||||
assert agent.goal == "test goal"
|
assert agent.goal == "test goal"
|
||||||
assert agent.backstory == "test backstory"
|
assert agent.backstory == "test backstory"
|
||||||
assert agent.verbose == True
|
assert agent.verbose is True
|
||||||
assert agent.tools == []
|
assert agent.tools == []
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,20 @@ def test_delegate_work():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.vcr(filter_headers=["authorization"])
|
||||||
|
def test_delegate_work_with_wrong_co_worker_variable():
|
||||||
|
result = tools.delegate_work(
|
||||||
|
co_worker="researcher",
|
||||||
|
task="share your take on AI Agents",
|
||||||
|
context="I heard you hate them",
|
||||||
|
)
|
||||||
|
|
||||||
|
assert (
|
||||||
|
result
|
||||||
|
== "AI Agents are essentially computer programs that are designed to perform tasks autonomously, with the ability to adapt and learn from their environment. These tasks range from simple ones such as setting alarms, to more complex ones like diagnosing diseases or driving cars. AI agents have the potential to revolutionize many industries, making processes more efficient and accurate. \n\nHowever, like any technology, AI agents have their downsides. They can be susceptible to biases based on the data they're trained on and they can also raise privacy concerns. Moreover, the widespread adoption of AI agents could result in significant job displacement in certain industries.\n\nDespite these concerns, it's important to note that the development and use of AI agents are heavily dependent on human decisions and policies. Therefore, the key to harnessing the benefits of AI agents while mitigating the risks lies in responsible and thoughtful development and implementation.\n\nWhether one 'loves' or 'hates' AI agents often comes down to individual perspectives and experiences. But as a researcher, it is my job to provide balanced and factual information, so I hope this explanation helps you understand better what AI Agents are and the implications they have."
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.vcr(filter_headers=["authorization"])
|
@pytest.mark.vcr(filter_headers=["authorization"])
|
||||||
def test_ask_question():
|
def test_ask_question():
|
||||||
result = tools.ask_question(
|
result = tools.ask_question(
|
||||||
@@ -41,6 +55,46 @@ def test_ask_question():
|
|||||||
== "As an AI researcher, I don't have personal feelings or emotions like love or hate. However, I recognize the importance of AI Agents in today's technological landscape. They have the potential to greatly enhance our lives and make tasks more efficient. At the same time, it is crucial to consider the ethical implications and societal impacts that come with their use. My role is to provide objective research and analysis on these topics."
|
== "As an AI researcher, I don't have personal feelings or emotions like love or hate. However, I recognize the importance of AI Agents in today's technological landscape. They have the potential to greatly enhance our lives and make tasks more efficient. At the same time, it is crucial to consider the ethical implications and societal impacts that come with their use. My role is to provide objective research and analysis on these topics."
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@pytest.mark.vcr(filter_headers=["authorization"])
|
||||||
|
def test_ask_question_with_wrong_co_worker_variable():
|
||||||
|
result = tools.ask_question(
|
||||||
|
co_worker="researcher",
|
||||||
|
question="do you hate AI Agents?",
|
||||||
|
context="I heard you LOVE them",
|
||||||
|
)
|
||||||
|
|
||||||
|
assert (
|
||||||
|
result
|
||||||
|
== "No, I don't hate AI agents. In fact, I find them quite fascinating. They are powerful tools that can greatly assist in various tasks, including my research. As a technology researcher, AI and AI agents are subjects of interest to me due to their potential in advancing our understanding and capabilities in various fields. My supposed love for them stems from this professional interest and the potential they hold."
|
||||||
|
)
|
||||||
|
|
||||||
|
@pytest.mark.vcr(filter_headers=["authorization"])
|
||||||
|
def test_delegate_work_withwith_coworker_as_array():
|
||||||
|
result = tools.delegate_work(
|
||||||
|
co_worker="[researcher]",
|
||||||
|
task="share your take on AI Agents",
|
||||||
|
context="I heard you hate them",
|
||||||
|
)
|
||||||
|
|
||||||
|
assert (
|
||||||
|
result
|
||||||
|
== "AI Agents are software entities which operate in an environment to achieve a particular goal. They can perceive their environment, reason about it, and take actions to fulfill their objectives. This includes everything from chatbots to self-driving cars. They are designed to act autonomously to a certain extent and are capable of learning from their experiences to improve their performance over time.\n\nDespite some people's fears or dislikes, AI Agents are not inherently good or bad. They are tools, and like any tool, their value depends on how they are used. For instance, AI Agents can be used to automate repetitive tasks, provide customer support, or analyze vast amounts of data far more quickly and accurately than a human could. They can also be used in ways that invade privacy or replace jobs, which is often where the apprehension comes from.\n\nThe key is to create regulations and ethical guidelines for the use of AI Agents, and to continue researching and developing them in a way that maximizes their benefits and minimizes their potential harm. From a research perspective, there's a lot of potential in AI Agents, and it's a fascinating field to be a part of."
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.vcr(filter_headers=["authorization"])
|
||||||
|
def test_ask_question_with_coworker_as_array():
|
||||||
|
result = tools.ask_question(
|
||||||
|
co_worker="[researcher]",
|
||||||
|
question="do you hate AI Agents?",
|
||||||
|
context="I heard you LOVE them",
|
||||||
|
)
|
||||||
|
|
||||||
|
assert (
|
||||||
|
result
|
||||||
|
== "I don't hate or love AI agents. My passion lies in understanding them, researching about their capabilities, implications, and potential for development. As a researcher, my feelings toward AI are more of fascination and interest rather than personal love or hate."
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_delegate_work_to_wrong_agent():
|
def test_delegate_work_to_wrong_agent():
|
||||||
result = tools.ask_question(
|
result = tools.ask_question(
|
||||||
|
|||||||
@@ -0,0 +1,427 @@
|
|||||||
|
interactions:
|
||||||
|
- request:
|
||||||
|
body: '{"messages": [{"role": "user", "content": "You are researcher. You''re
|
||||||
|
an expert researcher, specialized in technology\nYour personal goal is: make
|
||||||
|
the best research and analysis on content about AI and AI agentsTo give my best
|
||||||
|
complete final answer to the task use the exact following format:\n\nThought:
|
||||||
|
I now can give a great answer\nFinal Answer: my best complete final answer to
|
||||||
|
the task.\nYour final answer must be the great and the most complete as possible,
|
||||||
|
it must be outcome described.\n\nI MUST use these formats, my job depends on
|
||||||
|
it!\nCurrent Task: do you hate AI Agents?\n\nThis is the expect criteria for
|
||||||
|
your final answer: Your best answer to your co-worker asking you this, accounting
|
||||||
|
for the context shared. \n you MUST return the actual complete content as the
|
||||||
|
final answer, not a summary.\n\nThis is the context you''re working with:\nI
|
||||||
|
heard you LOVE them\n\nBegin! This is VERY important to you, use the tools available
|
||||||
|
and give your best Final Answer, your job depends on it!\n\nThought:\n"}], "model":
|
||||||
|
"gpt-4", "n": 1, "stop": ["\nObservation"], "stream": true, "temperature": 0.7}'
|
||||||
|
headers:
|
||||||
|
accept:
|
||||||
|
- application/json
|
||||||
|
accept-encoding:
|
||||||
|
- gzip, deflate, br
|
||||||
|
connection:
|
||||||
|
- keep-alive
|
||||||
|
content-length:
|
||||||
|
- '1103'
|
||||||
|
content-type:
|
||||||
|
- application/json
|
||||||
|
cookie:
|
||||||
|
- _cfuvid=r7d0l_hEOM639ffTY.owt.2ZeXQN7IgsM0JmFM6FEiE-1715576040584-0.0.1.1-604800000;
|
||||||
|
__cf_bm=bHXznnX6IEnPWC4UFqVw22jiTLBlLvClKsTW4F99UPc-1715613132-1.0.1.1-5k2TYkm6.lsjrA1MkQ4uD2GxUGKPmwNVeYL_sKTpAPJ_trVvN3.uNZS4HljKfVPlku1XDNCYfU4y43hlt3e.RQ
|
||||||
|
host:
|
||||||
|
- api.openai.com
|
||||||
|
user-agent:
|
||||||
|
- OpenAI/Python 1.25.1
|
||||||
|
x-stainless-arch:
|
||||||
|
- arm64
|
||||||
|
x-stainless-async:
|
||||||
|
- 'false'
|
||||||
|
x-stainless-lang:
|
||||||
|
- python
|
||||||
|
x-stainless-os:
|
||||||
|
- MacOS
|
||||||
|
x-stainless-package-version:
|
||||||
|
- 1.25.1
|
||||||
|
x-stainless-runtime:
|
||||||
|
- CPython
|
||||||
|
x-stainless-runtime-version:
|
||||||
|
- 3.11.7
|
||||||
|
method: POST
|
||||||
|
uri: https://api.openai.com/v1/chat/completions
|
||||||
|
response:
|
||||||
|
body:
|
||||||
|
string: 'data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"As"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
a"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
researcher"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
specialized"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
in"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
technology"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
specifically"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
AI"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
and"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
AI"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
agents"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
my"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
personal"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
feelings"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
towards"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
them"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
are"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
not"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
based"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
on"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
emotion"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
but"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
on"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
professional"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
interest"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
and"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
intellectual"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
curiosity"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
\n\n"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"Final"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
Answer"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":":"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
I"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
don"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"''t"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
hate"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
or"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
love"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
AI"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
agents"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
My"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
passion"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
lies"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
in"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
understanding"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
them"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
researching"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
about"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
their"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
capabilities"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
implications"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
and"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
potential"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
for"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
development"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
As"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
a"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
researcher"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
my"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
feelings"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
toward"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
AI"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
are"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
more"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
of"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
fascination"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
and"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
interest"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
rather"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
than"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
personal"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
love"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
or"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
|
||||||
|
hate"},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: {"id":"chatcmpl-9ORdkG4FJphn6RbqXUgZlUbRtXBIO","object":"chat.completion.chunk","created":1715613148,"model":"gpt-4-0613","system_fingerprint":null,"choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}]}
|
||||||
|
|
||||||
|
|
||||||
|
data: [DONE]
|
||||||
|
|
||||||
|
|
||||||
|
'
|
||||||
|
headers:
|
||||||
|
CF-Cache-Status:
|
||||||
|
- DYNAMIC
|
||||||
|
CF-RAY:
|
||||||
|
- 883396429922624c-GRU
|
||||||
|
Connection:
|
||||||
|
- keep-alive
|
||||||
|
Content-Type:
|
||||||
|
- text/event-stream; charset=utf-8
|
||||||
|
Date:
|
||||||
|
- Mon, 13 May 2024 15:12:29 GMT
|
||||||
|
Server:
|
||||||
|
- cloudflare
|
||||||
|
Transfer-Encoding:
|
||||||
|
- chunked
|
||||||
|
alt-svc:
|
||||||
|
- h3=":443"; ma=86400
|
||||||
|
openai-organization:
|
||||||
|
- crewai-iuxna1
|
||||||
|
openai-processing-ms:
|
||||||
|
- '514'
|
||||||
|
openai-version:
|
||||||
|
- '2020-10-01'
|
||||||
|
strict-transport-security:
|
||||||
|
- max-age=15724800; includeSubDomains
|
||||||
|
x-ratelimit-limit-requests:
|
||||||
|
- '10000'
|
||||||
|
x-ratelimit-limit-tokens:
|
||||||
|
- '300000'
|
||||||
|
x-ratelimit-remaining-requests:
|
||||||
|
- '9999'
|
||||||
|
x-ratelimit-remaining-tokens:
|
||||||
|
- '299745'
|
||||||
|
x-ratelimit-reset-requests:
|
||||||
|
- 6ms
|
||||||
|
x-ratelimit-reset-tokens:
|
||||||
|
- 50ms
|
||||||
|
x-request-id:
|
||||||
|
- req_5a62449ef9052c3a350f1b47f268bbcc
|
||||||
|
status:
|
||||||
|
code: 200
|
||||||
|
message: OK
|
||||||
|
version: 1
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -11,7 +11,7 @@ interactions:
|
|||||||
are not listed here:\n\nDelegate work to co-worker: Delegate work to co-worker(coworker:
|
are not listed here:\n\nDelegate work to co-worker: Delegate work to co-worker(coworker:
|
||||||
str, task: str, context: str) - Delegate a specific task to one of the following
|
str, task: str, context: str) - Delegate a specific task to one of the following
|
||||||
co-workers: [Researcher]\nThe input to this tool should be the coworker, the
|
co-workers: [Researcher]\nThe input to this tool should be the coworker, the
|
||||||
task you want them to do, and ALL necessary context to exectue the task, they
|
task you want them to do, and ALL necessary context to execute the task, they
|
||||||
know nothing about the task, so share absolute everything you know, don''t reference
|
know nothing about the task, so share absolute everything you know, don''t reference
|
||||||
things but instead explain them.\nAsk question to co-worker: Ask question to
|
things but instead explain them.\nAsk question to co-worker: Ask question to
|
||||||
co-worker(coworker: str, question: str, context: str) - Ask a specific question
|
co-worker(coworker: str, question: str, context: str) - Ask a specific question
|
||||||
@@ -1030,7 +1030,7 @@ interactions:
|
|||||||
are not listed here:\n\nDelegate work to co-worker: Delegate work to co-worker(coworker:
|
are not listed here:\n\nDelegate work to co-worker: Delegate work to co-worker(coworker:
|
||||||
str, task: str, context: str) - Delegate a specific task to one of the following
|
str, task: str, context: str) - Delegate a specific task to one of the following
|
||||||
co-workers: [Researcher]\nThe input to this tool should be the coworker, the
|
co-workers: [Researcher]\nThe input to this tool should be the coworker, the
|
||||||
task you want them to do, and ALL necessary context to exectue the task, they
|
task you want them to do, and ALL necessary context to execute the task, they
|
||||||
know nothing about the task, so share absolute everything you know, don''t reference
|
know nothing about the task, so share absolute everything you know, don''t reference
|
||||||
things but instead explain them.\nAsk question to co-worker: Ask question to
|
things but instead explain them.\nAsk question to co-worker: Ask question to
|
||||||
co-worker(coworker: str, question: str, context: str) - Ask a specific question
|
co-worker(coworker: str, question: str, context: str) - Ask a specific question
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ interactions:
|
|||||||
co-worker: Delegate work to co-worker(coworker: str, task: str, context: str)
|
co-worker: Delegate work to co-worker(coworker: str, task: str, context: str)
|
||||||
- Delegate a specific task to one of the following co-workers: [''test role2'']\nThe
|
- Delegate a specific task to one of the following co-workers: [''test role2'']\nThe
|
||||||
input to this tool should be the coworker, the task you want them to do, and
|
input to this tool should be the coworker, the task you want them to do, and
|
||||||
ALL necessary context to exectue the task, they know nothing about the task,
|
ALL necessary context to execute the task, they know nothing about the task,
|
||||||
so share absolute everything you know, don''t reference things but instead explain
|
so share absolute everything you know, don''t reference things but instead explain
|
||||||
them.\nAsk question to co-worker: Ask question to co-worker(coworker: str, question:
|
them.\nAsk question to co-worker: Ask question to co-worker(coworker: str, question:
|
||||||
str, context: str) - Ask a specific question to one of the following co-workers:
|
str, context: str) - Ask a specific question to one of the following co-workers:
|
||||||
@@ -326,7 +326,7 @@ interactions:
|
|||||||
co-worker: Delegate work to co-worker(coworker: str, task: str, context: str)
|
co-worker: Delegate work to co-worker(coworker: str, task: str, context: str)
|
||||||
- Delegate a specific task to one of the following co-workers: [''test role2'']\nThe
|
- Delegate a specific task to one of the following co-workers: [''test role2'']\nThe
|
||||||
input to this tool should be the coworker, the task you want them to do, and
|
input to this tool should be the coworker, the task you want them to do, and
|
||||||
ALL necessary context to exectue the task, they know nothing about the task,
|
ALL necessary context to execute the task, they know nothing about the task,
|
||||||
so share absolute everything you know, don''t reference things but instead explain
|
so share absolute everything you know, don''t reference things but instead explain
|
||||||
them.\nAsk question to co-worker: Ask question to co-worker(coworker: str, question:
|
them.\nAsk question to co-worker: Ask question to co-worker(coworker: str, question:
|
||||||
str, context: str) - Ask a specific question to one of the following co-workers:
|
str, context: str) - Ask a specific question to one of the following co-workers:
|
||||||
@@ -351,7 +351,7 @@ interactions:
|
|||||||
Delegate work to co-worker(coworker: str, task: str, context: str) - Delegate
|
Delegate work to co-worker(coworker: str, task: str, context: str) - Delegate
|
||||||
a specific task to one of the following co-workers: [''test role2'']\nThe input
|
a specific task to one of the following co-workers: [''test role2'']\nThe input
|
||||||
to this tool should be the coworker, the task you want them to do, and ALL necessary
|
to this tool should be the coworker, the task you want them to do, and ALL necessary
|
||||||
context to exectue the task, they know nothing about the task, so share absolute
|
context to execute the task, they know nothing about the task, so share absolute
|
||||||
everything you know, don''t reference things but instead explain them.\nAsk
|
everything you know, don''t reference things but instead explain them.\nAsk
|
||||||
question to co-worker: Ask question to co-worker(coworker: str, question: str,
|
question to co-worker: Ask question to co-worker(coworker: str, question: str,
|
||||||
context: str) - Ask a specific question to one of the following co-workers:
|
context: str) - Ask a specific question to one of the following co-workers:
|
||||||
@@ -1027,7 +1027,7 @@ interactions:
|
|||||||
co-worker: Delegate work to co-worker(coworker: str, task: str, context: str)
|
co-worker: Delegate work to co-worker(coworker: str, task: str, context: str)
|
||||||
- Delegate a specific task to one of the following co-workers: [''test role2'']\nThe
|
- Delegate a specific task to one of the following co-workers: [''test role2'']\nThe
|
||||||
input to this tool should be the coworker, the task you want them to do, and
|
input to this tool should be the coworker, the task you want them to do, and
|
||||||
ALL necessary context to exectue the task, they know nothing about the task,
|
ALL necessary context to execute the task, they know nothing about the task,
|
||||||
so share absolute everything you know, don''t reference things but instead explain
|
so share absolute everything you know, don''t reference things but instead explain
|
||||||
them.\nAsk question to co-worker: Ask question to co-worker(coworker: str, question:
|
them.\nAsk question to co-worker: Ask question to co-worker(coworker: str, question:
|
||||||
str, context: str) - Ask a specific question to one of the following co-workers:
|
str, context: str) - Ask a specific question to one of the following co-workers:
|
||||||
@@ -1052,7 +1052,7 @@ interactions:
|
|||||||
Delegate work to co-worker(coworker: str, task: str, context: str) - Delegate
|
Delegate work to co-worker(coworker: str, task: str, context: str) - Delegate
|
||||||
a specific task to one of the following co-workers: [''test role2'']\nThe input
|
a specific task to one of the following co-workers: [''test role2'']\nThe input
|
||||||
to this tool should be the coworker, the task you want them to do, and ALL necessary
|
to this tool should be the coworker, the task you want them to do, and ALL necessary
|
||||||
context to exectue the task, they know nothing about the task, so share absolute
|
context to execute the task, they know nothing about the task, so share absolute
|
||||||
everything you know, don''t reference things but instead explain them.\nAsk
|
everything you know, don''t reference things but instead explain them.\nAsk
|
||||||
question to co-worker: Ask question to co-worker(coworker: str, question: str,
|
question to co-worker: Ask question to co-worker(coworker: str, question: str,
|
||||||
context: str) - Ask a specific question to one of the following co-workers:
|
context: str) - Ask a specific question to one of the following co-workers:
|
||||||
@@ -1236,7 +1236,7 @@ interactions:
|
|||||||
co-worker: Delegate work to co-worker(coworker: str, task: str, context: str)
|
co-worker: Delegate work to co-worker(coworker: str, task: str, context: str)
|
||||||
- Delegate a specific task to one of the following co-workers: [''test role2'']\nThe
|
- Delegate a specific task to one of the following co-workers: [''test role2'']\nThe
|
||||||
input to this tool should be the coworker, the task you want them to do, and
|
input to this tool should be the coworker, the task you want them to do, and
|
||||||
ALL necessary context to exectue the task, they know nothing about the task,
|
ALL necessary context to execute the task, they know nothing about the task,
|
||||||
so share absolute everything you know, don''t reference things but instead explain
|
so share absolute everything you know, don''t reference things but instead explain
|
||||||
them.\nAsk question to co-worker: Ask question to co-worker(coworker: str, question:
|
them.\nAsk question to co-worker: Ask question to co-worker(coworker: str, question:
|
||||||
str, context: str) - Ask a specific question to one of the following co-workers:
|
str, context: str) - Ask a specific question to one of the following co-workers:
|
||||||
@@ -1485,7 +1485,7 @@ interactions:
|
|||||||
co-worker: Delegate work to co-worker(coworker: str, task: str, context: str)
|
co-worker: Delegate work to co-worker(coworker: str, task: str, context: str)
|
||||||
- Delegate a specific task to one of the following co-workers: [''test role'']\nThe
|
- Delegate a specific task to one of the following co-workers: [''test role'']\nThe
|
||||||
input to this tool should be the coworker, the task you want them to do, and
|
input to this tool should be the coworker, the task you want them to do, and
|
||||||
ALL necessary context to exectue the task, they know nothing about the task,
|
ALL necessary context to execute the task, they know nothing about the task,
|
||||||
so share absolute everything you know, don''t reference things but instead explain
|
so share absolute everything you know, don''t reference things but instead explain
|
||||||
them.\nAsk question to co-worker: Ask question to co-worker(coworker: str, question:
|
them.\nAsk question to co-worker: Ask question to co-worker(coworker: str, question:
|
||||||
str, context: str) - Ask a specific question to one of the following co-workers:
|
str, context: str) - Ask a specific question to one of the following co-workers:
|
||||||
@@ -2490,7 +2490,7 @@ interactions:
|
|||||||
co-worker: Delegate work to co-worker(coworker: str, task: str, context: str)
|
co-worker: Delegate work to co-worker(coworker: str, task: str, context: str)
|
||||||
- Delegate a specific task to one of the following co-workers: [''test role'']\nThe
|
- Delegate a specific task to one of the following co-workers: [''test role'']\nThe
|
||||||
input to this tool should be the coworker, the task you want them to do, and
|
input to this tool should be the coworker, the task you want them to do, and
|
||||||
ALL necessary context to exectue the task, they know nothing about the task,
|
ALL necessary context to execute the task, they know nothing about the task,
|
||||||
so share absolute everything you know, don''t reference things but instead explain
|
so share absolute everything you know, don''t reference things but instead explain
|
||||||
them.\nAsk question to co-worker: Ask question to co-worker(coworker: str, question:
|
them.\nAsk question to co-worker: Ask question to co-worker(coworker: str, question:
|
||||||
str, context: str) - Ask a specific question to one of the following co-workers:
|
str, context: str) - Ask a specific question to one of the following co-workers:
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ interactions:
|
|||||||
work to co-worker: Delegate work to co-worker(coworker: str, task: str, context:
|
work to co-worker: Delegate work to co-worker(coworker: str, task: str, context:
|
||||||
str) - Delegate a specific task to one of the following co-workers: [''Researcher'']\nThe
|
str) - Delegate a specific task to one of the following co-workers: [''Researcher'']\nThe
|
||||||
input to this tool should be the coworker, the task you want them to do, and
|
input to this tool should be the coworker, the task you want them to do, and
|
||||||
ALL necessary context to exectue the task, they know nothing about the task,
|
ALL necessary context to execute the task, they know nothing about the task,
|
||||||
so share absolute everything you know, don''t reference things but instead explain
|
so share absolute everything you know, don''t reference things but instead explain
|
||||||
them.\nAsk question to co-worker: Ask question to co-worker(coworker: str, question:
|
them.\nAsk question to co-worker: Ask question to co-worker(coworker: str, question:
|
||||||
str, context: str) - Ask a specific question to one of the following co-workers:
|
str, context: str) - Ask a specific question to one of the following co-workers:
|
||||||
@@ -442,7 +442,7 @@ interactions:
|
|||||||
work to co-worker: Delegate work to co-worker(coworker: str, task: str, context:
|
work to co-worker: Delegate work to co-worker(coworker: str, task: str, context:
|
||||||
str) - Delegate a specific task to one of the following co-workers: [''Researcher'']\nThe
|
str) - Delegate a specific task to one of the following co-workers: [''Researcher'']\nThe
|
||||||
input to this tool should be the coworker, the task you want them to do, and
|
input to this tool should be the coworker, the task you want them to do, and
|
||||||
ALL necessary context to exectue the task, they know nothing about the task,
|
ALL necessary context to execute the task, they know nothing about the task,
|
||||||
so share absolute everything you know, don''t reference things but instead explain
|
so share absolute everything you know, don''t reference things but instead explain
|
||||||
them.\nAsk question to co-worker: Ask question to co-worker(coworker: str, question:
|
them.\nAsk question to co-worker: Ask question to co-worker(coworker: str, question:
|
||||||
str, context: str) - Ask a specific question to one of the following co-workers:
|
str, context: str) - Ask a specific question to one of the following co-workers:
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ interactions:
|
|||||||
are not listed here:\n\nDelegate work to co-worker: Delegate work to co-worker(coworker:
|
are not listed here:\n\nDelegate work to co-worker: Delegate work to co-worker(coworker:
|
||||||
str, task: str, context: str) - Delegate a specific task to one of the following
|
str, task: str, context: str) - Delegate a specific task to one of the following
|
||||||
co-workers: [''Senior Writer'']\nThe input to this tool should be the coworker,
|
co-workers: [''Senior Writer'']\nThe input to this tool should be the coworker,
|
||||||
the task you want them to do, and ALL necessary context to exectue the task,
|
the task you want them to do, and ALL necessary context to execute the task,
|
||||||
they know nothing about the task, so share absolute everything you know, don''t
|
they know nothing about the task, so share absolute everything you know, don''t
|
||||||
reference things but instead explain them.\nAsk question to co-worker: Ask question
|
reference things but instead explain them.\nAsk question to co-worker: Ask question
|
||||||
to co-worker(coworker: str, question: str, context: str) - Ask a specific question
|
to co-worker(coworker: str, question: str, context: str) - Ask a specific question
|
||||||
@@ -1716,7 +1716,7 @@ interactions:
|
|||||||
are not listed here:\n\nDelegate work to co-worker: Delegate work to co-worker(coworker:
|
are not listed here:\n\nDelegate work to co-worker: Delegate work to co-worker(coworker:
|
||||||
str, task: str, context: str) - Delegate a specific task to one of the following
|
str, task: str, context: str) - Delegate a specific task to one of the following
|
||||||
co-workers: [''Senior Writer'']\nThe input to this tool should be the coworker,
|
co-workers: [''Senior Writer'']\nThe input to this tool should be the coworker,
|
||||||
the task you want them to do, and ALL necessary context to exectue the task,
|
the task you want them to do, and ALL necessary context to execute the task,
|
||||||
they know nothing about the task, so share absolute everything you know, don''t
|
they know nothing about the task, so share absolute everything you know, don''t
|
||||||
reference things but instead explain them.\nAsk question to co-worker: Ask question
|
reference things but instead explain them.\nAsk question to co-worker: Ask question
|
||||||
to co-worker(coworker: str, question: str, context: str) - Ask a specific question
|
to co-worker(coworker: str, question: str, context: str) - Ask a specific question
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ interactions:
|
|||||||
str, task: str, context: str) - Delegate a specific task to one of the following
|
str, task: str, context: str) - Delegate a specific task to one of the following
|
||||||
co-workers: [''Researcher'', ''Senior Writer'']\nThe input to this tool should
|
co-workers: [''Researcher'', ''Senior Writer'']\nThe input to this tool should
|
||||||
be the coworker, the task you want them to do, and ALL necessary context to
|
be the coworker, the task you want them to do, and ALL necessary context to
|
||||||
exectue the task, they know nothing about the task, so share absolute everything
|
execute the task, they know nothing about the task, so share absolute everything
|
||||||
you know, don''t reference things but instead explain them.\nAsk question to
|
you know, don''t reference things but instead explain them.\nAsk question to
|
||||||
co-worker: Ask question to co-worker(coworker: str, question: str, context:
|
co-worker: Ask question to co-worker(coworker: str, question: str, context:
|
||||||
str) - Ask a specific question to one of the following co-workers: [''Researcher'',
|
str) - Ask a specific question to one of the following co-workers: [''Researcher'',
|
||||||
@@ -2448,7 +2448,7 @@ interactions:
|
|||||||
str, task: str, context: str) - Delegate a specific task to one of the following
|
str, task: str, context: str) - Delegate a specific task to one of the following
|
||||||
co-workers: [''Researcher'', ''Senior Writer'']\nThe input to this tool should
|
co-workers: [''Researcher'', ''Senior Writer'']\nThe input to this tool should
|
||||||
be the coworker, the task you want them to do, and ALL necessary context to
|
be the coworker, the task you want them to do, and ALL necessary context to
|
||||||
exectue the task, they know nothing about the task, so share absolute everything
|
execute the task, they know nothing about the task, so share absolute everything
|
||||||
you know, don''t reference things but instead explain them.\nAsk question to
|
you know, don''t reference things but instead explain them.\nAsk question to
|
||||||
co-worker: Ask question to co-worker(coworker: str, question: str, context:
|
co-worker: Ask question to co-worker(coworker: str, question: str, context:
|
||||||
str) - Ask a specific question to one of the following co-workers: [''Researcher'',
|
str) - Ask a specific question to one of the following co-workers: [''Researcher'',
|
||||||
@@ -5367,7 +5367,7 @@ interactions:
|
|||||||
str, task: str, context: str) - Delegate a specific task to one of the following
|
str, task: str, context: str) - Delegate a specific task to one of the following
|
||||||
co-workers: [''Researcher'', ''Senior Writer'']\nThe input to this tool should
|
co-workers: [''Researcher'', ''Senior Writer'']\nThe input to this tool should
|
||||||
be the coworker, the task you want them to do, and ALL necessary context to
|
be the coworker, the task you want them to do, and ALL necessary context to
|
||||||
exectue the task, they know nothing about the task, so share absolute everything
|
execute the task, they know nothing about the task, so share absolute everything
|
||||||
you know, don''t reference things but instead explain them.\nAsk question to
|
you know, don''t reference things but instead explain them.\nAsk question to
|
||||||
co-worker: Ask question to co-worker(coworker: str, question: str, context:
|
co-worker: Ask question to co-worker(coworker: str, question: str, context:
|
||||||
str) - Ask a specific question to one of the following co-workers: [''Researcher'',
|
str) - Ask a specific question to one of the following co-workers: [''Researcher'',
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -60,7 +60,7 @@ interactions:
|
|||||||
are not listed here:\n\nDelegate work to co-worker: Delegate work to co-worker(coworker:
|
are not listed here:\n\nDelegate work to co-worker: Delegate work to co-worker(coworker:
|
||||||
str, task: str, context: str) - Delegate a specific task to one of the following
|
str, task: str, context: str) - Delegate a specific task to one of the following
|
||||||
co-workers: [''Scorer'']\nThe input to this tool should be the coworker, the
|
co-workers: [''Scorer'']\nThe input to this tool should be the coworker, the
|
||||||
task you want them to do, and ALL necessary context to exectue the task, they
|
task you want them to do, and ALL necessary context to execute the task, they
|
||||||
know nothing about the task, so share absolute everything you know, don''t reference
|
know nothing about the task, so share absolute everything you know, don''t reference
|
||||||
things but instead explain them.\nAsk question to co-worker: Ask question to
|
things but instead explain them.\nAsk question to co-worker: Ask question to
|
||||||
co-worker(coworker: str, question: str, context: str) - Ask a specific question
|
co-worker(coworker: str, question: str, context: str) - Ask a specific question
|
||||||
@@ -3200,7 +3200,7 @@ interactions:
|
|||||||
are not listed here:\n\nDelegate work to co-worker: Delegate work to co-worker(coworker:
|
are not listed here:\n\nDelegate work to co-worker: Delegate work to co-worker(coworker:
|
||||||
str, task: str, context: str) - Delegate a specific task to one of the following
|
str, task: str, context: str) - Delegate a specific task to one of the following
|
||||||
co-workers: [''Scorer'']\nThe input to this tool should be the coworker, the
|
co-workers: [''Scorer'']\nThe input to this tool should be the coworker, the
|
||||||
task you want them to do, and ALL necessary context to exectue the task, they
|
task you want them to do, and ALL necessary context to execute the task, they
|
||||||
know nothing about the task, so share absolute everything you know, don''t reference
|
know nothing about the task, so share absolute everything you know, don''t reference
|
||||||
things but instead explain them.\nAsk question to co-worker: Ask question to
|
things but instead explain them.\nAsk question to co-worker: Ask question to
|
||||||
co-worker(coworker: str, question: str, context: str) - Ask a specific question
|
co-worker(coworker: str, question: str, context: str) - Ask a specific question
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
20
tests/cli_test.py
Normal file
20
tests/cli_test.py
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
from click.testing import CliRunner
|
||||||
|
from crewai.cli.cli import version
|
||||||
|
|
||||||
|
|
||||||
|
def test_version_command():
|
||||||
|
runner = CliRunner()
|
||||||
|
result = runner.invoke(version)
|
||||||
|
assert result.exit_code == 0
|
||||||
|
assert "crewai version:" in result.output
|
||||||
|
|
||||||
|
|
||||||
|
def test_version_command_with_tools():
|
||||||
|
runner = CliRunner()
|
||||||
|
result = runner.invoke(version, ["--tools"])
|
||||||
|
assert result.exit_code == 0
|
||||||
|
assert "crewai version:" in result.output
|
||||||
|
assert (
|
||||||
|
"crewai tools version:" in result.output
|
||||||
|
or "crewai tools not installed" in result.output
|
||||||
|
)
|
||||||
@@ -678,8 +678,8 @@ def test_agent_usage_metrics_are_captured_for_hierarchical_process():
|
|||||||
result = crew.kickoff()
|
result = crew.kickoff()
|
||||||
assert result == '"Howdy!"'
|
assert result == '"Howdy!"'
|
||||||
assert crew.usage_metrics == {
|
assert crew.usage_metrics == {
|
||||||
"total_tokens": 1650,
|
"total_tokens": 1666,
|
||||||
"prompt_tokens": 1367,
|
"prompt_tokens": 1383,
|
||||||
"completion_tokens": 283,
|
"completion_tokens": 283,
|
||||||
"successful_requests": 3,
|
"successful_requests": 3,
|
||||||
}
|
}
|
||||||
@@ -698,6 +698,8 @@ def test_crew_inputs_interpolate_both_agents_and_tasks():
|
|||||||
)
|
)
|
||||||
|
|
||||||
crew = Crew(agents=[agent], tasks=[task], inputs={"topic": "AI", "points": 5})
|
crew = Crew(agents=[agent], tasks=[task], inputs={"topic": "AI", "points": 5})
|
||||||
|
inputs = {"topic": "AI", "points": 5}
|
||||||
|
crew._interpolate_inputs(inputs=inputs) # Manual call for now
|
||||||
|
|
||||||
assert crew.tasks[0].description == "Give me an analysis around AI."
|
assert crew.tasks[0].description == "Give me an analysis around AI."
|
||||||
assert crew.tasks[0].expected_output == "5 bullet points about AI."
|
assert crew.tasks[0].expected_output == "5 bullet points about AI."
|
||||||
@@ -706,7 +708,7 @@ def test_crew_inputs_interpolate_both_agents_and_tasks():
|
|||||||
assert crew.agents[0].backstory == "You have a lot of experience with AI."
|
assert crew.agents[0].backstory == "You have a lot of experience with AI."
|
||||||
|
|
||||||
|
|
||||||
def test_crew_inputs_interpolate_both_agents_and_tasks():
|
def test_crew_inputs_interpolate_both_agents_and_tasks_diff():
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
agent = Agent(
|
agent = Agent(
|
||||||
@@ -828,9 +830,7 @@ def test_tools_with_custom_caching():
|
|||||||
with patch.object(
|
with patch.object(
|
||||||
CacheHandler, "add", wraps=crew._cache_handler.add
|
CacheHandler, "add", wraps=crew._cache_handler.add
|
||||||
) as add_to_cache:
|
) as add_to_cache:
|
||||||
with patch.object(
|
with patch.object(CacheHandler, "read", wraps=crew._cache_handler.read) as _:
|
||||||
CacheHandler, "read", wraps=crew._cache_handler.read
|
|
||||||
) as read_from_cache:
|
|
||||||
result = crew.kickoff()
|
result = crew.kickoff()
|
||||||
add_to_cache.assert_called_once_with(
|
add_to_cache.assert_called_once_with(
|
||||||
tool="multiplcation_tool",
|
tool="multiplcation_tool",
|
||||||
@@ -907,8 +907,6 @@ def test_crew_log_file_output(tmp_path):
|
|||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|
||||||
test_message = {"agent": "Researcher", "task": "Say Hi"}
|
|
||||||
|
|
||||||
crew = Crew(agents=[researcher], tasks=tasks, output_log_file=str(test_file))
|
crew = Crew(agents=[researcher], tasks=tasks, output_log_file=str(test_file))
|
||||||
crew.kickoff()
|
crew.kickoff()
|
||||||
assert test_file.exists()
|
assert test_file.exists()
|
||||||
@@ -939,13 +937,11 @@ def test_manager_agent():
|
|||||||
|
|
||||||
with patch.object(Task, "execute") as execute:
|
with patch.object(Task, "execute") as execute:
|
||||||
crew.kickoff()
|
crew.kickoff()
|
||||||
assert manager.allow_delegation == True
|
assert manager.allow_delegation is True
|
||||||
execute.assert_called()
|
execute.assert_called()
|
||||||
|
|
||||||
|
|
||||||
def test_manager_agent_in_agents_raises_exception():
|
def test_manager_agent_in_agents_raises_exception():
|
||||||
pass
|
|
||||||
|
|
||||||
task = Task(
|
task = Task(
|
||||||
description="Come up with a list of 5 interesting ideas to explore for an article, then write one amazing paragraph highlight for each idea that showcases how good an article about this topic could be. Return the list of ideas with their paragraph and your notes.",
|
description="Come up with a list of 5 interesting ideas to explore for an article, then write one amazing paragraph highlight for each idea that showcases how good an article about this topic could be. Return the list of ideas with their paragraph and your notes.",
|
||||||
expected_output="5 bullet points with a paragraph for each idea.",
|
expected_output="5 bullet points with a paragraph for each idea.",
|
||||||
@@ -959,7 +955,7 @@ def test_manager_agent_in_agents_raises_exception():
|
|||||||
)
|
)
|
||||||
|
|
||||||
with pytest.raises(pydantic_core._pydantic_core.ValidationError):
|
with pytest.raises(pydantic_core._pydantic_core.ValidationError):
|
||||||
crew = Crew(
|
Crew(
|
||||||
agents=[researcher, writer, manager],
|
agents=[researcher, writer, manager],
|
||||||
process=Process.hierarchical,
|
process=Process.hierarchical,
|
||||||
manager_agent=manager,
|
manager_agent=manager,
|
||||||
@@ -968,7 +964,12 @@ def test_manager_agent_in_agents_raises_exception():
|
|||||||
|
|
||||||
|
|
||||||
def test_manager_agent_with_tools_raises_exception():
|
def test_manager_agent_with_tools_raises_exception():
|
||||||
pass
|
from crewai_tools import tool
|
||||||
|
|
||||||
|
@tool
|
||||||
|
def testing_tool(first_number: int, second_number: int) -> int:
|
||||||
|
"""Useful for when you need to multiply two numbers together."""
|
||||||
|
return first_number * second_number
|
||||||
|
|
||||||
task = Task(
|
task = Task(
|
||||||
description="Come up with a list of 5 interesting ideas to explore for an article, then write one amazing paragraph highlight for each idea that showcases how good an article about this topic could be. Return the list of ideas with their paragraph and your notes.",
|
description="Come up with a list of 5 interesting ideas to explore for an article, then write one amazing paragraph highlight for each idea that showcases how good an article about this topic could be. Return the list of ideas with their paragraph and your notes.",
|
||||||
@@ -980,6 +981,7 @@ def test_manager_agent_with_tools_raises_exception():
|
|||||||
goal="Manage the crew and ensure the tasks are completed efficiently.",
|
goal="Manage the crew and ensure the tasks are completed efficiently.",
|
||||||
backstory="You're an experienced manager, skilled in overseeing complex projects and guiding teams to success. Your role is to coordinate the efforts of the crew members, ensuring that each task is completed on time and to the highest standard.",
|
backstory="You're an experienced manager, skilled in overseeing complex projects and guiding teams to success. Your role is to coordinate the efforts of the crew members, ensuring that each task is completed on time and to the highest standard.",
|
||||||
allow_delegation=False,
|
allow_delegation=False,
|
||||||
|
tools=[testing_tool],
|
||||||
)
|
)
|
||||||
|
|
||||||
crew = Crew(
|
crew = Crew(
|
||||||
|
|||||||
405
tests/memory/cassettes/test_save_and_search.yaml
Normal file
405
tests/memory/cassettes/test_save_and_search.yaml
Normal file
@@ -0,0 +1,405 @@
|
|||||||
|
interactions:
|
||||||
|
- request:
|
||||||
|
body: '{"input": ["test value test value test value test value test value test
|
||||||
|
value test value test value test value test value test value test value test
|
||||||
|
value test value test value test value test value test value"], "model": "text-embedding-ada-002",
|
||||||
|
"encoding_format": "base64"}'
|
||||||
|
headers:
|
||||||
|
accept:
|
||||||
|
- application/json
|
||||||
|
accept-encoding:
|
||||||
|
- gzip, deflate, br
|
||||||
|
connection:
|
||||||
|
- keep-alive
|
||||||
|
content-length:
|
||||||
|
- '292'
|
||||||
|
content-type:
|
||||||
|
- application/json
|
||||||
|
host:
|
||||||
|
- api.openai.com
|
||||||
|
user-agent:
|
||||||
|
- OpenAI/Python 1.25.1
|
||||||
|
x-stainless-arch:
|
||||||
|
- arm64
|
||||||
|
x-stainless-async:
|
||||||
|
- 'false'
|
||||||
|
x-stainless-lang:
|
||||||
|
- python
|
||||||
|
x-stainless-os:
|
||||||
|
- MacOS
|
||||||
|
x-stainless-package-version:
|
||||||
|
- 1.25.1
|
||||||
|
x-stainless-runtime:
|
||||||
|
- CPython
|
||||||
|
x-stainless-runtime-version:
|
||||||
|
- 3.11.7
|
||||||
|
method: POST
|
||||||
|
uri: https://api.openai.com/v1/embeddings
|
||||||
|
response:
|
||||||
|
body:
|
||||||
|
string: !!binary |
|
||||||
|
YXyDACB/th//38/PZLRrT7ldIgJZnBmfn4CJAiq+LyCiIKJAAqSrdXLgkEHeFhU8w8wDSxSD5oc6
|
||||||
|
WflNKJzM7Iut//7nz5+/fdFU5fT33z9/369x+vuff/78+XvPp/zvv3/+1z9//vz5899R6Vh1RXW/
|
||||||
|
vz51iwDwor7+/fePmAWQRvTvn787bSEMK+stofY5z+A4vzmmFLXFYr0KgCU+lpRH0gctwh5hOJ+6
|
||||||
|
HYvObV7Q6fuREQhFifllnkK6uJ9cVo5fC0uvRuPrc9leAFNbInanzsWsykWOWutesQOUh2G7vg4V
|
||||||
|
aklssHCBapjux2yGNjkR9sju72au1duMYlZlhDC8onGvhisqFPvOyLUmDReMY4rq92QzXXxci/Hy
|
||||||
|
3ACMpx9hnvS7J9PozDV8TqZJDt/hhvjz3VIwPq5EtVyshsZS31jTLmZINwyvfClP+xGqIULkUC44
|
||||||
|
3JXfWABr6TbEWycvmYd1e4SyrlsSbOqlWbUqi+G8JR0LHts45GFaC9rvt7HxHO9wM27epxi66e2z
|
||||||
|
Qyae+DyzDSD2KUqs3ZdPM3/TAqCXnRML9nbV8CvcbWAs6/Gqf3XEydJncChMkdLa/hbTN9uPcPVP
|
||||||
|
PYWZdAOvpdRE8tbwyP449M0aGNOsnqfCwLNc8mGKyliFm1CMeHOuTT7Lez4i6j8JifLnbNFQBxFa
|
||||||
|
Sb4ST2vNZneqNy/4WUHNdKKGfFWepYnGbSzgXeS8i1lRogsIX0/ENDrKRVc4L139jFKEBe8SFfzh
|
||||||
|
hTk62UVAokflIL6ZawGEcywRwkNize/r7QjcFnTiFt93yJStH6AsaVz6zi5BSPfm8ahF6BYz++TG
|
||||||
|
zRJOAVZ1ndyp0Nhs4Dg5vKD+0h/dST8tWUZHrpUbFlaC80BrpgZGF0bl2BLsXaJieQoOwCS+TOYI
|
||||||
|
yC/WOEp1sKblQ6wTvxZDfDRWIMolJf7XPTbcUcIUaZUuMOdzEDhVljgHT+IPKqWjOXAafWtQ0XjC
|
||||||
|
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ceu9D4ak
|
||||||
|
frB4sfxkHX9xrn0MfCJ6/3astX20PqDk8mG4M+JipnqtIkNAOYUxDgppvmZHNKz6xMK7Xzc8xTRF
|
||||||
|
y8/T6cMbhWGSD98SZmIGeLvaeUifyzYFUb+llIfKwhmJyxa1H7ujAlqjZJXN/QrN7m4z3NismV5T
|
||||||
|
9VOjcN0T77z5DbM++6b6EjHHQu7poYSrKUKHwhSZ9fo8+XQ516omvN0PMWc/DCd7eeZQnB6MEMWX
|
||||||
|
C97yYwx+F60kkLrHsO7Xk6SdSuwRktbfhL6p0qIN+ISKytCGS3FaeySZ8pe5S34LF5wrOuqWrCae
|
||||||
|
9LMaujezo5bH5pbY6rAr1iHELSLbCyUGk/WQqW0mIjN+NYQcm4O1nPwuBi53jDjkUQzvXt5KKBre
|
||||||
|
TxY1hRlK2ZVHcHjtbtNG8k98xp/9D2bPFAgBp7C45N1y6LaZS3I2unw+npmE6hOacCZqG2tO49FV
|
||||||
|
5SfeM3Kuy2Fuer1Dfp59iMvyKNwuLykH8n01dNT2a8H2EtZRkisjfd8TpZmtqsNqobkWCaeN3+xc
|
||||||
|
Oc61OvB8Ru75NmTONwK1bJuFWfomCUcx2pXw958/f/78+Z9//vz5P//558+fv11/r95///3zd6qW
|
||||||
|
6b/sAum/8nv+X6IoWRE8HfO6+vuvC2H09zv03Xf6f1PfVp/x779/dvCfYpv6KX/L/vPnz//88z//
|
||||||
|
GAM=
|
||||||
|
headers:
|
||||||
|
CF-Cache-Status:
|
||||||
|
- DYNAMIC
|
||||||
|
CF-RAY:
|
||||||
|
- 88142860ce7a82e2-GIG
|
||||||
|
Connection:
|
||||||
|
- keep-alive
|
||||||
|
Content-Encoding:
|
||||||
|
- br
|
||||||
|
Content-Type:
|
||||||
|
- application/json
|
||||||
|
Date:
|
||||||
|
- Thu, 09 May 2024 19:39:49 GMT
|
||||||
|
Server:
|
||||||
|
- cloudflare
|
||||||
|
Set-Cookie:
|
||||||
|
- __cf_bm=JUH9MsoOBdCquA9K9qOgVbrLUkBpuF4d2k7EvjnBOLg-1715283589-1.0.1.1-96.yHqUmYzRiWC7xZ4.TPKu5RqvB1EFecasHfb_ix62oXcsw_Sp.gz0gDk4Inl119IxRMINM613CI5HheoJM2A;
|
||||||
|
path=/; expires=Thu, 09-May-24 20:09:49 GMT; domain=.api.openai.com; HttpOnly;
|
||||||
|
Secure; SameSite=None
|
||||||
|
- _cfuvid=DPNTnqcoTitPoe12n1vvVltuYsIzavX_dftsSEhQQcc-1715283589489-0.0.1.1-604800000;
|
||||||
|
path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
|
||||||
|
Transfer-Encoding:
|
||||||
|
- chunked
|
||||||
|
access-control-allow-origin:
|
||||||
|
- '*'
|
||||||
|
alt-svc:
|
||||||
|
- h3=":443"; ma=86400
|
||||||
|
openai-model:
|
||||||
|
- text-embedding-ada-002
|
||||||
|
openai-organization:
|
||||||
|
- crewai-iuxna1
|
||||||
|
openai-processing-ms:
|
||||||
|
- '15'
|
||||||
|
openai-version:
|
||||||
|
- '2020-10-01'
|
||||||
|
strict-transport-security:
|
||||||
|
- max-age=15724800; includeSubDomains
|
||||||
|
x-ratelimit-limit-requests:
|
||||||
|
- '10000'
|
||||||
|
x-ratelimit-limit-tokens:
|
||||||
|
- '10000000'
|
||||||
|
x-ratelimit-remaining-requests:
|
||||||
|
- '9999'
|
||||||
|
x-ratelimit-remaining-tokens:
|
||||||
|
- '9999946'
|
||||||
|
x-ratelimit-reset-requests:
|
||||||
|
- 6ms
|
||||||
|
x-ratelimit-reset-tokens:
|
||||||
|
- 0s
|
||||||
|
x-request-id:
|
||||||
|
- req_ace5babe6674a08d07fce90792eef7eb
|
||||||
|
status:
|
||||||
|
code: 200
|
||||||
|
message: OK
|
||||||
|
- request:
|
||||||
|
body: '{"input": ["test value"], "model": "text-embedding-ada-002", "encoding_format":
|
||||||
|
"base64"}'
|
||||||
|
headers:
|
||||||
|
accept:
|
||||||
|
- application/json
|
||||||
|
accept-encoding:
|
||||||
|
- gzip, deflate, br
|
||||||
|
connection:
|
||||||
|
- keep-alive
|
||||||
|
content-length:
|
||||||
|
- '89'
|
||||||
|
content-type:
|
||||||
|
- application/json
|
||||||
|
cookie:
|
||||||
|
- __cf_bm=JUH9MsoOBdCquA9K9qOgVbrLUkBpuF4d2k7EvjnBOLg-1715283589-1.0.1.1-96.yHqUmYzRiWC7xZ4.TPKu5RqvB1EFecasHfb_ix62oXcsw_Sp.gz0gDk4Inl119IxRMINM613CI5HheoJM2A;
|
||||||
|
_cfuvid=DPNTnqcoTitPoe12n1vvVltuYsIzavX_dftsSEhQQcc-1715283589489-0.0.1.1-604800000
|
||||||
|
host:
|
||||||
|
- api.openai.com
|
||||||
|
user-agent:
|
||||||
|
- OpenAI/Python 1.25.1
|
||||||
|
x-stainless-arch:
|
||||||
|
- arm64
|
||||||
|
x-stainless-async:
|
||||||
|
- 'false'
|
||||||
|
x-stainless-lang:
|
||||||
|
- python
|
||||||
|
x-stainless-os:
|
||||||
|
- MacOS
|
||||||
|
x-stainless-package-version:
|
||||||
|
- 1.25.1
|
||||||
|
x-stainless-runtime:
|
||||||
|
- CPython
|
||||||
|
x-stainless-runtime-version:
|
||||||
|
- 3.11.7
|
||||||
|
method: POST
|
||||||
|
uri: https://api.openai.com/v1/embeddings
|
||||||
|
response:
|
||||||
|
body:
|
||||||
|
string: !!binary |
|
||||||
|
YXSDACDztvb89z8/k9FeZ0rVEhBIuDPopTFBQMT3fiOISifSJEBqlQdcfLgwYYhq0ycWOOTwIO1h
|
||||||
|
81r/88/f379D0VTl8u9//v7t6nn597/++fv79/lYHv/+5+///PP39/f3P6StVV9Uz2f9fVcg2EV9
|
||||||
|
/vufPz418QbBf/7+TVtk0UC95xN7n/0a8PWNEcnICNjKbJqhe2gQ9Wr4Ayx1fzE8z0dC8Rr2gMLH
|
||||||
|
FcIu2zgCDvBbsI/U1ODVDA+MzOeXsVewcrAIswt25vo6rW2Gcinhp4bEvzc/bfr7kYK+dDWqR3IE
|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uq0ERO4a4udZpICcD/cZHkB7IjC3jGbVrIujzr9MxdrhPjJyGu0W2AMcyFsf+oKpZCRQtS2bYgKS
|
||||||
|
aRsePwR+7CxirfwpgB5I/lbRsZfxySmuAVEToIEyVN6I659JszqsbMFzmO7YPH97MMjbm1PhashY
|
||||||
|
Ay+ZTbcXL8Hbg7hE0C0PiPWutWA+kQBtR/I1mXb7Emg96xPGMYmTfT1rCAbr+sQ5dJNmC6JrDHg9
|
||||||
|
tRHdfje2EmvpQbdKN8LsgU4rv4IVmPVcYFfrxmJVdqWG3vU0YuP35qfdjPYeBFlyoi5JHubmt3wI
|
||||||
|
OufVYWtMIrZ+R41TVV/2qC7YXrJb0fAANvdYqZXUN0aD4piDf//5+/v7+99//v7+n//65+/v3354
|
||||||
|
Vt2///n7d6m25b+rvqiez/r7/u/H8/HfPC/++1///P39S+bHu/r3P3//88/f39/fv79p6H/L/7cM
|
||||||
|
bfWd//3Pn/hf//z9/f39uwzLo/v/lqGtvvO///kT//n7+99//vcfAwM=
|
||||||
|
headers:
|
||||||
|
CF-Cache-Status:
|
||||||
|
- DYNAMIC
|
||||||
|
CF-RAY:
|
||||||
|
- 88142862e9f182e2-GIG
|
||||||
|
Connection:
|
||||||
|
- keep-alive
|
||||||
|
Content-Encoding:
|
||||||
|
- br
|
||||||
|
Content-Type:
|
||||||
|
- application/json
|
||||||
|
Date:
|
||||||
|
- Thu, 09 May 2024 19:39:49 GMT
|
||||||
|
Server:
|
||||||
|
- cloudflare
|
||||||
|
Transfer-Encoding:
|
||||||
|
- chunked
|
||||||
|
access-control-allow-origin:
|
||||||
|
- '*'
|
||||||
|
alt-svc:
|
||||||
|
- h3=":443"; ma=86400
|
||||||
|
openai-model:
|
||||||
|
- text-embedding-ada-002
|
||||||
|
openai-organization:
|
||||||
|
- crewai-iuxna1
|
||||||
|
openai-processing-ms:
|
||||||
|
- '22'
|
||||||
|
openai-version:
|
||||||
|
- '2020-10-01'
|
||||||
|
strict-transport-security:
|
||||||
|
- max-age=15724800; includeSubDomains
|
||||||
|
x-ratelimit-limit-requests:
|
||||||
|
- '10000'
|
||||||
|
x-ratelimit-limit-tokens:
|
||||||
|
- '10000000'
|
||||||
|
x-ratelimit-remaining-requests:
|
||||||
|
- '9999'
|
||||||
|
x-ratelimit-remaining-tokens:
|
||||||
|
- '9999998'
|
||||||
|
x-ratelimit-reset-requests:
|
||||||
|
- 6ms
|
||||||
|
x-ratelimit-reset-tokens:
|
||||||
|
- 0s
|
||||||
|
x-request-id:
|
||||||
|
- req_834c84237ace9a79492cb9e8d1f68737
|
||||||
|
status:
|
||||||
|
code: 200
|
||||||
|
message: OK
|
||||||
|
version: 1
|
||||||
@@ -1,15 +1,35 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
from crewai.agent import Agent
|
||||||
|
from crewai.crew import Crew
|
||||||
from crewai.memory.short_term.short_term_memory import ShortTermMemory
|
from crewai.memory.short_term.short_term_memory import ShortTermMemory
|
||||||
from crewai.memory.short_term.short_term_memory_item import ShortTermMemoryItem
|
from crewai.memory.short_term.short_term_memory_item import ShortTermMemoryItem
|
||||||
|
from crewai.task import Task
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def short_term_memory():
|
def short_term_memory():
|
||||||
"""Fixture to create a ShortTermMemory instance"""
|
"""Fixture to create a ShortTermMemory instance"""
|
||||||
return ShortTermMemory()
|
agent = Agent(
|
||||||
|
role="Researcher",
|
||||||
|
goal="Search relevant data and provide results",
|
||||||
|
backstory="You are a researcher at a leading tech think tank.",
|
||||||
|
tools=[],
|
||||||
|
verbose=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
task = Task(
|
||||||
|
description="Perform a search on specific topics.",
|
||||||
|
expected_output="A list of relevant URLs based on the search query.",
|
||||||
|
agent=agent,
|
||||||
|
)
|
||||||
|
return ShortTermMemory(crew=Crew(
|
||||||
|
agents=[agent],
|
||||||
|
tasks=[task]
|
||||||
|
))
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.vcr(filter_headers=["authorization"])
|
||||||
def test_save_and_search(short_term_memory):
|
def test_save_and_search(short_term_memory):
|
||||||
memory = ShortTermMemoryItem(
|
memory = ShortTermMemoryItem(
|
||||||
data="""test value test value test value test value test value test value
|
data="""test value test value test value test value test value test value
|
||||||
@@ -19,6 +39,7 @@ def test_save_and_search(short_term_memory):
|
|||||||
metadata={"task": "test_task"},
|
metadata={"task": "test_task"},
|
||||||
)
|
)
|
||||||
short_term_memory.save(memory)
|
short_term_memory.save(memory)
|
||||||
|
|
||||||
find = short_term_memory.search("test value", score_threshold=0.01)[0]
|
find = short_term_memory.search("test value", score_threshold=0.01)[0]
|
||||||
assert find["context"] == memory.data, "Data value mismatch."
|
assert find["context"] == memory.data, "Data value mismatch."
|
||||||
assert find["metadata"]["agent"] == "test_agent", "Agent value mismatch."
|
assert find["metadata"]["agent"] == "test_agent", "Agent value mismatch."
|
||||||
|
|||||||
Reference in New Issue
Block a user