-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOC: How to define bindTools method in chatmodel? #7220
Comments
Hello @keyiis! I'm here to help you with any bugs, questions, or contributions you have. Let's work together to solve this issue. To implement the
These steps will allow you to implement the |
@dosu I used @langchain/community/chat_models/alibaba_tongyi to creat llm,but it dosen't define bindTools method. |
The override bindTools(
tools: BindToolsInput[],
kwargs?: Partial<DeepInfraCallOptions>
): Runnable<BaseLanguageModelInput, AIMessageChunk, DeepInfraCallOptions> {
return this.bind({
tools: tools.map((tool) => convertToOpenAITool(tool)),
...kwargs,
} as DeepInfraCallOptions);
} This method allows the model to bind tools by converting them to the appropriate format and passing them along with any additional options [1]. You can adapt this approach to implement |
Checklist
Issue with current documentation:
I noticed that none of the models in the langchain/community/chat_models directory implement the bindTools method. What is the reason for this? If I want to add the bindTools method to a specific model, how should I proceed?
Idea or request for content:
I hope to provide guidelines for implementing the bindTools method for models in the chat_models directory.
The text was updated successfully, but these errors were encountered: