MCPcopy Index your code
hub / github.com/danielmiessler/Fabric / configureOpenAIResponsesAPI

Function configureOpenAIResponsesAPI

internal/cli/cli.go:188–203  ·  view source on GitHub ↗

configureOpenAIResponsesAPI configures the OpenAI client's Responses API setting based on the CLI flag

(registry *core.PluginRegistry, disableResponsesAPI bool)

Source from the content-addressed store, hash-verified

186
187// configureOpenAIResponsesAPI configures the OpenAI client's Responses API setting based on the CLI flag
188func configureOpenAIResponsesAPI(registry *core.PluginRegistry, disableResponsesAPI bool) {
189 // Find the OpenAI vendor in the registry
190 if registry != nil && registry.VendorsAll != nil {
191 for _, vendor := range registry.VendorsAll.Vendors {
192 if vendor.GetName() == "OpenAI" {
193 // Type assertion to access the OpenAI-specific method
194 if openaiClient, ok := vendor.(*openai.Client); ok {
195 // Invert the disable flag to get the enable flag
196 enableResponsesAPI := !disableResponsesAPI
197 openaiClient.SetResponsesAPIEnabled(enableResponsesAPI)
198 }
199 break
200 }
201 }
202 }
203}

Callers 1

CliFunction · 0.85

Calls 2

GetNameMethod · 0.65

Tested by

no test coverage detected