Skip to content

Commit

Permalink
Merge branch 'main' into fix/monster-chat-completions
Browse files Browse the repository at this point in the history
  • Loading branch information
VisargD authored Aug 31, 2024
2 parents 4d1ebf3 + f94419b commit bbb368c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/providers/cohere/chatComplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const CohereChatCompleteConfig: ProviderConfig = {

return prompt.content
?.filter((_msg) => _msg.type === 'text')
.map((_msg) => _msg.text);
.reduce((acc, _msg) => acc + _msg.text, '');
},
},
{
Expand All @@ -44,7 +44,7 @@ export const CohereChatCompleteConfig: ProviderConfig = {
0,
messages.length - 1
);
// generate history and forware it to model
// generate history and forward it to model
const history: { message?: string; role: string }[] =
messagesWithoutLastMessage.map((message) => {
const _message: { role: any; message: string } = {
Expand Down Expand Up @@ -164,7 +164,7 @@ export const CohereChatCompleteResponseTransform: (
{
message: { role: 'assistant', content: response.text },
index: 0,
finish_reason: 'length',
finish_reason: response.finish_reason,
},
],
usage: {
Expand Down

0 comments on commit bbb368c

Please sign in to comment.