Skip to content

Commit 8ddbb86

Browse files
committed
Use json schema
Signed-off-by: Ian Bolton <[email protected]>
1 parent 8d7318a commit 8ddbb86

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

vscode/src/modelProvider/modelProvider.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { z } from "zod";
21
import * as winston from "winston";
32
import {
43
type BindToolsInput,
@@ -111,9 +110,9 @@ export class BaseModelProvider implements KaiModelProvider {
111110
}
112111

113112
async stream(
114-
input: any,
113+
input: BaseLanguageModelInput,
115114
options?: Partial<KaiModelProviderInvokeCallOptions> | undefined,
116-
): Promise<IterableReadableStream<any>> {
115+
): Promise<IterableReadableStream<AIMessageChunk>> {
117116
if (options && options.cacheKey) {
118117
const cachedResult = await this.cache.get(input, {
119118
cacheSubDir: options.cacheKey,
@@ -205,10 +204,17 @@ export async function runModelHealthCheck(
205204
supportsToolsInStreaming: false,
206205
};
207206

208-
const tool: DynamicStructuredTool = new DynamicStructuredTool({
207+
const tool = new DynamicStructuredTool({
209208
name: "gamma",
210209
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+
},
212218
func: async ({ a, b }: { a: string; b: string }) => {
213219
return a + b;
214220
},

0 commit comments

Comments
 (0)