File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77
88 "cloud.google.com/go/vertexai/genai"
99 "google.golang.org/api/option"
10+ "google.golang.org/grpc"
1011)
1112
1213// Options is a set of options for GoogleAI and Vertex clients.
@@ -90,6 +91,24 @@ func WithRest() Option {
9091 }
9192}
9293
94+ // WithGRPCClient append a ClientOption that uses the provided gRPC client to
95+ // make requests.
96+ // This is useful for gemini clients.
97+ func WithGRPCClient (grpcClient * grpc.ClientConn ) Option {
98+ return func (opts * Options ) {
99+ opts .ClientOptions = append (opts .ClientOptions , option .WithGRPCConn (grpcClient ))
100+ }
101+ }
102+
103+ // WithEndpoint append a ClientOption that uses the provided endpoint to
104+ // make requests.
105+ // This is useful for gemini clients.
106+ func WithEndpoint (endpoint string ) Option {
107+ return func (opts * Options ) {
108+ opts .ClientOptions = append (opts .ClientOptions , option .WithEndpoint (endpoint ))
109+ }
110+ }
111+
93112// WithHTTPClient append a ClientOption that uses the provided HTTP client to
94113// make requests.
95114// This is useful for vertex clients.
You can’t perform that action at this time.
0 commit comments