Coder Social home page Coder Social logo

Comments (5)

MannaYang avatar MannaYang commented on July 16, 2024

The function tool code :

def get_current_time():
    weekdays = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
    time_zone = pytz.timezone('Asia/Shanghai')
    date_time = datetime.now(time_zone)
    time_format = date_time.strftime("%Y-%m-%d %H:%M:%S")
    week_day = date_time.weekday()
    return f"CurrentTime: {time_format} {weekdays[week_day]}"

from langchain.

wangyaoyong-wyy avatar wangyaoyong-wyy commented on July 16, 2024

I also encountered this issue while using ChatTongyi, and after breakpoint source code feedback, Multiple tool_calls are not supported in message This feature will be supported in the future, Perhaps Tongyi does not currently support multi model scheduling?

from langchain.

MannaYang avatar MannaYang commented on July 16, 2024

I also encountered this issue while using ChatTongyi, and after breakpoint source code feedback, Multiple tool_calls are not supported in message This feature will be supported in the future, Perhaps Tongyi does not currently support multi model scheduling?

Maybe you're right. I tried to use create_react_agent.invoke() , like AgentExecutor on_llm_new_token callback , but it doesn't work.

from langchain.

wangyaoyong-wyy avatar wangyaoyong-wyy commented on July 16, 2024

This issue may occur when using create_tool_calling-agent. According to the error code displayed on the dashscope official website, it is due to passing incorrect parameters that this issue occurs. If you switch to create_json_chat_agent, this issue will not occur

prompt = hub.pull("hwchase17/react-chat-json")
agent = create_json_chat_agent(chat, tools, prompt)
# agent = create_tool_calling_agent(chat,tools,prompt)
agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True, handle_parsing_errors=True)
resp =agent_executor.invoke({"input": "what is LangChain latest version?"})
print(resp)

from langchain.

MannaYang avatar MannaYang commented on July 16, 2024

This issue may occur when using create_tool_calling-agent. According to the error code displayed on the dashscope official website, it is due to passing incorrect parameters that this issue occurs. If you switch to create_json_chat_agent, this issue will not occur

prompt = hub.pull("hwchase17/react-chat-json")
agent = create_json_chat_agent(chat, tools, prompt)
# agent = create_tool_calling_agent(chat,tools,prompt)
agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True, handle_parsing_errors=True)
resp =agent_executor.invoke({"input": "what is LangChain latest version?"})
print(resp)

With langgraph.prebuilt.create_react_agent() is return CompiledGraph object.
Currently ChatTongyi() calling stream directly and carrying the tool still reports errors("Multiple tool_calls are not supported in message").
So I want to pass config={“callbacks”: “Streamingxxxxxx”} via invoke to get the chunk generated by on_llm_new_token , but it doesn't work.

from langchain.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.