UNPKG

@ai-foundry/llm-sdk

Version:

This is just another SDK for the common LLM API providers.

23 lines (22 loc) 1.12 kB
import type { LLMTokensUsage, FinishReason, LLMOptions, LLMRequest, LLMResponse, LLMApiProviderOptions } from '../models/llm.models'; import type { LLMAssistantMessage, LLMMessage } from '../models/llm-message.models'; import type { LLMTool } from '../models/llm-tool.models'; import type { JSONObject } from '../models/data.models'; export interface LLMApiResponse { message: LLMAssistantMessage; usage: LLMTokensUsage; finishReason: FinishReason; request: LLMRequest; response: LLMResponse; } export declare abstract class LLMApiService { abstract getURL(): string; abstract getHeaders(): Record<string, string>; abstract formatMessagePayload(message: LLMMessage): JSONObject; abstract formatToolCallPayload(tool: LLMTool): JSONObject; abstract formatOptionsPayload(options: LLMOptions): JSONObject; abstract parseAssistantResponse(data: JSONObject): Omit<LLMApiResponse, 'request' | 'response'>; createAssistantMessage(messages: LLMMessage[], tools?: LLMTool[], options?: LLMOptions & { providerOptions?: LLMApiProviderOptions; }): Promise<LLMApiResponse>; }