Skip to content

Commit

Permalink
Merge branch 'feat/vertexai-provider' of https://github.com/yomorun/yomo
Browse files Browse the repository at this point in the history
 into feat/vertexai-provider
  • Loading branch information
woorui committed Dec 14, 2024
2 parents 90e3d98 + 97ffe98 commit 262f08d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions example/10-ai/zipper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,9 @@ bridge:
xai:
api_key:
model:

vertexai:
project_id:
location:
model:
credentials_file:
2 changes: 1 addition & 1 deletion pkg/bridge/ai/provider/vertexai/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func NewProvider(projectID, location, model, credentialsFile string) *Provider {
log.Fatal("new vertexai client: ", err)
}
if model == "" {
model = "gemini-1.5-pro-latest"
model = "gemini-1.5-pro-002"
}

return &Provider{
Expand Down
4 changes: 2 additions & 2 deletions pkg/bridge/ai/provider/vertexai/response_convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func convertToResponse(in *genai.GenerateContentResponse, model string) (out ope
Index: int(index),
Message: openai.ChatCompletionMessage{
Content: string(pp),
Role: openai.ChatMessageRoleUser,
Role: openai.ChatMessageRoleAssistant,
},
FinishReason: toOpenAIFinishReason(candidate.FinishReason),
})
Expand Down Expand Up @@ -95,7 +95,7 @@ func convertToStreamResponse(id string, in *genai.GenerateContentResponse, model
Index: index,
Delta: openai.ChatCompletionStreamChoiceDelta{
Content: string(pp),
Role: openai.ChatMessageRoleUser,
Role: openai.ChatMessageRoleAssistant,
},
FinishReason: toOpenAIFinishReason(candidate.FinishReason),
})
Expand Down

0 comments on commit 262f08d

Please sign in to comment.