-
Notifications
You must be signed in to change notification settings - Fork 272
fix(integration): fix OpenAI custom tools example in JS #908
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the JavaScript code examples for OpenAI custom tools integration by updating imports, function signatures, and API usage to match current LangChain patterns.
Key changes:
- Updated imports from deprecated
@langchain/classic
tolangchain
- Modified agent creation and invocation patterns to use current API
- Fixed custom tool function signatures and grammar format specifications
const codeTool = customTool( | ||
async (input) => { | ||
async () => { | ||
// ... Add code to execute the input |
Copilot
AI
Oct 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The custom tool function signature has been changed to remove the input
parameter, but the comment on line 299 still references using the input. Either the parameter should be restored or the comment should be updated to match the new signature.
// ... Add code to execute the input | |
// ... Add code to execute |
Copilot uses AI. Check for mistakes.
|
||
const doMath = customTool( | ||
async (input) => { | ||
async () => { |
Copilot
AI
Oct 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the first example, this custom tool function removes the input
parameter but the comment on line 346 mentions parsing and executing the input. The function signature and comment are inconsistent.
async () => { | |
async (input) => { |
Copilot uses AI. Check for mistakes.
Preview ID generated: preview-cbopen-1760532529-d100313 |
…#908) Small update on code example in JS for OpenAI custom tools.
Small update on code example in JS for OpenAI custom tools.