最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

agent - Why is tools calling not working properly while using ChatTogether from langchain with create_react_agent from langgraph

programmeradmin2浏览0评论

I am using langgraph to build an agent that will extract the content from a pdf file. I have a Together AI api key and I want to use a llm model from there.

But, while using create_react_agent(llm, tools) from langgraph, the llm model (mistralai/Mistral-Small-24B-Instruct-2501) doesn't call any tools even though I can see in the langsmith trace the output specifying a tool call.

Here is my code to build the agent and to create the llm. It is worth saying that when using OpenRouter models and ChatOpenAI instead, it works well. How can I solve this, thanks.

from langchain_together import ChatTogether
from langgraph.prebuilt import create_react_agent

llm = ChatTogether(
        model=model,
        temperature=0,[enter image description here][1]
        api_key=api_key,
    )

inputs_tools = [extract_pdf, update_inputs]
agent = create_react_agent(
    llm, tools=inputs_tools, prompt=inputs_retriever_prompt(), state_schema=State
)

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论