feat(swagger): Add swagger API doc (#1926)

* makefile(build): add minimal and api build target

* feat(swagger): Add swagger
This commit is contained in:
Ettore Di Giacinto 2024-03-29 22:29:33 +01:00 committed by GitHub
parent ab2f403dd0
commit 123a5a2e16
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 2264 additions and 25 deletions

View file

@ -20,6 +20,11 @@ import (
"github.com/valyala/fasthttp"
)
// ChatEndpoint is the OpenAI Completion API endpoint https://platform.openai.com/docs/api-reference/chat/create
// @Summary Generate a chat completions for a given prompt and model.
// @Param request body schema.OpenAIRequest true "query params"
// @Success 200 {object} schema.OpenAIResponse "Response"
// @Router /v1/chat/completions [post]
func ChatEndpoint(cl *config.BackendConfigLoader, ml *model.ModelLoader, startupOptions *config.ApplicationConfig) func(c *fiber.Ctx) error {
emptyMessage := ""
id := uuid.New().String()