diff --git a/packages/core/src/create-ai-function.ts b/packages/core/src/create-ai-function.ts index 7ebba6ce..ccdff2ed 100644 --- a/packages/core/src/create-ai-function.ts +++ b/packages/core/src/create-ai-function.ts @@ -64,6 +64,12 @@ export function createAIFunction, 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