motleycrew.tools.autogen_chat_tool
Functions
|
|
|
Classes
|
A tool for incorporating AutoGen chats into MotleyCrew. |
- motleycrew.tools.autogen_chat_tool.get_last_message(chat_result: None) str
- class motleycrew.tools.autogen_chat_tool.AutoGenChatTool(name: str, description: str, prompt: str | ~langchain_core.prompts.base.BasePromptTemplate, initiator: None, recipient: None, result_extractor: ~typing.Callable[[None], ~typing.Any] = <function get_last_message>, input_schema: ~typing.Type[~pydantic.v1.main.BaseModel] | None = None, return_direct: bool = False, exceptions_to_reflect: ~typing.List[Exception] | None = None)
Bases:
MotleyTool
A tool for incorporating AutoGen chats into MotleyCrew.
- __init__(name: str, description: str, prompt: str | ~langchain_core.prompts.base.BasePromptTemplate, initiator: None, recipient: None, result_extractor: ~typing.Callable[[None], ~typing.Any] = <function get_last_message>, input_schema: ~typing.Type[~pydantic.v1.main.BaseModel] | None = None, return_direct: bool = False, exceptions_to_reflect: ~typing.List[Exception] | None = None)
- Parameters:
name – Name of the tool.
description – Description of the tool.
prompt – Prompt to use for the tool. Can be a string or a PromptTemplate object.
initiator – The agent initiating the chat.
recipient – The first recipient agent. This is the agent that you would specify in
initiate_chat
arguments.result_extractor – Function to extract the result from the chat result.
input_schema – Input schema for the tool. The input variables should match the variables in the prompt. If not provided, a schema will be generated based on the input variables in the prompt, if any, with string fields.
- motleycrew.tools.autogen_chat_tool.create_autogen_chat_tool(name: str, description: str, prompt: str | BasePromptTemplate, initiator: None, recipient: None, result_extractor: Callable[[None], Any], input_schema: Type[BaseModel] | None = None)