File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 1
- import { z } from "zod" ;
2
1
import * as winston from "winston" ;
3
2
import {
4
3
type BindToolsInput ,
@@ -111,9 +110,9 @@ export class BaseModelProvider implements KaiModelProvider {
111
110
}
112
111
113
112
async stream (
114
- input : any ,
113
+ input : BaseLanguageModelInput ,
115
114
options ?: Partial < KaiModelProviderInvokeCallOptions > | undefined ,
116
- ) : Promise < IterableReadableStream < any > > {
115
+ ) : Promise < IterableReadableStream < AIMessageChunk > > {
117
116
if ( options && options . cacheKey ) {
118
117
const cachedResult = await this . cache . get ( input , {
119
118
cacheSubDir : options . cacheKey ,
@@ -205,10 +204,17 @@ export async function runModelHealthCheck(
205
204
supportsToolsInStreaming : false ,
206
205
} ;
207
206
208
- const tool : DynamicStructuredTool = new DynamicStructuredTool ( {
207
+ const tool = new DynamicStructuredTool ( {
209
208
name : "gamma" ,
210
209
description : "Custom operator that works with two numbers" ,
211
- schema : z . any ( ) ,
210
+ schema : {
211
+ type : "object" ,
212
+ properties : {
213
+ a : { type : "string" } ,
214
+ b : { type : "string" } ,
215
+ } ,
216
+ required : [ "a" , "b" ] ,
217
+ } ,
212
218
func : async ( { a, b } : { a : string ; b : string } ) => {
213
219
return a + b ;
214
220
} ,
You can’t perform that action at this time.
0 commit comments