-
Notifications
You must be signed in to change notification settings - Fork 3.2k
feat(vertex): added vertex to list of supported providers #2430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR adds Vertex AI as a new supported provider for accessing Google's Gemini models through Google Cloud Platform's Vertex AI service. The implementation is substantial but well-structured, following established patterns from the existing Google provider while adding GCP-specific authentication and endpoint configuration. Key Changes:
Architecture: Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant API as API Route
participant Provider as Vertex Provider
participant Utils as Vertex Utils
participant Google as Google Utils
participant Vertex as Vertex AI API
participant Tools as Tool Executor
User->>API: POST /api/providers (vertex request)
API->>API: Extract vertexProject, vertexLocation
API->>Provider: executeRequest(request)
Provider->>Provider: Validate vertexProject & apiKey
Provider->>Google: convertToGeminiFormat(request)
Google-->>Provider: contents, tools, systemInstruction
Provider->>Google: cleanSchemaForGemini(schema)
Google-->>Provider: cleaned schema
Provider->>Utils: buildVertexEndpoint(project, location, model, streaming)
Utils-->>Provider: endpoint URL
Provider->>Vertex: POST endpoint (payload with tools)
Vertex-->>Provider: response with function call
alt Has Function Call
loop Until no more tool calls (max 20 iterations)
Provider->>Google: extractFunctionCall(candidate)
Google-->>Provider: functionCall
Provider->>Tools: executeTool(functionCall)
Tools-->>Provider: tool result
Provider->>Vertex: POST with tool result
Vertex-->>Provider: next response
end
end
alt Streaming Response
Provider->>Utils: createReadableStreamFromVertexStream(response)
Utils->>Google: extractTextContent(candidate)
Google-->>Utils: text content
Utils-->>Provider: ReadableStream
Provider-->>API: StreamingExecution
else Non-Streaming Response
Provider->>Google: extractTextContent(candidate)
Google-->>Provider: content
Provider-->>API: ProviderResponse
end
API-->>User: Response with content & metadata
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
30 files reviewed, 4 comments
… dynamic verbosity and reasoning fetcher
Summary
Type of Change
Testing
Tested manually
Checklist