You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added a very descriptive title to this question.
I searched the LangChain documentation with the integrated search.
I used the GitHub search to find a similar question and didn't find it.
Commit to Help
I commit to help with one of those options 👆
Example Code
fromlangchain_openaiimportChatOpenAIfromlangchain_core.toolsimporttoolimportosllm=ChatOpenAI(
model="qwen2.5-32b-instruct",
api_key=os.getenv("BAILIAN_API_KEY"),
base_url=os.getenv("BAILIAN_BASE_URL")
)
@tooldefmultiply(a: int, b: int) ->int:
"""Multiply a and b Args: a (int): first int b (int): second int """returna*bllm_with_tools=llm.bind_tools([multiply])
result=llm_with_tools.invoke("What is 2 multiplied by 3?")
print(result)
Description
I'm working on completing the LangChain tutorial about extraction. I used the code above to implement function calling, leveraging the Aliyun Bailian API (OpenAI compatible). I've confirmed that the model (qwen2.5-32b-instruct) supports function calling. However, when I run the code, I receive an empty content string, even though the function calling itself works properly:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Description
I'm working on completing the LangChain tutorial about extraction. I used the code above to implement function calling, leveraging the Aliyun Bailian API (OpenAI compatible). I've confirmed that the model (qwen2.5-32b-instruct) supports function calling. However, when I run the code, I receive an empty content string, even though the function calling itself works properly:
output:
System Info
plangchain==0.3.19
langchain-core==0.3.40
langchain-openai==0.3.2
langchain-text-splitters==0.3.6
M1 Arm Mac platform
Python 3.12.8
Beta Was this translation helpful? Give feedback.
All reactions