MCPcopy Create free account
hub / github.com/InferCore/InferCore / actionPath

Method actionPath

internal/adapters/gemini/gemini.go:102–111  ·  view source on GitHub ↗

actionPath returns URL path for generateContent / streamGenerateContent (Vertex vs AI Studio).

(model, action string)

Source from the content-addressed store, hash-verified

100
101// actionPath returns URL path for generateContent / streamGenerateContent (Vertex vs AI Studio).
102func (a *Adapter) actionPath(model, action string) string {
103 model = strings.TrimPrefix(model, "models/")
104 model = strings.TrimSpace(model)
105 if a.vertex {
106 proj := strings.TrimSpace(a.cfg.VertexProject)
107 loc := strings.TrimSpace(a.cfg.VertexLocation)
108 return fmt.Sprintf("/v1/projects/%s/locations/%s/publishers/google/models/%s:%s", proj, loc, model, action)
109 }
110 return fmt.Sprintf("/v1beta/models/%s:%s", model, action)
111}
112
113func (a *Adapter) Invoke(ctx context.Context, req types.BackendRequest) (types.BackendResponse, error) {
114 text, _ := req.Input["text"].(string)

Callers 2

invokeNonStreamMethod · 0.95
invokeStreamMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected