update comments

This commit is contained in:
Paulo Santos
2026-02-13 12:36:47 +00:00
committed by GitHub
parent 074e8b294d
commit 3a80d137e1
2 changed files with 6 additions and 4 deletions

View File

@@ -43,11 +43,11 @@ inputs:
required: false
default: ''
max-tokens:
description: Maximum tokens to generate (deprecated)
description: The maximum tokens to generate (deprecated)
required: false
default: '200'
max-completion-tokens:
description: Maximum tokens to generate
description: The maximum tokens to generate
required: false
default: ''
temperature:

View File

@@ -35,7 +35,7 @@ export interface InferenceResponse {
}
/**
* Build the token limit params for a chat completion request.
* Build according to what input was passed, default to max_tokens.
* Only one of max_tokens or max_completion_tokens will be set.
*/
function buildMaxTokensParam(request: InferenceRequest): {max_tokens?: number; max_completion_tokens?: number} {
@@ -177,7 +177,9 @@ export async function mcpInference(
}
/**
* Wrapper around OpenAI chat.completions.create with response validation.
* Wrapper around OpenAI chat.completions.create with defensive handling for cases where
* the SDK returns a raw string (e.g., unexpected content-type or streaming body) instead of
* a parsed object. Ensures an object with a 'choices' array is returned or throws a descriptive error.
*/
async function chatCompletion(
client: OpenAI,