app.ts 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. // app
  2. export type IApp = {
  3. app_code: string;
  4. /**
  5. * 应用名
  6. */
  7. app_name: string;
  8. /**
  9. * 应用描述信息/简介
  10. */
  11. app_describe: string;
  12. /**
  13. * 语言/prompt关联
  14. */
  15. language: 'en' | 'zh';
  16. /**
  17. * 组织模式(AutoPlan/LayOut)
  18. */
  19. team_mode: string;
  20. /**
  21. * 组织上下文/ None
  22. */
  23. team_context: Record<string, any>;
  24. /**
  25. * 应用节点信息
  26. */
  27. details?: IDetail[];
  28. /**
  29. * 是否已收藏
  30. */
  31. is_collected: string;
  32. /**
  33. * 是否已发布
  34. */
  35. updated_at: string;
  36. hot_value: number;
  37. owner_name?: string;
  38. owner_avatar_url?: string;
  39. published?: string;
  40. param_need: ParamNeed[];
  41. recommend_questions?: Record<string, any>[];
  42. conv_uid?: string;
  43. };
  44. export type IAppData = {
  45. app_list: IApp[];
  46. current_page: number;
  47. total_count: number;
  48. total_page: number;
  49. };
  50. // agent
  51. export type AgentParams = {
  52. agent_name: string;
  53. node_id: string;
  54. /**
  55. * Agent绑定的资源
  56. */
  57. resources: string;
  58. /**
  59. * Agent的绑定模板
  60. */
  61. prompt_template: string;
  62. /**
  63. * llm的使用策略,默认是priority
  64. */
  65. llm_strategy: string;
  66. /**
  67. * 策略包含的参数
  68. */
  69. llm_strategy_value: string;
  70. };
  71. export type IAgent = {
  72. describe?: string;
  73. name: string;
  74. system_message?: string;
  75. label?: string;
  76. desc?: string;
  77. };
  78. export type ITeamModal = {
  79. auto_plan: string;
  80. awel_layout: string;
  81. singe_agent: string;
  82. };
  83. export type IResource = {
  84. is_dynamic?: boolean;
  85. name?: string;
  86. type?: string;
  87. value?: string;
  88. };
  89. export type IDetail = {
  90. agent_name?: string;
  91. app_code?: string;
  92. llm_strategy?: string;
  93. llm_strategy_value?: string;
  94. resources?: IResource[];
  95. key?: string;
  96. prompt_template?: string;
  97. recommend_questions?: string[];
  98. };
  99. export interface GetAppInfoParams {
  100. chat_scene: string;
  101. app_code: string;
  102. }
  103. export interface TeamMode {
  104. name: string;
  105. value: string;
  106. name_cn: string;
  107. name_en: string;
  108. description: string;
  109. description_en: string;
  110. remark: string;
  111. }
  112. export interface CreateAppParams {
  113. app_describe?: string;
  114. app_name?: string;
  115. team_mode?: string;
  116. app_code?: string;
  117. details?: IDetail[];
  118. language?: 'zh' | 'en';
  119. recommend_questions?: [];
  120. team_context?: Record<string, any>;
  121. param_need?: ParamNeed[];
  122. }
  123. export interface AppListResponse {
  124. total_count: number;
  125. app_list: IApp[];
  126. current_page: number;
  127. total_page: number;
  128. }
  129. // eslint-disable-next-line @typescript-eslint/no-empty-object-type
  130. export interface StrategyResponse extends Omit<TeamMode, 'remark'> {}
  131. export interface ParamNeed {
  132. type: string;
  133. value: any;
  134. bind_value?: string;
  135. }
  136. export interface NativeAppScenesResponse {
  137. chat_scene: string;
  138. scene_name: string;
  139. param_need: ParamNeed[];
  140. }