from sina import Sina from pydantic import BaseModel, Field
from langchain.chat_models import ChatOpenAI from langchain.agents import AgentType, initialize_agent from langchain.tools import BaseTool from typing importType, Optional from langchain.callbacks.manager import CallbackManagerForToolRun, AsyncCallbackManagerForToolRun
classStockPriceQueryTool(BaseTool): name = "StockPriceQuery" description = "useful for when you need to answer questions about the price of a stock code" args_schema: Type[BaseModel] = StockQueryInput
asyncdef_arun(self, query: str, run_manager: Optional[AsyncCallbackManagerForToolRun] = None) -> str: raise NotImplementedError("StockPriceQueryTool does not support async")