File size: 444 Bytes
931bd01
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package duckgo

type ApiRequest struct {
	Model    string     `json:"model"`
	Messages []messages `json:"messages"`
}
type messages struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

func (a *ApiRequest) AddMessage(role string, content string) {
	a.Messages = append(a.Messages, messages{
		Role:    role,
		Content: content,
	})
}

func NewApiRequest(model string) ApiRequest {
	return ApiRequest{
		Model: model,
	}
}