mirror of
https://github.com/mudler/LocalAI.git
synced 2025-06-30 06:30:43 +00:00
big progress checkin. Still quite broken, but now it shows the new direction. Time to start hooking things up again.
This commit is contained in:
parent
20a0cd2f66
commit
f9133b5a61
12 changed files with 228 additions and 364 deletions
17
openai-openapi/chi-interface.tmpl
Normal file
17
openai-openapi/chi-interface.tmpl
Normal file
|
@ -0,0 +1,17 @@
|
|||
// ServerInterface represents all server handlers.
|
||||
type ServerInterface interface {
|
||||
{{range .}}{{.SummaryAsComment }}
|
||||
// ({{.Method}} {{.Path}})
|
||||
{{.OperationId}}(w http.ResponseWriter, r *http.Request{{genParamArgs .PathParams}}{{if .RequiresParamObject}}, params {{.OperationId}}Params{{end}})
|
||||
{{end}}
|
||||
}
|
||||
|
||||
// TypedServerInterface is used to give each endpoint a fully typed method signature for cases where we're able to route automatically
|
||||
type TypedServerInterface interface {
|
||||
{{range .}}{{.SummaryAsComment }}
|
||||
// ({{.Method}} {{.Path}})
|
||||
{{$reqBody := genDefaultRequestBodyType . -}}
|
||||
{{- if ne $reqBody "" }}{{$reqBody = printf ", body %s" $reqBody}}{{end -}}
|
||||
{{.OperationId}}(w http.ResponseWriter{{genParamArgs .PathParams}}{{if .RequiresParamObject}}, params {{.OperationId}}Params{{end}}{{$reqBody}})
|
||||
{{end}}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue