fix: broken cohere API response transform
This commit is contained in:
parent
c6e1bb55f9
commit
4820218a11
@ -113,6 +113,8 @@ export default class JanInferenceCohereExtension extends RemoteOAIEngine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
transformResponse = (data: any) => {
|
transformResponse = (data: any) => {
|
||||||
return typeof data === 'object' ? data.text : JSON.parse(data).text ?? ''
|
return typeof data === 'object'
|
||||||
|
? data.text
|
||||||
|
: (JSON.parse(data.replace('data: ', '').trim()).text ?? '')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user