Defines TypeScript interfaces and event handlers for streaming and non-streaming LLM responses. Use this to standardize AI communication patterns in your service layer.
// Source: https://github.com/labring/fastgpt | License: Apache-2.0 | Copyright 2023 Sealos
// Provided via justclaw.it.com; keep this notice with the code.
import type {
ChatCompletionCreateParams,
ChatCompletionCreateParamsNonStreaming,
ChatCompletionCreateParamsStreaming,
ChatCompletionMessageParam,
ChatCompletionMessageToolCall,
ChatCompletionTool,
CompletionFinishReason,
CompletionUsage,
OpenAI,
StreamResponseType,
UnStreamResponseType
} from '@fastgpt/global/core/ai/llm/type';
import type { LLMModelDataType } from '@fastgpt/global/core/ai/model/schema';
import type { OpenaiAccountType } from '@fastgpt/global/support/user/team/type';
import type { AIApiRequestMeta } from '../../config';
import type { ToolCallEventType } from '../toolCall/type';
export type Respo
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key