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

Method ListChatModelConfigs

codersdk/chats.go:2240–2252  ·  view source on GitHub ↗

ListChatModelConfigs returns admin-managed chat model configs.

(ctx context.Context)

Source from the content-addressed store, hash-verified

2238
2239// ListChatModelConfigs returns admin-managed chat model configs.
2240func (c *ExperimentalClient) ListChatModelConfigs(ctx context.Context) ([]ChatModelConfig, error) {
2241 res, err := c.Request(ctx, http.MethodGet, "/api/experimental/chats/model-configs", nil)
2242 if err != nil {
2243 return nil, err
2244 }
2245 defer res.Body.Close()
2246 if res.StatusCode != http.StatusOK {
2247 return nil, ReadBodyAsError(res)
2248 }
2249
2250 var configs []ChatModelConfig
2251 return configs, json.NewDecoder(res.Body).Decode(&configs)
2252}
2253
2254// CreateChatModelConfig creates an admin-managed chat model config.
2255func (c *ExperimentalClient) CreateChatModelConfig(ctx context.Context, req CreateChatModelConfigRequest) (ChatModelConfig, error) {

Callers 6

TestListChatModelConfigsFunction · 0.95

Calls 3

ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65
RequestMethod · 0.45

Tested by 5

TestListChatModelConfigsFunction · 0.76