-
-
Save ma-zah/2674f361eafa2a9741fc1b65e8ed7ae9 to your computer and use it in GitHub Desktop.
on type safety in LangChain TS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async call( | |
arg: (z.output<T> extends string ? string : never) | z.input<T>, | |
configArg?: Callbacks | RunnableConfig, | |
/** @deprecated */ | |
tags?: string[] | |
): Promise<string> { | |
let parsed; | |
try { | |
parsed = await this.schema.parseAsync(arg); | |
} catch (e) { | |
throw new ToolInputParsingException( | |
`Received tool input did not match expected schema`, | |
JSON.stringify(arg) | |
); | |
} | |
// ... more code |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment