wip /api/chat

This commit is contained in:
Jeffrey Morgan
2023-10-01 14:54:17 -07:00
parent 0a4f21c0a7
commit 949fc4eafa
3 changed files with 113 additions and 0 deletions

View File

@@ -31,6 +31,22 @@ func (e StatusError) Error() string {
}
}
// /api/chat
type Message struct {
Role string `json:"role"`
Content string `json:"content"`
}
type ChatRequest struct {
Model string `json:"model"`
Messages []Message `json:"messages"`
}
type ChatResponse struct {
CreatedAt time.Time `json:"created_at"`
Message Message `json:"message"`
}
type GenerateRequest struct {
Model string `json:"model"`
Prompt string `json:"prompt"`