From 725fb1c850f77b2af436026613aefaffb8bf1df4 Mon Sep 17 00:00:00 2001 From: Paulo Santos Date: Wed, 4 Feb 2026 21:24:03 +0000 Subject: [PATCH] update max_tokens to max_completion_tokens --- __tests__/inference.test.ts | 6 +++--- src/inference.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/__tests__/inference.test.ts b/__tests__/inference.test.ts index f9b0eb1..5c10fc6 100644 --- a/__tests__/inference.test.ts +++ b/__tests__/inference.test.ts @@ -72,7 +72,7 @@ describe('inference.ts', () => { content: 'Hello, AI!', }, ], - max_tokens: 100, + max_completion_tokens: 100, model: 'gpt-4', }) @@ -176,7 +176,7 @@ describe('inference.ts', () => { content: 'Hello, AI!', }, ], - max_tokens: 100, + max_completion_tokens: 100, model: 'gpt-4', response_format: requestWithResponseFormat.responseFormat, }) @@ -228,7 +228,7 @@ describe('inference.ts', () => { expect(callArgs.tools).toEqual(mockMcpClient.tools) expect(callArgs.response_format).toBeUndefined() expect(callArgs.model).toBe('gpt-4') - expect(callArgs.max_tokens).toBe(100) + expect(callArgs.max_completion_tokens).toBe(100) // Verify OpenAI client was initialized with empty custom headers expect(mockOpenAIClient).toHaveBeenCalledWith({ diff --git a/src/inference.ts b/src/inference.ts index 34dc813..c7880d7 100644 --- a/src/inference.ts +++ b/src/inference.ts @@ -47,7 +47,7 @@ export async function simpleInference(request: InferenceRequest): Promise