-
Notifications
You must be signed in to change notification settings - Fork 0
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
core[minor]: Allow for simple tool schema to be passed to bindTools #14
base: cloned_main_12963
Are you sure you want to change the base?
core[minor]: Allow for simple tool schema to be passed to bindTools #14
Conversation
Clone of the PR langchain-ai/langchainjs#6253 |
My review is in progress 📖 - I will have feedback for you in a few minutes! |
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis update introduces significant enhancements to the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
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.
I have reviewed your code and did not find any issues!
Please note that I can make mistakes, and you should still encourage your team to review your code as well.
@coderabbitai review |
/review |
Actions performedReview triggered.
|
PR Reviewer Guide 🔍
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- langchain-core/src/language_models/chat_models.ts (2 hunks)
- langchain-core/src/tools/index.ts (1 hunks)
Additional comments not posted (3)
langchain-core/src/tools/index.ts (1)
50-63
: IntroduceToolSchema
interface.The
ToolSchema
interface is well-defined, providing a clear structure for tool definitions. The use ofZodObjectAny
for theschema
property allows for flexible parameter validation. This addition enhances the flexibility and maintainability of tool-related code.langchain-core/src/language_models/chat_models.ts (2)
36-36
: AddToolSchema
to imports.The addition of
ToolSchema
to the imports reflects its integration into theBaseChatModel
class, enabling the use of the new tool schema within chat models.
187-187
: ExpandbindTools
method to includeToolSchema
.The inclusion of
ToolSchema
in thebindTools
method enhances the method's capability to handle diverse tool configurations. This change supports the PR's goal of improving flexibility and maintainability in tool integration.
Zero comments from coderabbit |
Allows for a more concise schema to be passed to models. This is not intended to be used in Agents or similar since it has no function attached, and is more similar to
.withStructuredOutput
.TODO:
Description by Korbit AI
Note
This feature is in early access. You can enable or disable it in the Korbit Console.
What change is being made?
Allow for simple tool schema to be passed to
bindTools
by addingToolSchema
interface and updatingBaseChatModel
to acceptToolSchema
.Why are these changes being made?
This change enhances the flexibility of the
bindTools
function by allowing it to accept a simpler tool schema, making it easier to define and use tools with minimal configuration. This approach simplifies the integration process and improves code maintainability.Summary by CodeRabbit
New Features
ToolSchema
interface, enhancing tool definitions with name, description, and schema properties.BaseChatModel
class to acceptToolSchema
, improving flexibility in handling tools within chat interactions.Bug Fixes