feat: set AIFunction.name in addition to AIFunction.spec.name

pull/693/head
Travis Fischer 2025-03-14 21:29:27 +08:00
rodzic 43bda73d09
commit 9d99afa2cb
1 zmienionych plików z 6 dodań i 0 usunięć

Wyświetl plik

@ -64,6 +64,12 @@ export function createAIFunction<InputSchema extends z.ZodObject<any>, Output>(
return implementation(parsedInput)
}
// Override the default function name with the intended name.
Object.defineProperty(aiFunction, 'name', {
value: spec.name,
writable: false
})
const strict = !!spec.strict
aiFunction.inputSchema = spec.inputSchema