@@ -109,7 +109,7 @@ export default function AddNewEmbeddingModal() {
109109 function changePlatformOrGranularity ( ) {
110110 prepareSuggestions ( ) ;
111111 const savePlatform = platform . platform ;
112- if ( savePlatform == PlatformType . COHERE || savePlatform == PlatformType . OPEN_AI || savePlatform == PlatformType . AZURE ) {
112+ if ( savePlatform == PlatformType . OPEN_AI || savePlatform == PlatformType . AZURE ) {
113113 setGranularity ( GRANULARITY_TYPES_ARRAY . find ( ( g ) => g . value == EmbeddingType . ON_ATTRIBUTE ) ) ;
114114 if ( savePlatform == PlatformType . AZURE ) {
115115 const azureUrls = localStorage . getItem ( 'azureUrls' ) ;
@@ -137,7 +137,7 @@ export default function AddNewEmbeddingModal() {
137137
138138 function checkIfPlatformHasToken ( ) {
139139 if ( ! platform ) return ;
140- if ( platform . name == platformNamesDict [ PlatformType . COHERE ] || platform . name == platformNamesDict [ PlatformType . OPEN_AI ] || platform . name == platformNamesDict [ PlatformType . AZURE ] ) {
140+ if ( platform . name == platformNamesDict [ PlatformType . OPEN_AI ] || platform . name == platformNamesDict [ PlatformType . AZURE ] ) {
141141 setGranularityArray ( GRANULARITY_TYPES_ARRAY . filter ( ( g ) => g . value != EmbeddingType . ON_TOKEN ) ) ;
142142 } else {
143143 setGranularityArray ( GRANULARITY_TYPES_ARRAY ) ;
@@ -179,13 +179,11 @@ export default function AddNewEmbeddingModal() {
179179 filterAttributes : filteredAttributes
180180 }
181181
182- if ( platform . name == platformNamesDict [ PlatformType . HUGGING_FACE ] || platform . name == platformNamesDict [ PlatformType . PYTHON ] ) {
182+ if ( platform . name == platformNamesDict [ PlatformType . HUGGING_FACE ] ) {
183183 config . model = model ;
184184 } else if ( platform . name == platformNamesDict [ PlatformType . OPEN_AI ] ) {
185185 config . model = model ;
186186 config . apiToken = apiToken ;
187- } else if ( platform . name == platformNamesDict [ PlatformType . COHERE ] ) {
188- config . apiToken = apiToken ;
189187 } else if ( platform . name == platformNamesDict [ PlatformType . AZURE ] ) {
190188 config . model = engine ; //note that is handled internally as model so we use the model field for the request
191189 config . apiToken = apiToken ;
@@ -251,15 +249,6 @@ export default function AddNewEmbeddingModal() {
251249 < input placeholder = "Enter your API token" onChange = { ( e ) => setApiToken ( e . target . value ) } value = { apiToken }
252250 className = "h-9 w-full text-sm border-gray-300 rounded-md placeholder-italic border text-gray-900 pl-4 placeholder:text-gray-400 focus:outline-none focus:ring-2 focus:ring-gray-300 focus:ring-offset-2 focus:ring-offset-gray-100" />
253251 </ > }
254- { platform && platform . name == platformNamesDict [ PlatformType . COHERE ] && < >
255- < Tooltip content = { TOOLTIPS_DICT . PROJECT_SETTINGS . EMBEDDINGS . API_TOKEN } placement = "right" color = "invert" >
256- < span className = "card-title mb-0 label-text flex" > < span className = "cursor-help underline filtersUnderline" > API token</ span > </ span >
257- </ Tooltip >
258- < input placeholder = "Enter your API token" onChange = { ( e ) => setApiToken ( e . target . value ) } value = { apiToken }
259- className = "h-9 w-full text-sm border-gray-300 rounded-md placeholder-italic border text-gray-900 pl-4 placeholder:text-gray-400 focus:outline-none focus:ring-2 focus:ring-gray-300 focus:ring-offset-2 focus:ring-offset-gray-100" />
260- </ > }
261- { platform && platform . name == platformNamesDict [ PlatformType . PYTHON ] && < SuggestionsModel options = { embeddingHandles [ targetAttribute ] } selectedOption = { ( option : string ) => setModel ( option ) } /> }
262-
263252 { platform && platform . name == platformNamesDict [ PlatformType . AZURE ] && < >
264253 < Tooltip content = { TOOLTIPS_DICT . PROJECT_SETTINGS . EMBEDDINGS . API_TOKEN } placement = "right" color = "invert" >
265254 < span className = "card-title mb-0 label-text flex" > < span className = "cursor-help underline filtersUnderline" > API token</ span > </ span >
@@ -302,11 +291,10 @@ export default function AddNewEmbeddingModal() {
302291 </ > }
303292 </ > }
304293 </ div >
305- { platform && ( platform . name == platformNamesDict [ PlatformType . COHERE ] || platform . name == platformNamesDict [ PlatformType . OPEN_AI ] || platform . name == platformNamesDict [ PlatformType . AZURE ] ) && < div className = "text-center mt-3" >
294+ { platform && ( platform . name == platformNamesDict [ PlatformType . OPEN_AI ] || platform . name == platformNamesDict [ PlatformType . AZURE ] ) && < div className = "text-center mt-3" >
306295 < div className = "border border-gray-300 text-xs text-gray-500 p-2.5 rounded-lg text-justify" >
307296 < label ref = { gdprText } className = "text-gray-700" >
308297 { selectedPlatform . splitTerms [ 0 ] }
309- { platform . name == platformNamesDict [ PlatformType . COHERE ] && < a href = { selectedPlatform . link } target = "_blank" className = "underline" > cohere terms of service.</ a > }
310298 { platform . name == platformNamesDict [ PlatformType . OPEN_AI ] && < a href = { selectedPlatform . link } target = "_blank" className = "underline" > openai terms of service.</ a > }
311299 { platform . name == platformNamesDict [ PlatformType . AZURE ] && < a href = { selectedPlatform . link } target = "_blank" className = "underline" > azure terms of service.</ a > }
312300 < div > { selectedPlatform . splitTerms [ 1 ] } </ div >
0 commit comments