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)
| 16376 | // |
| 16377 | // Returns: The selectable model entries synthesized for the models added by this call. |
| 16378 | func (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 |