workernode types

pull/160/head
Kye 2 years ago
parent 53334f1bdd
commit abfb9a0096

@ -6,16 +6,21 @@ from langchain.callbacks.manager import (
AsyncCallbackManagerForToolRun, AsyncCallbackManagerForToolRun,
CallbackManagerForToolRun, CallbackManagerForToolRun,
) )
from typing import List, Any, Dict from typing import List, Any, Dict, Optional
from langchain.memory.chat_message_histories import FileChatMessageHistory from langchain.memory.chat_message_histories import FileChatMessageHistory
import logging import logging
from pydantic import BaseModel, Extra
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s') logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
class WorkerNodeArgs(BaseModel): class WorkerNodeArgs(BaseModel):
prompt: str prompt: str
run_manager: Optional[CallbackManagerForToolRun] = None run_manager: Optional[CallbackManagerForToolRun] = None
class Config:
arbitrary_types_allowed = True
extra = Extra.forbid
@tool("WorkerNode") @tool("WorkerNode")
class WorkerNode(BaseTool): class WorkerNode(BaseTool):
"""Useful for when you need to spawn an autonomous agent instance as a worker to accomplish complex tasks, it can search the internet or spawn child multi-modality models to process and generate images and text or audio and so on""" """Useful for when you need to spawn an autonomous agent instance as a worker to accomplish complex tasks, it can search the internet or spawn child multi-modality models to process and generate images and text or audio and so on"""

Loading…
Cancel
Save