chat.ts 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. import { ParamNeed } from './app';
  2. type ChartValue = {
  3. name: string;
  4. type: string;
  5. value: number;
  6. };
  7. /**
  8. * dashboard chart type
  9. */
  10. export type ChartData = {
  11. chart_desc: string;
  12. chart_name: string;
  13. chart_sql: string;
  14. chart_type: string;
  15. chart_uid: string;
  16. column_name: Array<string>;
  17. values: Array<ChartValue>;
  18. type?: string;
  19. };
  20. export type SceneResponse = {
  21. chat_scene: string;
  22. param_title: string;
  23. scene_describe: string;
  24. scene_name: string;
  25. show_disable: boolean;
  26. };
  27. export type NewDialogueParam = {
  28. chat_mode: string;
  29. model?: string;
  30. };
  31. export type ChatHistoryResponse = IChatDialogueMessageSchema[];
  32. export type IChatDialogueSchema = {
  33. conv_uid: string;
  34. user_input: string;
  35. user_name: string;
  36. chat_mode:
  37. | 'chat_with_db_execute'
  38. | 'chat_excel'
  39. | 'chat_with_db_qa'
  40. | 'chat_knowledge'
  41. | 'chat_dashboard'
  42. | 'chat_execution'
  43. | 'chat_agent'
  44. | 'chat_flow'
  45. | (string & {});
  46. select_param: string;
  47. app_code: string;
  48. param_need?: ParamNeed[];
  49. };
  50. export type UserParam = {
  51. user_channel: string;
  52. user_no: string;
  53. nick_name: string;
  54. };
  55. export type UserParamResponse = {
  56. user_channel: string;
  57. user_no: string;
  58. user_id: string;
  59. };
  60. export type DialogueListResponse = IChatDialogueSchema[];
  61. export type IChatDialogueMessageSchema = {
  62. role: 'human' | 'view' | 'system' | 'ai';
  63. context: string;
  64. order: number;
  65. time_stamp: number | string | null;
  66. model_name: string;
  67. retry?: boolean;
  68. thinking?: boolean;
  69. outing?: boolean;
  70. feedback?: Record<string, any>;
  71. };
  72. export type ModelType =
  73. | 'proxyllm'
  74. | 'flan-t5-base'
  75. | 'vicuna-13b'
  76. | 'vicuna-7b'
  77. | 'vicuna-13b-v1.5'
  78. | 'vicuna-7b-v1.5'
  79. | 'codegen2-1b'
  80. | 'codet5p-2b'
  81. | 'chatglm-6b-int4'
  82. | 'chatglm-6b'
  83. | 'chatglm2-6b'
  84. | 'chatglm2-6b-int4'
  85. | 'guanaco-33b-merged'
  86. | 'falcon-40b'
  87. | 'gorilla-7b'
  88. | 'gptj-6b'
  89. | 'proxyllm'
  90. | 'chatgpt_proxyllm'
  91. | 'bard_proxyllm'
  92. | 'claude_proxyllm'
  93. | 'wenxin_proxyllm'
  94. | 'tongyi_proxyllm'
  95. | 'zhipu_proxyllm'
  96. | 'llama-2-7b'
  97. | 'llama-2-13b'
  98. | 'llama-2-70b'
  99. | 'baichuan-7b'
  100. | 'baichuan-13b'
  101. | 'baichuan2-7b'
  102. | 'baichuan2-13b'
  103. | 'wizardlm-13b'
  104. | 'llama-cpp'
  105. | (string & {});
  106. export type LLMOption = { label: string; icon: string };
  107. export type FeedBack = {
  108. information?: string;
  109. just_fun?: string;
  110. others?: string;
  111. work_study?: string;
  112. };
  113. export type Reference = {
  114. name: string;
  115. chunks: Array<number>;
  116. };
  117. export type IDB = {
  118. param: string;
  119. type: string;
  120. space_id?: number;
  121. };
  122. export interface UploadResponse {
  123. file_learning: boolean;
  124. file_path: string;
  125. is_oss: boolean;
  126. }
  127. export interface RecommendQuestionParams {
  128. valid?: string; // 是否仅选择生效的应用,true/false
  129. app_code?: string; // 所属应用
  130. chat_mode?: string; // 类型(chat_knwoledge, chat_excel...)
  131. is_hot_question?: string;
  132. }
  133. export interface RecommendQuestionResponse {
  134. id: string;
  135. app_code: string;
  136. question: string;
  137. chat_mode: string;
  138. user_code: string;
  139. }
  140. export interface FeedbackReasonsResponse {
  141. reason_type: string;
  142. reason: string;
  143. }
  144. export interface FeedbackAddParams {
  145. conv_uid: string;
  146. message_id: string; // 消息id, 对应order
  147. feedback_type: string; // 反馈类型,like, unlike
  148. reason_types?: string[]; // 原因类型
  149. remark?: string; // 备注信息
  150. }
  151. export interface CancelFeedbackAddParams {
  152. conv_uid: string;
  153. message_id: string;
  154. }
  155. export interface StopTopicParams {
  156. conv_id: string;
  157. round_index: number;
  158. }