MCPcopy
hub / github.com/danielmiessler/Fabric / Backend

Interface Backend

internal/plugins/ai/azureaigateway/azureaigateway.go:36–55  ·  view source on GitHub ↗

Backend defines the interface that all Azure AI Gateway backends must implement. Each backend only provides what is unique to its API format. The shared HTTP mechanics (request execution, error handling, streaming fallback) are handled by the Client.

Source from the content-addressed store, hash-verified

34// The shared HTTP mechanics (request execution, error handling, streaming fallback)
35// are handled by the Client.
36type Backend interface {
37 // ListModels returns the list of models available for this backend
38 ListModels(context.Context) ([]string, error)
39
40 // BuildEndpoint constructs the full API endpoint URL for the given model
41 BuildEndpoint(baseURL, model string) string
42
43 // AuthHeader returns the header name and value for authentication.
44 // Each APIM backend uses a different auth header:
45 // Bedrock: "Authorization", "Bearer <key>"
46 // Azure OpenAI: "api-key", "<key>"
47 // Vertex AI: "x-goog-api-key", "<key>"
48 AuthHeader() (name, value string)
49
50 // PrepareRequest prepares the HTTP request body for this backend's API format
51 PrepareRequest(msgs []*chat.ChatCompletionMessage, opts *domain.ChatOptions) ([]byte, error)
52
53 // ParseResponse parses the HTTP response body into text content
54 ParseResponse(body []byte) (string, error)
55}
56
57// Client implements the Azure AI Gateway vendor for Fabric.
58// It supports multiple backends (Bedrock, Azure OpenAI, Vertex AI) through

Callers 8

ListModelsMethod · 0.65
ListModelsMethod · 0.65
ListModelsMethod · 0.65
SendMethod · 0.65
SendMethod · 0.65
SendMethod · 0.65
SendMethod · 0.65

Implementers 3

BedrockBackendinternal/plugins/ai/azureaigateway/bac
VertexAIBackendinternal/plugins/ai/azureaigateway/bac
AzureOpenAIBackendinternal/plugins/ai/azureaigateway/bac

Calls

no outgoing calls

Tested by

no test coverage detected