@lobehub/ui
Version:
Lobe UI is an open-source UI component library for building AIGC web apps
44 lines (43 loc) • 931 B
TypeScript
import { ErrorType } from './error';
import { LLMRoleType } from './llm';
import { BaseDataModel } from './meta';
/**
* 聊天消息错误对象
*/
export interface ChatMessageError {
body?: any;
message: string;
type: ErrorType;
}
export interface OpenAIFunctionCall {
arguments?: string;
name: string;
}
export interface ChatMessage extends BaseDataModel {
/**
* @title 内容
* @description 消息内容
*/
content: string;
error?: ChatMessageError;
extra?: any;
/**
* replace with plugin
* @deprecated
*/
function_call?: OpenAIFunctionCall;
name?: string;
parentId?: string;
plugin?: any;
quotaId?: string;
/**
* 角色
* @description 消息发送者的角色
*/
role: LLMRoleType;
/**
* 保存到主题的消息
*/
topicId?: string;
}
export type ChatMessageMap = Record<string, ChatMessage>;