Skip to content

Commit

Permalink
#61: Update Cohere chat response mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrueger12 committed Jan 5, 2024
1 parent 650833c commit 8026dfd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/providers/cohere/chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,19 +177,19 @@ func (c *Client) doChatRequest(ctx context.Context, payload *ChatRequest) (*sche

// Map response to UnifiedChatResponse schema
response := schemas.UnifiedChatResponse{
ID: cohereCompletion.GenerationID,
Created: int(time.Now().UTC().Unix()),
ID: cohereCompletion.ResponseID,
Created: int(time.Now().UTC().Unix()), // Cohere doesn't provide this
Provider: providerName,
Router: "chat", // TODO: this will be the router used
Model: "command-light", // TODO: this needs to come from config or router
Model: "command-light", // TODO: this needs to come from config or router as Cohere doesn't provide this
Cached: false,
ModelResponse: schemas.ProviderResponse{
ResponseID: map[string]string{
"generationId": cohereCompletion.GenerationID,
"responseId": cohereCompletion.ResponseID,
},
Message: schemas.ChatMessage{
Role: "assistant", // TODO: this needs to come from input message?
Role: "model", // TODO: Does this need to change?
Content: cohereCompletion.Text,
Name: "",
},
Expand Down

0 comments on commit 8026dfd

Please sign in to comment.