@sap-ai-sdk/foundation-models
Version:
SAP Cloud SDK for AI is the official Software Development Kit (SDK) for **SAP AI Core**, **SAP Generative AI Hub**, and **Orchestration Service**.
31 lines • 1.24 kB
TypeScript
import type { HttpResponse } from '@sap-cloud-sdk/http-client';
import type { AzureOpenAiCompletionUsage, AzureOpenAiCreateChatCompletionResponse } from './client/inference/schema/index.js';
/**
* Azure OpenAI chat completion response.
*/
export declare class AzureOpenAiChatCompletionResponse {
readonly rawResponse: HttpResponse;
/**
* The chat completion response.
*/
readonly data: AzureOpenAiCreateChatCompletionResponse;
constructor(rawResponse: HttpResponse);
/**
* Usage of tokens in the response.
* @returns Token usage.
*/
getTokenUsage(): AzureOpenAiCompletionUsage | undefined;
/**
* Reason for stopping the completion.
* @param choiceIndex - The index of the choice to parse.
* @returns The finish reason.
*/
getFinishReason(choiceIndex?: number): AzureOpenAiCreateChatCompletionResponse['choices'][0]['finish_reason'] | undefined;
/**
* Parses the Azure OpenAI response and returns the content.
* @param choiceIndex - The index of the choice to parse.
* @returns The message content.
*/
getContent(choiceIndex?: number): string | undefined | null;
}
//# sourceMappingURL=azure-openai-chat-completion-response.d.ts.map