MCPcopy Index your code
hub / github.com/coder/coder / ListUserChatProviderConfigs

Method ListUserChatProviderConfigs

codersdk/chats.go:2199–2210  ·  view source on GitHub ↗

ListUserChatProviderConfigs returns user-scoped chat provider configs.

(ctx context.Context)

Source from the content-addressed store, hash-verified

2197
2198// ListUserChatProviderConfigs returns user-scoped chat provider configs.
2199func (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.
2213func (c *ExperimentalClient) UpsertUserChatProviderKey(ctx context.Context, providerID uuid.UUID, req CreateUserChatProviderKeyRequest) (UserChatProviderConfig, error) {

Callers 2

TestCreateChatProviderFunction · 0.80

Calls 4

ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65
RequestMethod · 0.45
ErrorfMethod · 0.45

Tested by 2

TestCreateChatProviderFunction · 0.64