chat.d.ts 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. declare namespace CHAT {
  2. interface DIALOG_PARAMS {
  3. 'name': string,
  4. 'icon': string,
  5. 'language': string,
  6. 'prompt_config': {
  7. 'empty_response': string,
  8. 'prologue': string,
  9. 'quote': boolean,
  10. 'keyword':boolean,
  11. 'tts':boolean,
  12. 'system':string
  13. 'refine_multiturn':boolean,
  14. 'use_kg':boolean,
  15. 'reasoning':boolean,
  16. 'parameters': {'key':string, 'optional':boolean }[]
  17. 'llm_id':string
  18. 'llm_setting': {
  19. 'temperature': number,
  20. 'top_p': number
  21. 'presence_penalty':number
  22. 'frequency_penalty':number
  23. },
  24. 'similarity_threshold': number
  25. 'vector_similarity_weight': number
  26. 'top_n': number
  27. }
  28. }
  29. interface DIALOG {
  30. id: string
  31. name: string
  32. description: string
  33. }
  34. interface DELTA {
  35. 'content': string,
  36. 'role': string,
  37. 'function_call': null,
  38. 'tool_calls': null
  39. }
  40. interface INFO {
  41. 'id': string,
  42. 'choices': {
  43. 'delta': DELTA,
  44. 'finish_reason': null,
  45. 'index': number,
  46. 'logprobs': null
  47. }[],
  48. 'created': string,
  49. 'model': 'model',
  50. 'object': string,
  51. 'system_fingerprint': string,
  52. 'usage': null
  53. }
  54. interface CONVERSATION_PARAMS {
  55. 'dialog_id'?: string,
  56. 'name': string,
  57. 'is_new': boolean,
  58. 'conversation_id': string,
  59. 'message'?: {'role': string, 'content': string}[]
  60. }
  61. interface CONVERSATION {
  62. 'dialog_id'?: string,
  63. 'name': string,
  64. 'create_time': number
  65. 'is_new': boolean,
  66. 'conversation_id': string,
  67. 'message'?: {'role': string, 'content': string}[]
  68. }
  69. }