ListUserChatProviderConfigs returns user-scoped chat provider configs.
(ctx context.Context)
| 2197 | |
| 2198 | // ListUserChatProviderConfigs returns user-scoped chat provider configs. |
| 2199 | func (c *ExperimentalClient) ListUserChatProviderConfigs(ctx context.Context) ([]UserChatProviderConfig, error) { |
| 2200 | res, err := c.Request(ctx, http.MethodGet, "/api/experimental/chats/user-provider-configs", nil) |
| 2201 | if err != nil { |
| 2202 | return nil, xerrors.Errorf("list user chat provider configs: %w", err) |
| 2203 | } |
| 2204 | defer res.Body.Close() |
| 2205 | if res.StatusCode != http.StatusOK { |
| 2206 | return nil, ReadBodyAsError(res) |
| 2207 | } |
| 2208 | var configs []UserChatProviderConfig |
| 2209 | return configs, json.NewDecoder(res.Body).Decode(&configs) |
| 2210 | } |
| 2211 | |
| 2212 | // UpsertUserChatProviderKey creates or replaces a user API key for a provider. |
| 2213 | func (c *ExperimentalClient) UpsertUserChatProviderKey(ctx context.Context, providerID uuid.UUID, req CreateUserChatProviderKeyRequest) (UserChatProviderConfig, error) { |