UNPKG

xinghuo-test

Version:

xinghuo

59 lines (51 loc) 996 B
export enum ModelVersion { V2 = "V2", } export const ModelVersionUrl = { [ModelVersion.V2]: "ws://spark-openapi.cn-huabei-1.xf-yun.com/v1/assistants/hr8y5mveufy4_v1", }; export const ChatDomain = { [ModelVersion.V2]: "generalv2", }; export enum MessageRole { user = "user", assistant = "assistant", } export interface IChatMessage { role: MessageRole; content: string; } export interface IChatResponse { text: string; uasge: IChatUasgeResponse; } interface IChatUasgeResponse { completion_tokens: number; prompt_tokens: number; question_tokens: number; total_tokens: number; } export interface ISparkChatResponse { header: { code: number; message: string; sid: string; status: number; }; payload: { choices: { status: number; seq: number; text: [ { content: string; role: string; index: number; } ]; }; usage?: { text: IChatUasgeResponse; }; }; }