Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept Langchain's RunnableConfig to Agent.execute_task #483

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/crewai/agent.py
Expand Up @@ -7,6 +7,7 @@
from langchain.tools.render import render_text_description
from langchain_core.agents import AgentAction
from langchain_core.callbacks import BaseCallbackHandler
from langchain_core.runnables import RunnableConfig
from langchain_openai import ChatOpenAI
from pydantic import (
UUID4,
Expand Down Expand Up @@ -181,6 +182,7 @@ def execute_task(
task: Any,
context: Optional[str] = None,
tools: Optional[List[Any]] = None,
config: Optional[RunnableConfig] = None,
) -> str:
"""Execute a task with the agent.

Expand Down Expand Up @@ -227,7 +229,8 @@ def execute_task(
"input": task_prompt,
"tool_names": self.agent_executor.tools_names,
"tools": self.agent_executor.tools_description,
}
},
config=config
)["output"]

if self.max_rpm:
Expand Down