-
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 #8
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,21 @@ export interface ToolParams extends BaseLangChainParams { | |
responseFormat?: ResponseFormat; | ||
} | ||
|
||
export interface ToolSchema { | ||
/** | ||
* The name of the tool to pass to the model. | ||
*/ | ||
name: string; | ||
/** | ||
* An optional description of the tool to pass to the model. | ||
*/ | ||
description?: string; | ||
/** | ||
* A Zod schema representing the parameters of the tool. | ||
*/ | ||
schema: ZodObjectAny; | ||
} | ||
Comment on lines
+50
to
+63
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new ToolSchema interface has been added, which is a good addition for allowing more concise schema definitions. However, to ensure proper functionality and prevent misuse, we should add comments explaining its intended use and limitations. Specifically, we should note that this is not intended to be used in Agents or similar contexts, as it has no function attached. Consider adding a comment above the ToolSchema interface to clarify its purpose and usage constraints.
|
||
|
||
export interface StructuredToolInterface<T extends ZodObjectAny = ZodObjectAny> | ||
extends RunnableInterface< | ||
(z.output<T> extends string ? string : never) | z.input<T> | ToolCall, | ||
|
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 import statement for
ToolSchema
is added but not used anywhere in the file. Unused imports can clutter the code and make it harder to read and maintain. Please remove the unused import statement forToolSchema
to keep the code clean and maintainable.