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

Method ListChatProviders

codersdk/chats.go:2096–2108  ·  view source on GitHub ↗

ListChatProviders returns admin-managed chat provider configs.

(ctx context.Context)

Source from the content-addressed store, hash-verified

2094
2095// ListChatProviders returns admin-managed chat provider configs.
2096func (c *ExperimentalClient) ListChatProviders(ctx context.Context) ([]ChatProviderConfig, error) {
2097 res, err := c.Request(ctx, http.MethodGet, "/api/experimental/chats/providers", nil)
2098 if err != nil {
2099 return nil, err
2100 }
2101 defer res.Body.Close()
2102 if res.StatusCode != http.StatusOK {
2103 return nil, ReadBodyAsError(res)
2104 }
2105
2106 var providers []ChatProviderConfig
2107 return providers, json.NewDecoder(res.Body).Decode(&providers)
2108}
2109
2110// CreateChatProvider creates an admin-managed chat provider config.
2111func (c *ExperimentalClient) CreateChatProvider(ctx context.Context, req CreateChatProviderConfigRequest) (ChatProviderConfig, error) {

Callers 3

TestListChatProvidersFunction · 0.95
TestCreateChatProviderFunction · 0.80
ensureScaletestProviderFunction · 0.80

Calls 3

ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65
RequestMethod · 0.45

Tested by 2

TestListChatProvidersFunction · 0.76
TestCreateChatProviderFunction · 0.64