mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-08 15:48:29 +00:00
Compare commits
5 Commits
lorenze/re
...
lorenze/la
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8e175f792e | ||
|
|
52444ad390 | ||
|
|
f070595e65 | ||
|
|
69c5eace2d | ||
|
|
d88ac338d5 |
@@ -326,7 +326,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"tab": "AMP",
|
"tab": "AOP",
|
||||||
"icon": "briefcase",
|
"icon": "briefcase",
|
||||||
"groups": [
|
"groups": [
|
||||||
{
|
{
|
||||||
@@ -753,7 +753,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"tab": "AMP",
|
"tab": "AOP",
|
||||||
"icon": "briefcase",
|
"icon": "briefcase",
|
||||||
"groups": [
|
"groups": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ mode: "wide"
|
|||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
CrewAI AOP(Agent Management Platform) provides a platform for deploying, monitoring, and scaling your crews and agents in a production environment.
|
CrewAI AOP(Agent Operations Platform) provides a platform for deploying, monitoring, and scaling your crews and agents in a production environment.
|
||||||
|
|
||||||
<Frame>
|
<Frame>
|
||||||
<img src="/images/enterprise/crewai-enterprise-dashboard.png" alt="CrewAI AOP Dashboard" />
|
<img src="/images/enterprise/crewai-enterprise-dashboard.png" alt="CrewAI AOP Dashboard" />
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ mode: "wide"
|
|||||||
|
|
||||||
## 소개
|
## 소개
|
||||||
|
|
||||||
CrewAI AOP(Agent Management Platform)는 프로덕션 환경에서 crew와 agent를 배포, 모니터링, 확장할 수 있는 플랫폼을 제공합니다.
|
CrewAI AOP(Agent Operation Platform)는 프로덕션 환경에서 crew와 agent를 배포, 모니터링, 확장할 수 있는 플랫폼을 제공합니다.
|
||||||
|
|
||||||
<Frame>
|
<Frame>
|
||||||
<img src="/images/enterprise/crewai-enterprise-dashboard.png" alt="CrewAI AOP Dashboard" />
|
<img src="/images/enterprise/crewai-enterprise-dashboard.png" alt="CrewAI AOP Dashboard" />
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ mode: "wide"
|
|||||||
|
|
||||||
## Introdução
|
## Introdução
|
||||||
|
|
||||||
CrewAI AOP(Agent Management Platform) fornece uma plataforma para implementar, monitorar e escalar seus crews e agentes em um ambiente de produção.
|
CrewAI AOP(Agent Operation Platform) fornece uma plataforma para implementar, monitorar e escalar seus crews e agentes em um ambiente de produção.
|
||||||
|
|
||||||
<Frame>
|
<Frame>
|
||||||
<img src="/images/enterprise/crewai-enterprise-dashboard.png" alt="CrewAI AOP Dashboard" />
|
<img src="/images/enterprise/crewai-enterprise-dashboard.png" alt="CrewAI AOP Dashboard" />
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ dependencies = [
|
|||||||
"pytube>=15.0.0",
|
"pytube>=15.0.0",
|
||||||
"requests>=2.32.5",
|
"requests>=2.32.5",
|
||||||
"docker>=7.1.0",
|
"docker>=7.1.0",
|
||||||
"crewai==1.5.0",
|
"crewai==1.6.0",
|
||||||
"lancedb>=0.5.4",
|
"lancedb>=0.5.4",
|
||||||
"tiktoken>=0.8.0",
|
"tiktoken>=0.8.0",
|
||||||
"beautifulsoup4>=4.13.4",
|
"beautifulsoup4>=4.13.4",
|
||||||
|
|||||||
@@ -291,4 +291,4 @@ __all__ = [
|
|||||||
"ZapierActionTools",
|
"ZapierActionTools",
|
||||||
]
|
]
|
||||||
|
|
||||||
__version__ = "1.5.0"
|
__version__ = "1.6.0"
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ Repository = "https://github.com/crewAIInc/crewAI"
|
|||||||
|
|
||||||
[project.optional-dependencies]
|
[project.optional-dependencies]
|
||||||
tools = [
|
tools = [
|
||||||
"crewai-tools==1.5.0",
|
"crewai-tools==1.6.0",
|
||||||
]
|
]
|
||||||
embeddings = [
|
embeddings = [
|
||||||
"tiktoken~=0.8.0"
|
"tiktoken~=0.8.0"
|
||||||
|
|||||||
@@ -3,19 +3,6 @@ from typing import Any
|
|||||||
import urllib.request
|
import urllib.request
|
||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
from crewai.agent.core import Agent
|
|
||||||
from crewai.crew import Crew
|
|
||||||
from crewai.crews.crew_output import CrewOutput
|
|
||||||
from crewai.flow.flow import Flow
|
|
||||||
from crewai.knowledge.knowledge import Knowledge
|
|
||||||
from crewai.llm import LLM
|
|
||||||
from crewai.llms.base_llm import BaseLLM
|
|
||||||
from crewai.process import Process
|
|
||||||
from crewai.task import Task
|
|
||||||
from crewai.tasks.llm_guardrail import LLMGuardrail
|
|
||||||
from crewai.tasks.task_output import TaskOutput
|
|
||||||
from crewai.telemetry.telemetry import Telemetry
|
|
||||||
|
|
||||||
|
|
||||||
def _suppress_pydantic_deprecation_warnings() -> None:
|
def _suppress_pydantic_deprecation_warnings() -> None:
|
||||||
"""Suppress Pydantic deprecation warnings using targeted monkey patch."""
|
"""Suppress Pydantic deprecation warnings using targeted monkey patch."""
|
||||||
@@ -40,7 +27,7 @@ def _suppress_pydantic_deprecation_warnings() -> None:
|
|||||||
|
|
||||||
_suppress_pydantic_deprecation_warnings()
|
_suppress_pydantic_deprecation_warnings()
|
||||||
|
|
||||||
__version__ = "1.5.0"
|
__version__ = "1.6.0"
|
||||||
_telemetry_submitted = False
|
_telemetry_submitted = False
|
||||||
|
|
||||||
|
|
||||||
@@ -48,6 +35,8 @@ def _track_install() -> None:
|
|||||||
"""Track package installation/first-use via Scarf analytics."""
|
"""Track package installation/first-use via Scarf analytics."""
|
||||||
global _telemetry_submitted
|
global _telemetry_submitted
|
||||||
|
|
||||||
|
from crewai.telemetry.telemetry import Telemetry
|
||||||
|
|
||||||
if _telemetry_submitted or Telemetry._is_telemetry_disabled():
|
if _telemetry_submitted or Telemetry._is_telemetry_disabled():
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -65,12 +54,15 @@ def _track_install() -> None:
|
|||||||
|
|
||||||
def _track_install_async() -> None:
|
def _track_install_async() -> None:
|
||||||
"""Track installation in background thread to avoid blocking imports."""
|
"""Track installation in background thread to avoid blocking imports."""
|
||||||
|
from crewai.telemetry.telemetry import Telemetry
|
||||||
|
|
||||||
if not Telemetry._is_telemetry_disabled():
|
if not Telemetry._is_telemetry_disabled():
|
||||||
thread = threading.Thread(target=_track_install, daemon=True)
|
thread = threading.Thread(target=_track_install, daemon=True)
|
||||||
thread.start()
|
thread.start()
|
||||||
|
|
||||||
|
|
||||||
_track_install_async()
|
_track_install_async()
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"LLM",
|
"LLM",
|
||||||
"Agent",
|
"Agent",
|
||||||
@@ -85,3 +77,51 @@ __all__ = [
|
|||||||
"TaskOutput",
|
"TaskOutput",
|
||||||
"__version__",
|
"__version__",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def __getattr__(name: str) -> Any:
|
||||||
|
if name == "Agent":
|
||||||
|
from crewai.agent.core import Agent
|
||||||
|
|
||||||
|
return Agent
|
||||||
|
if name == "Crew":
|
||||||
|
from crewai.crew import Crew
|
||||||
|
|
||||||
|
return Crew
|
||||||
|
if name == "CrewOutput":
|
||||||
|
from crewai.crews.crew_output import CrewOutput
|
||||||
|
|
||||||
|
return CrewOutput
|
||||||
|
if name == "Flow":
|
||||||
|
from crewai.flow.flow import Flow
|
||||||
|
|
||||||
|
return Flow
|
||||||
|
if name == "Knowledge":
|
||||||
|
from crewai.knowledge.knowledge import Knowledge
|
||||||
|
|
||||||
|
return Knowledge
|
||||||
|
if name == "LLM":
|
||||||
|
from crewai.llm import LLM
|
||||||
|
|
||||||
|
return LLM
|
||||||
|
if name == "BaseLLM":
|
||||||
|
from crewai.llms.base_llm import BaseLLM
|
||||||
|
|
||||||
|
return BaseLLM
|
||||||
|
if name == "Process":
|
||||||
|
from crewai.process import Process
|
||||||
|
|
||||||
|
return Process
|
||||||
|
if name == "Task":
|
||||||
|
from crewai.task import Task
|
||||||
|
|
||||||
|
return Task
|
||||||
|
if name == "LLMGuardrail":
|
||||||
|
from crewai.tasks.llm_guardrail import LLMGuardrail
|
||||||
|
|
||||||
|
return LLMGuardrail
|
||||||
|
if name == "TaskOutput":
|
||||||
|
from crewai.tasks.task_output import TaskOutput
|
||||||
|
|
||||||
|
return TaskOutput
|
||||||
|
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
||||||
|
|||||||
@@ -4,32 +4,6 @@ import subprocess
|
|||||||
|
|
||||||
import click
|
import click
|
||||||
|
|
||||||
from crewai.cli.add_crew_to_flow import add_crew_to_flow
|
|
||||||
from crewai.cli.authentication.main import AuthenticationCommand
|
|
||||||
from crewai.cli.config import Settings
|
|
||||||
from crewai.cli.create_crew import create_crew
|
|
||||||
from crewai.cli.create_flow import create_flow
|
|
||||||
from crewai.cli.crew_chat import run_chat
|
|
||||||
from crewai.cli.deploy.main import DeployCommand
|
|
||||||
from crewai.cli.enterprise.main import EnterpriseConfigureCommand
|
|
||||||
from crewai.cli.evaluate_crew import evaluate_crew
|
|
||||||
from crewai.cli.install_crew import install_crew
|
|
||||||
from crewai.cli.kickoff_flow import kickoff_flow
|
|
||||||
from crewai.cli.organization.main import OrganizationCommand
|
|
||||||
from crewai.cli.plot_flow import plot_flow
|
|
||||||
from crewai.cli.replay_from_task import replay_task_command
|
|
||||||
from crewai.cli.reset_memories_command import reset_memories_command
|
|
||||||
from crewai.cli.run_crew import run_crew
|
|
||||||
from crewai.cli.settings.main import SettingsCommand
|
|
||||||
from crewai.cli.tools.main import ToolCommand
|
|
||||||
from crewai.cli.train_crew import train_crew
|
|
||||||
from crewai.cli.triggers.main import TriggersCommand
|
|
||||||
from crewai.cli.update_crew import update_crew
|
|
||||||
from crewai.cli.utils import build_env_with_tool_repository_credentials, read_toml
|
|
||||||
from crewai.memory.storage.kickoff_task_outputs_storage import (
|
|
||||||
KickoffTaskOutputsSQLiteStorage,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@click.group()
|
@click.group()
|
||||||
@click.version_option(get_version("crewai"))
|
@click.version_option(get_version("crewai"))
|
||||||
@@ -46,6 +20,8 @@ def crewai():
|
|||||||
@click.argument("uv_args", nargs=-1, type=click.UNPROCESSED)
|
@click.argument("uv_args", nargs=-1, type=click.UNPROCESSED)
|
||||||
def uv(uv_args):
|
def uv(uv_args):
|
||||||
"""A wrapper around uv commands that adds custom tool authentication through env vars."""
|
"""A wrapper around uv commands that adds custom tool authentication through env vars."""
|
||||||
|
from crewai.cli.utils import build_env_with_tool_repository_credentials, read_toml
|
||||||
|
|
||||||
env = os.environ.copy()
|
env = os.environ.copy()
|
||||||
try:
|
try:
|
||||||
pyproject_data = read_toml()
|
pyproject_data = read_toml()
|
||||||
@@ -85,8 +61,12 @@ def uv(uv_args):
|
|||||||
def create(type, name, provider, skip_provider=False):
|
def create(type, name, provider, skip_provider=False):
|
||||||
"""Create a new crew, or flow."""
|
"""Create a new crew, or flow."""
|
||||||
if type == "crew":
|
if type == "crew":
|
||||||
|
from crewai.cli.create_crew import create_crew
|
||||||
|
|
||||||
create_crew(name, provider, skip_provider)
|
create_crew(name, provider, skip_provider)
|
||||||
elif type == "flow":
|
elif type == "flow":
|
||||||
|
from crewai.cli.create_flow import create_flow
|
||||||
|
|
||||||
create_flow(name)
|
create_flow(name)
|
||||||
else:
|
else:
|
||||||
click.secho("Error: Invalid type. Must be 'crew' or 'flow'.", fg="red")
|
click.secho("Error: Invalid type. Must be 'crew' or 'flow'.", fg="red")
|
||||||
@@ -129,6 +109,8 @@ def version(tools):
|
|||||||
)
|
)
|
||||||
def train(n_iterations: int, filename: str):
|
def train(n_iterations: int, filename: str):
|
||||||
"""Train the crew."""
|
"""Train the crew."""
|
||||||
|
from crewai.cli.train_crew import train_crew
|
||||||
|
|
||||||
click.echo(f"Training the Crew for {n_iterations} iterations")
|
click.echo(f"Training the Crew for {n_iterations} iterations")
|
||||||
train_crew(n_iterations, filename)
|
train_crew(n_iterations, filename)
|
||||||
|
|
||||||
@@ -148,6 +130,8 @@ def replay(task_id: str) -> None:
|
|||||||
task_id (str): The ID of the task to replay from.
|
task_id (str): The ID of the task to replay from.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
|
from crewai.cli.replay_from_task import replay_task_command
|
||||||
|
|
||||||
click.echo(f"Replaying the crew from task {task_id}")
|
click.echo(f"Replaying the crew from task {task_id}")
|
||||||
replay_task_command(task_id)
|
replay_task_command(task_id)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@@ -160,6 +144,10 @@ def log_tasks_outputs() -> None:
|
|||||||
Retrieve your latest crew.kickoff() task outputs.
|
Retrieve your latest crew.kickoff() task outputs.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
|
from crewai.memory.storage.kickoff_task_outputs_storage import (
|
||||||
|
KickoffTaskOutputsSQLiteStorage,
|
||||||
|
)
|
||||||
|
|
||||||
storage = KickoffTaskOutputsSQLiteStorage()
|
storage = KickoffTaskOutputsSQLiteStorage()
|
||||||
tasks = storage.load()
|
tasks = storage.load()
|
||||||
|
|
||||||
@@ -217,6 +205,8 @@ def reset_memories(
|
|||||||
"Please specify at least one memory type to reset using the appropriate flags."
|
"Please specify at least one memory type to reset using the appropriate flags."
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
from crewai.cli.reset_memories_command import reset_memories_command
|
||||||
|
|
||||||
reset_memories_command(
|
reset_memories_command(
|
||||||
long, short, entities, knowledge, agent_knowledge, kickoff_outputs, all
|
long, short, entities, knowledge, agent_knowledge, kickoff_outputs, all
|
||||||
)
|
)
|
||||||
@@ -241,6 +231,8 @@ def reset_memories(
|
|||||||
)
|
)
|
||||||
def test(n_iterations: int, model: str):
|
def test(n_iterations: int, model: str):
|
||||||
"""Test the crew and evaluate the results."""
|
"""Test the crew and evaluate the results."""
|
||||||
|
from crewai.cli.evaluate_crew import evaluate_crew
|
||||||
|
|
||||||
click.echo(f"Testing the crew for {n_iterations} iterations with model {model}")
|
click.echo(f"Testing the crew for {n_iterations} iterations with model {model}")
|
||||||
evaluate_crew(n_iterations, model)
|
evaluate_crew(n_iterations, model)
|
||||||
|
|
||||||
@@ -254,24 +246,33 @@ def test(n_iterations: int, model: str):
|
|||||||
@click.pass_context
|
@click.pass_context
|
||||||
def install(context):
|
def install(context):
|
||||||
"""Install the Crew."""
|
"""Install the Crew."""
|
||||||
|
from crewai.cli.install_crew import install_crew
|
||||||
|
|
||||||
install_crew(context.args)
|
install_crew(context.args)
|
||||||
|
|
||||||
|
|
||||||
@crewai.command()
|
@crewai.command()
|
||||||
def run():
|
def run():
|
||||||
"""Run the Crew."""
|
"""Run the Crew."""
|
||||||
|
from crewai.cli.run_crew import run_crew
|
||||||
|
|
||||||
run_crew()
|
run_crew()
|
||||||
|
|
||||||
|
|
||||||
@crewai.command()
|
@crewai.command()
|
||||||
def update():
|
def update():
|
||||||
"""Update the pyproject.toml of the Crew project to use uv."""
|
"""Update the pyproject.toml of the Crew project to use uv."""
|
||||||
|
from crewai.cli.update_crew import update_crew
|
||||||
|
|
||||||
update_crew()
|
update_crew()
|
||||||
|
|
||||||
|
|
||||||
@crewai.command()
|
@crewai.command()
|
||||||
def login():
|
def login():
|
||||||
"""Sign Up/Login to CrewAI AOP."""
|
"""Sign Up/Login to CrewAI AOP."""
|
||||||
|
from crewai.cli.authentication.main import AuthenticationCommand
|
||||||
|
from crewai.cli.config import Settings
|
||||||
|
|
||||||
Settings().clear_user_settings()
|
Settings().clear_user_settings()
|
||||||
AuthenticationCommand().login()
|
AuthenticationCommand().login()
|
||||||
|
|
||||||
@@ -286,6 +287,8 @@ def deploy():
|
|||||||
@click.option("-y", "--yes", is_flag=True, help="Skip the confirmation prompt")
|
@click.option("-y", "--yes", is_flag=True, help="Skip the confirmation prompt")
|
||||||
def deploy_create(yes: bool):
|
def deploy_create(yes: bool):
|
||||||
"""Create a Crew deployment."""
|
"""Create a Crew deployment."""
|
||||||
|
from crewai.cli.deploy.main import DeployCommand
|
||||||
|
|
||||||
deploy_cmd = DeployCommand()
|
deploy_cmd = DeployCommand()
|
||||||
deploy_cmd.create_crew(yes)
|
deploy_cmd.create_crew(yes)
|
||||||
|
|
||||||
@@ -293,6 +296,8 @@ def deploy_create(yes: bool):
|
|||||||
@deploy.command(name="list")
|
@deploy.command(name="list")
|
||||||
def deploy_list():
|
def deploy_list():
|
||||||
"""List all deployments."""
|
"""List all deployments."""
|
||||||
|
from crewai.cli.deploy.main import DeployCommand
|
||||||
|
|
||||||
deploy_cmd = DeployCommand()
|
deploy_cmd = DeployCommand()
|
||||||
deploy_cmd.list_crews()
|
deploy_cmd.list_crews()
|
||||||
|
|
||||||
@@ -301,6 +306,8 @@ def deploy_list():
|
|||||||
@click.option("-u", "--uuid", type=str, help="Crew UUID parameter")
|
@click.option("-u", "--uuid", type=str, help="Crew UUID parameter")
|
||||||
def deploy_push(uuid: str | None):
|
def deploy_push(uuid: str | None):
|
||||||
"""Deploy the Crew."""
|
"""Deploy the Crew."""
|
||||||
|
from crewai.cli.deploy.main import DeployCommand
|
||||||
|
|
||||||
deploy_cmd = DeployCommand()
|
deploy_cmd = DeployCommand()
|
||||||
deploy_cmd.deploy(uuid=uuid)
|
deploy_cmd.deploy(uuid=uuid)
|
||||||
|
|
||||||
@@ -309,6 +316,8 @@ def deploy_push(uuid: str | None):
|
|||||||
@click.option("-u", "--uuid", type=str, help="Crew UUID parameter")
|
@click.option("-u", "--uuid", type=str, help="Crew UUID parameter")
|
||||||
def deply_status(uuid: str | None):
|
def deply_status(uuid: str | None):
|
||||||
"""Get the status of a deployment."""
|
"""Get the status of a deployment."""
|
||||||
|
from crewai.cli.deploy.main import DeployCommand
|
||||||
|
|
||||||
deploy_cmd = DeployCommand()
|
deploy_cmd = DeployCommand()
|
||||||
deploy_cmd.get_crew_status(uuid=uuid)
|
deploy_cmd.get_crew_status(uuid=uuid)
|
||||||
|
|
||||||
@@ -317,6 +326,8 @@ def deply_status(uuid: str | None):
|
|||||||
@click.option("-u", "--uuid", type=str, help="Crew UUID parameter")
|
@click.option("-u", "--uuid", type=str, help="Crew UUID parameter")
|
||||||
def deploy_logs(uuid: str | None):
|
def deploy_logs(uuid: str | None):
|
||||||
"""Get the logs of a deployment."""
|
"""Get the logs of a deployment."""
|
||||||
|
from crewai.cli.deploy.main import DeployCommand
|
||||||
|
|
||||||
deploy_cmd = DeployCommand()
|
deploy_cmd = DeployCommand()
|
||||||
deploy_cmd.get_crew_logs(uuid=uuid)
|
deploy_cmd.get_crew_logs(uuid=uuid)
|
||||||
|
|
||||||
@@ -325,6 +336,8 @@ def deploy_logs(uuid: str | None):
|
|||||||
@click.option("-u", "--uuid", type=str, help="Crew UUID parameter")
|
@click.option("-u", "--uuid", type=str, help="Crew UUID parameter")
|
||||||
def deploy_remove(uuid: str | None):
|
def deploy_remove(uuid: str | None):
|
||||||
"""Remove a deployment."""
|
"""Remove a deployment."""
|
||||||
|
from crewai.cli.deploy.main import DeployCommand
|
||||||
|
|
||||||
deploy_cmd = DeployCommand()
|
deploy_cmd = DeployCommand()
|
||||||
deploy_cmd.remove_crew(uuid=uuid)
|
deploy_cmd.remove_crew(uuid=uuid)
|
||||||
|
|
||||||
@@ -337,6 +350,8 @@ def tool():
|
|||||||
@tool.command(name="create")
|
@tool.command(name="create")
|
||||||
@click.argument("handle")
|
@click.argument("handle")
|
||||||
def tool_create(handle: str):
|
def tool_create(handle: str):
|
||||||
|
from crewai.cli.tools.main import ToolCommand
|
||||||
|
|
||||||
tool_cmd = ToolCommand()
|
tool_cmd = ToolCommand()
|
||||||
tool_cmd.create(handle)
|
tool_cmd.create(handle)
|
||||||
|
|
||||||
@@ -344,6 +359,8 @@ def tool_create(handle: str):
|
|||||||
@tool.command(name="install")
|
@tool.command(name="install")
|
||||||
@click.argument("handle")
|
@click.argument("handle")
|
||||||
def tool_install(handle: str):
|
def tool_install(handle: str):
|
||||||
|
from crewai.cli.tools.main import ToolCommand
|
||||||
|
|
||||||
tool_cmd = ToolCommand()
|
tool_cmd = ToolCommand()
|
||||||
tool_cmd.login()
|
tool_cmd.login()
|
||||||
tool_cmd.install(handle)
|
tool_cmd.install(handle)
|
||||||
@@ -360,6 +377,8 @@ def tool_install(handle: str):
|
|||||||
@click.option("--public", "is_public", flag_value=True, default=False)
|
@click.option("--public", "is_public", flag_value=True, default=False)
|
||||||
@click.option("--private", "is_public", flag_value=False)
|
@click.option("--private", "is_public", flag_value=False)
|
||||||
def tool_publish(is_public: bool, force: bool):
|
def tool_publish(is_public: bool, force: bool):
|
||||||
|
from crewai.cli.tools.main import ToolCommand
|
||||||
|
|
||||||
tool_cmd = ToolCommand()
|
tool_cmd = ToolCommand()
|
||||||
tool_cmd.login()
|
tool_cmd.login()
|
||||||
tool_cmd.publish(is_public, force)
|
tool_cmd.publish(is_public, force)
|
||||||
@@ -373,6 +392,8 @@ def flow():
|
|||||||
@flow.command(name="kickoff")
|
@flow.command(name="kickoff")
|
||||||
def flow_run():
|
def flow_run():
|
||||||
"""Kickoff the Flow."""
|
"""Kickoff the Flow."""
|
||||||
|
from crewai.cli.kickoff_flow import kickoff_flow
|
||||||
|
|
||||||
click.echo("Running the Flow")
|
click.echo("Running the Flow")
|
||||||
kickoff_flow()
|
kickoff_flow()
|
||||||
|
|
||||||
@@ -380,6 +401,8 @@ def flow_run():
|
|||||||
@flow.command(name="plot")
|
@flow.command(name="plot")
|
||||||
def flow_plot():
|
def flow_plot():
|
||||||
"""Plot the Flow."""
|
"""Plot the Flow."""
|
||||||
|
from crewai.cli.plot_flow import plot_flow
|
||||||
|
|
||||||
click.echo("Plotting the Flow")
|
click.echo("Plotting the Flow")
|
||||||
plot_flow()
|
plot_flow()
|
||||||
|
|
||||||
@@ -388,6 +411,8 @@ def flow_plot():
|
|||||||
@click.argument("crew_name")
|
@click.argument("crew_name")
|
||||||
def flow_add_crew(crew_name):
|
def flow_add_crew(crew_name):
|
||||||
"""Add a crew to an existing flow."""
|
"""Add a crew to an existing flow."""
|
||||||
|
from crewai.cli.add_crew_to_flow import add_crew_to_flow
|
||||||
|
|
||||||
click.echo(f"Adding crew {crew_name} to the flow")
|
click.echo(f"Adding crew {crew_name} to the flow")
|
||||||
add_crew_to_flow(crew_name)
|
add_crew_to_flow(crew_name)
|
||||||
|
|
||||||
@@ -400,6 +425,8 @@ def triggers():
|
|||||||
@triggers.command(name="list")
|
@triggers.command(name="list")
|
||||||
def triggers_list():
|
def triggers_list():
|
||||||
"""List all available triggers from integrations."""
|
"""List all available triggers from integrations."""
|
||||||
|
from crewai.cli.triggers.main import TriggersCommand
|
||||||
|
|
||||||
triggers_cmd = TriggersCommand()
|
triggers_cmd = TriggersCommand()
|
||||||
triggers_cmd.list_triggers()
|
triggers_cmd.list_triggers()
|
||||||
|
|
||||||
@@ -408,6 +435,8 @@ def triggers_list():
|
|||||||
@click.argument("trigger_path")
|
@click.argument("trigger_path")
|
||||||
def triggers_run(trigger_path: str):
|
def triggers_run(trigger_path: str):
|
||||||
"""Execute crew with trigger payload. Format: app_slug/trigger_slug"""
|
"""Execute crew with trigger payload. Format: app_slug/trigger_slug"""
|
||||||
|
from crewai.cli.triggers.main import TriggersCommand
|
||||||
|
|
||||||
triggers_cmd = TriggersCommand()
|
triggers_cmd = TriggersCommand()
|
||||||
triggers_cmd.execute_with_trigger(trigger_path)
|
triggers_cmd.execute_with_trigger(trigger_path)
|
||||||
|
|
||||||
@@ -422,6 +451,8 @@ def chat():
|
|||||||
"\nStarting a conversation with the Crew\nType 'exit' or Ctrl+C to quit.\n",
|
"\nStarting a conversation with the Crew\nType 'exit' or Ctrl+C to quit.\n",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
from crewai.cli.crew_chat import run_chat
|
||||||
|
|
||||||
run_chat()
|
run_chat()
|
||||||
|
|
||||||
|
|
||||||
@@ -433,6 +464,8 @@ def org():
|
|||||||
@org.command("list")
|
@org.command("list")
|
||||||
def org_list():
|
def org_list():
|
||||||
"""List available organizations."""
|
"""List available organizations."""
|
||||||
|
from crewai.cli.organization.main import OrganizationCommand
|
||||||
|
|
||||||
org_command = OrganizationCommand()
|
org_command = OrganizationCommand()
|
||||||
org_command.list()
|
org_command.list()
|
||||||
|
|
||||||
@@ -441,6 +474,8 @@ def org_list():
|
|||||||
@click.argument("id")
|
@click.argument("id")
|
||||||
def switch(id):
|
def switch(id):
|
||||||
"""Switch to a specific organization."""
|
"""Switch to a specific organization."""
|
||||||
|
from crewai.cli.organization.main import OrganizationCommand
|
||||||
|
|
||||||
org_command = OrganizationCommand()
|
org_command = OrganizationCommand()
|
||||||
org_command.switch(id)
|
org_command.switch(id)
|
||||||
|
|
||||||
@@ -448,6 +483,8 @@ def switch(id):
|
|||||||
@org.command()
|
@org.command()
|
||||||
def current():
|
def current():
|
||||||
"""Show current organization when 'crewai org' is called without subcommands."""
|
"""Show current organization when 'crewai org' is called without subcommands."""
|
||||||
|
from crewai.cli.organization.main import OrganizationCommand
|
||||||
|
|
||||||
org_command = OrganizationCommand()
|
org_command = OrganizationCommand()
|
||||||
org_command.current()
|
org_command.current()
|
||||||
|
|
||||||
@@ -461,6 +498,8 @@ def enterprise():
|
|||||||
@click.argument("enterprise_url")
|
@click.argument("enterprise_url")
|
||||||
def enterprise_configure(enterprise_url: str):
|
def enterprise_configure(enterprise_url: str):
|
||||||
"""Configure CrewAI AOP OAuth2 settings from the provided Enterprise URL."""
|
"""Configure CrewAI AOP OAuth2 settings from the provided Enterprise URL."""
|
||||||
|
from crewai.cli.enterprise.main import EnterpriseConfigureCommand
|
||||||
|
|
||||||
enterprise_command = EnterpriseConfigureCommand()
|
enterprise_command = EnterpriseConfigureCommand()
|
||||||
enterprise_command.configure(enterprise_url)
|
enterprise_command.configure(enterprise_url)
|
||||||
|
|
||||||
@@ -473,6 +512,8 @@ def config():
|
|||||||
@config.command("list")
|
@config.command("list")
|
||||||
def config_list():
|
def config_list():
|
||||||
"""List all CLI configuration parameters."""
|
"""List all CLI configuration parameters."""
|
||||||
|
from crewai.cli.settings.main import SettingsCommand
|
||||||
|
|
||||||
config_command = SettingsCommand()
|
config_command = SettingsCommand()
|
||||||
config_command.list()
|
config_command.list()
|
||||||
|
|
||||||
@@ -482,6 +523,8 @@ def config_list():
|
|||||||
@click.argument("value")
|
@click.argument("value")
|
||||||
def config_set(key: str, value: str):
|
def config_set(key: str, value: str):
|
||||||
"""Set a CLI configuration parameter."""
|
"""Set a CLI configuration parameter."""
|
||||||
|
from crewai.cli.settings.main import SettingsCommand
|
||||||
|
|
||||||
config_command = SettingsCommand()
|
config_command = SettingsCommand()
|
||||||
config_command.set(key, value)
|
config_command.set(key, value)
|
||||||
|
|
||||||
@@ -489,6 +532,8 @@ def config_set(key: str, value: str):
|
|||||||
@config.command("reset")
|
@config.command("reset")
|
||||||
def config_reset():
|
def config_reset():
|
||||||
"""Reset all CLI configuration parameters to default values."""
|
"""Reset all CLI configuration parameters to default values."""
|
||||||
|
from crewai.cli.settings.main import SettingsCommand
|
||||||
|
|
||||||
config_command = SettingsCommand()
|
config_command = SettingsCommand()
|
||||||
config_command.reset_all_settings()
|
config_command.reset_all_settings()
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ description = "{{name}} using crewAI"
|
|||||||
authors = [{ name = "Your Name", email = "you@example.com" }]
|
authors = [{ name = "Your Name", email = "you@example.com" }]
|
||||||
requires-python = ">=3.10,<3.14"
|
requires-python = ">=3.10,<3.14"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"crewai[tools]==1.5.0"
|
"crewai[tools]==1.6.0"
|
||||||
]
|
]
|
||||||
|
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ description = "{{name}} using crewAI"
|
|||||||
authors = [{ name = "Your Name", email = "you@example.com" }]
|
authors = [{ name = "Your Name", email = "you@example.com" }]
|
||||||
requires-python = ">=3.10,<3.14"
|
requires-python = ">=3.10,<3.14"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"crewai[tools]==1.5.0"
|
"crewai[tools]==1.6.0"
|
||||||
]
|
]
|
||||||
|
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
|
|||||||
@@ -310,6 +310,14 @@ class AzureCompletion(BaseLLM):
|
|||||||
params["tools"] = self._convert_tools_for_interference(tools)
|
params["tools"] = self._convert_tools_for_interference(tools)
|
||||||
params["tool_choice"] = "auto"
|
params["tool_choice"] = "auto"
|
||||||
|
|
||||||
|
additional_params = self.additional_params
|
||||||
|
additional_drop_params = additional_params.get('additional_drop_params')
|
||||||
|
drop_params = additional_params.get('drop_params')
|
||||||
|
|
||||||
|
if drop_params and isinstance(additional_drop_params, list):
|
||||||
|
for drop_param in additional_drop_params:
|
||||||
|
params.pop(drop_param, None)
|
||||||
|
|
||||||
return params
|
return params
|
||||||
|
|
||||||
def _convert_tools_for_interference(
|
def _convert_tools_for_interference(
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ from crewai.utilities.paths import db_storage_path
|
|||||||
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
|
from crewai.crew import Crew
|
||||||
from crewai.rag.core.base_client import BaseClient
|
from crewai.rag.core.base_client import BaseClient
|
||||||
from crewai.rag.core.base_embeddings_provider import BaseEmbeddingsProvider
|
from crewai.rag.core.base_embeddings_provider import BaseEmbeddingsProvider
|
||||||
from crewai.rag.embeddings.types import ProviderSpec
|
from crewai.rag.embeddings.types import ProviderSpec
|
||||||
@@ -32,16 +33,16 @@ class RAGStorage(BaseRAGStorage):
|
|||||||
self,
|
self,
|
||||||
type: str,
|
type: str,
|
||||||
allow_reset: bool = True,
|
allow_reset: bool = True,
|
||||||
embedder_config: ProviderSpec | BaseEmbeddingsProvider | None = None,
|
embedder_config: ProviderSpec | BaseEmbeddingsProvider[Any] | None = None,
|
||||||
crew: Any = None,
|
crew: Crew | None = None,
|
||||||
path: str | None = None,
|
path: str | None = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
super().__init__(type, allow_reset, embedder_config, crew)
|
super().__init__(type, allow_reset, embedder_config, crew)
|
||||||
agents = crew.agents if crew else []
|
crew_agents = crew.agents if crew else []
|
||||||
agents = [self._sanitize_role(agent.role) for agent in agents]
|
sanitized_roles = [self._sanitize_role(agent.role) for agent in crew_agents]
|
||||||
agents = "_".join(agents)
|
agents_str = "_".join(sanitized_roles)
|
||||||
self.agents = agents
|
self.agents = agents_str
|
||||||
self.storage_file_name = self._build_storage_file_name(type, agents)
|
self.storage_file_name = self._build_storage_file_name(type, agents_str)
|
||||||
|
|
||||||
self.type = type
|
self.type = type
|
||||||
self._client: BaseClient | None = None
|
self._client: BaseClient | None = None
|
||||||
@@ -96,6 +97,10 @@ class RAGStorage(BaseRAGStorage):
|
|||||||
ChromaEmbeddingFunctionWrapper, embedding_function
|
ChromaEmbeddingFunctionWrapper, embedding_function
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if self.path:
|
||||||
|
config.settings.persist_directory = self.path
|
||||||
|
|
||||||
self._client = create_client(config)
|
self._client = create_client(config)
|
||||||
|
|
||||||
def _get_client(self) -> BaseClient:
|
def _get_client(self) -> BaseClient:
|
||||||
|
|||||||
@@ -381,6 +381,7 @@ def test_azure_raises_error_when_endpoint_missing():
|
|||||||
with pytest.raises(ValueError, match="Azure endpoint is required"):
|
with pytest.raises(ValueError, match="Azure endpoint is required"):
|
||||||
AzureCompletion(model="gpt-4", api_key="test-key")
|
AzureCompletion(model="gpt-4", api_key="test-key")
|
||||||
|
|
||||||
|
|
||||||
def test_azure_raises_error_when_api_key_missing():
|
def test_azure_raises_error_when_api_key_missing():
|
||||||
"""Test that AzureCompletion raises ValueError when API key is missing"""
|
"""Test that AzureCompletion raises ValueError when API key is missing"""
|
||||||
from crewai.llms.providers.azure.completion import AzureCompletion
|
from crewai.llms.providers.azure.completion import AzureCompletion
|
||||||
@@ -389,6 +390,8 @@ def test_azure_raises_error_when_api_key_missing():
|
|||||||
with patch.dict(os.environ, {}, clear=True):
|
with patch.dict(os.environ, {}, clear=True):
|
||||||
with pytest.raises(ValueError, match="Azure API key is required"):
|
with pytest.raises(ValueError, match="Azure API key is required"):
|
||||||
AzureCompletion(model="gpt-4", endpoint="https://test.openai.azure.com")
|
AzureCompletion(model="gpt-4", endpoint="https://test.openai.azure.com")
|
||||||
|
|
||||||
|
|
||||||
def test_azure_endpoint_configuration():
|
def test_azure_endpoint_configuration():
|
||||||
"""
|
"""
|
||||||
Test that Azure endpoint configuration works with multiple environment variable names
|
Test that Azure endpoint configuration works with multiple environment variable names
|
||||||
@@ -1086,3 +1089,27 @@ def test_azure_mistral_and_other_models():
|
|||||||
)
|
)
|
||||||
assert "model" in params
|
assert "model" in params
|
||||||
assert params["model"] == model_name
|
assert params["model"] == model_name
|
||||||
|
|
||||||
|
|
||||||
|
def test_azure_completion_params_preparation_with_drop_params():
|
||||||
|
"""
|
||||||
|
Test that completion parameters are properly prepared with drop paramaeters attribute respected
|
||||||
|
"""
|
||||||
|
with patch.dict(os.environ, {
|
||||||
|
"AZURE_API_KEY": "test-key",
|
||||||
|
"AZURE_ENDPOINT": "https://models.inference.ai.azure.com"
|
||||||
|
}):
|
||||||
|
llm = LLM(
|
||||||
|
model="azure/o4-mini",
|
||||||
|
drop_params=True,
|
||||||
|
additional_drop_params=["stop"],
|
||||||
|
max_tokens=1000
|
||||||
|
)
|
||||||
|
|
||||||
|
from crewai.llms.providers.azure.completion import AzureCompletion
|
||||||
|
assert isinstance(llm, AzureCompletion)
|
||||||
|
|
||||||
|
messages = [{"role": "user", "content": "Hello"}]
|
||||||
|
params = llm._prepare_completion_params(messages)
|
||||||
|
|
||||||
|
assert params.get('stop') == None
|
||||||
82
lib/crewai/tests/rag/test_rag_storage_path.py
Normal file
82
lib/crewai/tests/rag/test_rag_storage_path.py
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
"""Tests for RAGStorage custom path functionality."""
|
||||||
|
|
||||||
|
from unittest.mock import MagicMock, patch
|
||||||
|
|
||||||
|
from crewai.memory.storage.rag_storage import RAGStorage
|
||||||
|
|
||||||
|
|
||||||
|
@patch("crewai.memory.storage.rag_storage.create_client")
|
||||||
|
@patch("crewai.memory.storage.rag_storage.build_embedder")
|
||||||
|
def test_rag_storage_custom_path(
|
||||||
|
mock_build_embedder: MagicMock,
|
||||||
|
mock_create_client: MagicMock,
|
||||||
|
) -> None:
|
||||||
|
"""Test RAGStorage uses custom path when provided."""
|
||||||
|
mock_build_embedder.return_value = MagicMock(return_value=[[0.1, 0.2, 0.3]])
|
||||||
|
mock_create_client.return_value = MagicMock()
|
||||||
|
|
||||||
|
custom_path = "/custom/memory/path"
|
||||||
|
embedder_config = {"provider": "openai", "config": {"model": "text-embedding-3-small"}}
|
||||||
|
|
||||||
|
RAGStorage(
|
||||||
|
type="short_term",
|
||||||
|
crew=None,
|
||||||
|
path=custom_path,
|
||||||
|
embedder_config=embedder_config,
|
||||||
|
)
|
||||||
|
|
||||||
|
mock_create_client.assert_called_once()
|
||||||
|
config_arg = mock_create_client.call_args[0][0]
|
||||||
|
assert config_arg.settings.persist_directory == custom_path
|
||||||
|
|
||||||
|
|
||||||
|
@patch("crewai.memory.storage.rag_storage.create_client")
|
||||||
|
@patch("crewai.memory.storage.rag_storage.build_embedder")
|
||||||
|
def test_rag_storage_default_path_when_none(
|
||||||
|
mock_build_embedder: MagicMock,
|
||||||
|
mock_create_client: MagicMock,
|
||||||
|
) -> None:
|
||||||
|
"""Test RAGStorage uses default path when no custom path is provided."""
|
||||||
|
mock_build_embedder.return_value = MagicMock(return_value=[[0.1, 0.2, 0.3]])
|
||||||
|
mock_create_client.return_value = MagicMock()
|
||||||
|
|
||||||
|
embedder_config = {"provider": "openai", "config": {"model": "text-embedding-3-small"}}
|
||||||
|
|
||||||
|
storage = RAGStorage(
|
||||||
|
type="short_term",
|
||||||
|
crew=None,
|
||||||
|
path=None,
|
||||||
|
embedder_config=embedder_config,
|
||||||
|
)
|
||||||
|
|
||||||
|
mock_create_client.assert_called_once()
|
||||||
|
assert storage.path is None
|
||||||
|
|
||||||
|
|
||||||
|
@patch("crewai.memory.storage.rag_storage.create_client")
|
||||||
|
@patch("crewai.memory.storage.rag_storage.build_embedder")
|
||||||
|
def test_rag_storage_custom_path_with_batch_size(
|
||||||
|
mock_build_embedder: MagicMock,
|
||||||
|
mock_create_client: MagicMock,
|
||||||
|
) -> None:
|
||||||
|
"""Test RAGStorage uses custom path with batch_size in config."""
|
||||||
|
mock_build_embedder.return_value = MagicMock(return_value=[[0.1, 0.2, 0.3]])
|
||||||
|
mock_create_client.return_value = MagicMock()
|
||||||
|
|
||||||
|
custom_path = "/custom/batch/path"
|
||||||
|
embedder_config = {
|
||||||
|
"provider": "openai",
|
||||||
|
"config": {"model": "text-embedding-3-small", "batch_size": 100},
|
||||||
|
}
|
||||||
|
|
||||||
|
RAGStorage(
|
||||||
|
type="long_term",
|
||||||
|
crew=None,
|
||||||
|
path=custom_path,
|
||||||
|
embedder_config=embedder_config,
|
||||||
|
)
|
||||||
|
|
||||||
|
mock_create_client.assert_called_once()
|
||||||
|
config_arg = mock_create_client.call_args[0][0]
|
||||||
|
assert config_arg.settings.persist_directory == custom_path
|
||||||
|
assert config_arg.batch_size == 100
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
"""CrewAI development tools."""
|
"""CrewAI development tools."""
|
||||||
|
|
||||||
__version__ = "1.5.0"
|
__version__ = "1.6.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user