ListChatProviders returns admin-managed chat provider configs.
(ctx context.Context)
| 2094 | |
| 2095 | // ListChatProviders returns admin-managed chat provider configs. |
| 2096 | func (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. |
| 2111 | func (c *ExperimentalClient) CreateChatProvider(ctx context.Context, req CreateChatProviderConfigRequest) (ChatProviderConfig, error) { |