MCPcopy Create free account
hub / github.com/github/gh-aw / GetGeminiAPITarget

Function GetGeminiAPITarget

pkg/workflow/engine_api_targets.go:250–266  ·  view source on GitHub ↗

GetGeminiAPITarget returns the effective Gemini API target hostname for the LLM gateway proxy. Deprecated: Use GetAntigravityAPITarget for new Antigravity engine workflows. This function is retained for backward compatibility with existing Gemini engine workflows. Resolution order: 1. GEMINI_API_BA

(workflowData *WorkflowData, engineName string)

Source from the content-addressed store, hash-verified

248//
249// Returns empty string if the engine is not Gemini and no custom GEMINI_API_BASE_URL is configured.
250func GetGeminiAPITarget(workflowData *WorkflowData, engineName string) string {
251 awfHelpersLog.Printf("Getting Gemini API target for engine: %s", engineName)
252 // Check for custom GEMINI_API_BASE_URL in engine.env
253 if customTarget := extractAPITargetHost(workflowData, "GEMINI_API_BASE_URL"); customTarget != "" {
254 awfHelpersLog.Printf("Using custom Gemini API target from GEMINI_API_BASE_URL: %s", customTarget)
255 return customTarget
256 }
257
258 // Default to the standard Gemini API endpoint when engine is Gemini
259 if engineName == "gemini" {
260 awfHelpersLog.Printf("Using default Gemini API target: %s", DefaultGeminiAPITarget)
261 return DefaultGeminiAPITarget
262 }
263
264 awfHelpersLog.Print("No Gemini API target configured (engine is not gemini and no custom URL)")
265 return ""
266}
267
268// getEngineAPIHosts returns the primary AI inference API hostnames for the given engine and
269// workflow data. These are the hosts that appear in the firewall audit log when the engine

Callers 3

BuildAWFConfigJSONFunction · 0.85
TestGetGeminiAPITargetFunction · 0.85

Calls 3

extractAPITargetHostFunction · 0.85
PrintMethod · 0.80
PrintfMethod · 0.45

Tested by 1

TestGetGeminiAPITargetFunction · 0.68