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

Function aiProvidersHandler

coderd/ai_providers.go:31–42  ·  view source on GitHub ↗

aiProvidersHandler registers the CRUD HTTP routes for runtime AI provider configuration at /api/v2/ai/providers.

(api *API, middlewares ...func(http.Handler) http.Handler)

Source from the content-addressed store, hash-verified

29// aiProvidersHandler registers the CRUD HTTP routes for runtime AI
30// provider configuration at /api/v2/ai/providers.
31func aiProvidersHandler(api *API, middlewares ...func(http.Handler) http.Handler) func(r chi.Router) {
32 return func(r chi.Router) {
33 r.Use(middlewares...)
34 r.Get("/", api.aiProvidersList)
35 r.Post("/", api.aiProvidersCreate)
36 r.Route("/{idOrName}", func(r chi.Router) {
37 r.Get("/", api.aiProvidersGet)
38 r.Patch("/", api.aiProvidersUpdate)
39 r.Delete("/", api.aiProvidersDelete)
40 })
41 }
42}
43
44// @Summary List AI providers
45// @ID list-ai-providers

Callers 1

NewFunction · 0.85

Calls 2

GetMethod · 0.65
DeleteMethod · 0.65

Tested by

no test coverage detected