You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

interface.ts 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import { FormInstance } from 'antd';
  2. import { Node } from 'reactflow';
  3. export interface DSLComponentList {
  4. id: string;
  5. name: string;
  6. }
  7. export interface IOperatorForm {
  8. onValuesChange?(changedValues: any, values: any): void;
  9. form?: FormInstance;
  10. node?: Node<NodeData>;
  11. nodeId?: string;
  12. }
  13. export interface IBeginForm {
  14. prologue?: string;
  15. }
  16. export interface IRetrievalForm {
  17. similarity_threshold?: number;
  18. keywords_similarity_weight?: number;
  19. top_n?: number;
  20. top_k?: number;
  21. rerank_id?: string;
  22. empty_response?: string;
  23. kb_ids: string[];
  24. }
  25. export interface IGenerateForm {
  26. max_tokens?: number;
  27. temperature?: number;
  28. top_p?: number;
  29. presence_penalty?: number;
  30. frequency_penalty?: number;
  31. cite?: boolean;
  32. prompt: number;
  33. llm_id: string;
  34. parameters: { key: string; component_id: string };
  35. }
  36. export interface ICategorizeItem {
  37. name: string;
  38. description?: string;
  39. examples?: string;
  40. to?: string;
  41. }
  42. export type ICategorizeItemResult = Record<
  43. string,
  44. Omit<ICategorizeItem, 'name'>
  45. >;
  46. export interface ICategorizeForm extends IGenerateForm {
  47. category_description: ICategorizeItemResult;
  48. }
  49. export interface IRelevantForm extends IGenerateForm {
  50. yes: string;
  51. no: string;
  52. }
  53. export type NodeData = {
  54. label: string; // operator type
  55. name: string; // operator name
  56. color: string;
  57. form: IBeginForm | IRetrievalForm | IGenerateForm | ICategorizeForm;
  58. };