jamis
Version:
一种支持通过JSON配置方式生成页面的组件库
56 lines (55 loc) • 1.63 kB
TypeScript
import type { Emitter, EventsMap, RendererProps, Schema } from 'jamis-core';
import type { BaseSchemaScoped, SchemaObject, SchemaTpl } from '../types';
import type { IPlayStore } from './PlayStore';
export interface AIPlaygroundSchema extends BaseSchemaScoped {
type: 'ai-playground';
schema?: SchemaObject | SchemaTpl;
schemaPlaceholder?: SchemaObject | SchemaTpl;
}
export interface PlayGroundProps extends RendererProps, Omit<AIPlaygroundSchema, 'data'> {
history?: any;
index?: number;
viewMode?: 'mobile' | (string & {});
store: IPlayStore;
[key: string]: any;
}
export interface RagResultItem {
vectorId: string;
docUrl?: string;
docName?: string;
score: number;
content: string;
/** 重排序后的分数 */
rerankScore?: number;
}
export interface TRAGParam {
ragCode: string;
namespaceCode: string;
collectionCode: string;
filterExpr?: string;
}
export interface RerankRetrievalItem {
index: number;
relevanceScore: number;
}
export interface PlayEvents extends EventsMap {
activeNode: (pgId: any, region?: string) => void;
sendMessage: (pgId: string, message: string) => void;
}
export type PlayEmitters = Emitter<PlayEvents>;
export interface IPlayNode {
id: string;
parentId?: string;
slot?: string;
value: Schema;
type: string;
keyOrder: (string | number)[];
children: Record<string, string[]>;
}
export interface SystemPrompt {
toneStyle: string | string[];
proactiveness: string | string[];
role: string | string[];
rules: string | string[];
examples: string | string[];
}