MCPcopy Index your code
hub / github.com/github/copilot-sdk / Add

Method Add

go/rpc/zrpc.go:16378–16397  ·  view source on GitHub ↗

Adds BYOK providers and/or models to the session's registry at runtime, extending the additive registry built from the session's `providers`/`models` options. Both fields are optional, so a call may add providers only, models only, or both. Within a single call providers are registered before models

(ctx context.Context, params *ProviderAddRequest)

Source from the content-addressed store, hash-verified

16376//
16377// Returns: The selectable model entries synthesized for the models added by this call.
16378func (a *ProviderAPI) Add(ctx context.Context, params *ProviderAddRequest) (*ProviderAddResult, error) {
16379 req := map[string]any{"sessionId": a.sessionID}
16380 if params != nil {
16381 if params.Models != nil {
16382 req["models"] = params.Models
16383 }
16384 if params.Providers != nil {
16385 req["providers"] = params.Providers
16386 }
16387 }
16388 raw, err := a.client.Request(ctx, "session.provider.add", req)
16389 if err != nil {
16390 return nil, err
16391 }
16392 var result ProviderAddResult
16393 if err := json.Unmarshal(raw, &result); err != nil {
16394 return nil, err
16395 }
16396 return &result, nil
16397}
16398
16399// GetEndpoint returns the provider endpoint and credentials the session is currently
16400// configured to talk to, so the caller can make inference calls directly against the same

Callers 15

TestSession_OnFunction · 0.45
waitForCapabilityFunction · 0.45
TestClient_StartStopRaceFunction · 0.45
buildHTTPRequestFunction · 0.45
dialHeadersMethod · 0.45
StartMethod · 0.45
waitForFileFunction · 0.45
waitForFileContentFunction · 0.45
TestPermissionsE2EFunction · 0.45
waitForFileTextFunction · 0.45
waitForFleetCompletionFunction · 0.45

Calls 1

RequestMethod · 0.45

Tested by 15

TestSession_OnFunction · 0.36
waitForCapabilityFunction · 0.36
TestClient_StartStopRaceFunction · 0.36
waitForFileFunction · 0.36
waitForFileContentFunction · 0.36
TestPermissionsE2EFunction · 0.36
waitForFileTextFunction · 0.36
waitForFleetCompletionFunction · 0.36
waitForEventsByTypeFunction · 0.36
waitForRPCConditionFunction · 0.36
TestRpcServerPluginsFunction · 0.36