wwf
2 天以前 a430284aa21e3ae1f0d5654e55b2ad2852519cc2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import type { Resolution, TransferMethod, TtsAutoPlay } from '@/types/app'
import type { FileUploadConfigResponse } from '@/models/common'
 
export type EnabledOrDisabled = {
  enabled?: boolean
}
 
export type MoreLikeThis = EnabledOrDisabled
 
export type OpeningStatement = EnabledOrDisabled & {
  opening_statement?: string
  suggested_questions?: string[]
}
 
export type SuggestedQuestionsAfterAnswer = EnabledOrDisabled
 
export type TextToSpeech = EnabledOrDisabled & {
  language?: string
  voice?: string
  autoPlay?: TtsAutoPlay
}
 
export type SpeechToText = EnabledOrDisabled
 
export type RetrieverResource = EnabledOrDisabled
 
export type SensitiveWordAvoidance = EnabledOrDisabled & {
  type?: string
  config?: any
}
 
export type FileUpload = {
  image?: EnabledOrDisabled & {
    detail?: Resolution
    number_limits?: number
    transfer_methods?: TransferMethod[]
  }
  allowed_file_types?: string[]
  allowed_file_extensions?: string[]
  allowed_file_upload_methods?: TransferMethod[]
  number_limits?: number
  fileUploadConfig?: FileUploadConfigResponse
} & EnabledOrDisabled
 
export type AnnotationReplyConfig = {
  enabled: boolean
  id?: string
  score_threshold?: number
  embedding_model?: {
    embedding_provider_name: string
    embedding_model_name: string
  }
}
 
export enum FeatureEnum {
  moreLikeThis = 'moreLikeThis',
  opening = 'opening',
  suggested = 'suggested',
  text2speech = 'text2speech',
  speech2text = 'speech2text',
  citation = 'citation',
  moderation = 'moderation',
  file = 'file',
  annotationReply = 'annotationReply',
}
 
export type Features = {
  [FeatureEnum.moreLikeThis]?: MoreLikeThis
  [FeatureEnum.opening]?: OpeningStatement
  [FeatureEnum.suggested]?: SuggestedQuestionsAfterAnswer
  [FeatureEnum.text2speech]?: TextToSpeech
  [FeatureEnum.speech2text]?: SpeechToText
  [FeatureEnum.citation]?: RetrieverResource
  [FeatureEnum.moderation]?: SensitiveWordAvoidance
  [FeatureEnum.file]?: FileUpload
  [FeatureEnum.annotationReply]?: AnnotationReplyConfig
}
 
export type OnFeaturesChange = (features?: Features) => void