ff
This commit is contained in:
+4
-8
@@ -20,6 +20,7 @@ func NewClient(token string) *Client {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c Client) Completions(prompt string) (*CompletionResponse, error) {
|
func (c Client) Completions(prompt string) (*CompletionResponse, error) {
|
||||||
|
fmt.Println("prompting: ", prompt)
|
||||||
body := &CompletionPayload{
|
body := &CompletionPayload{
|
||||||
Model: "gpt-3.5-turbo",
|
Model: "gpt-3.5-turbo",
|
||||||
Prompt: cleanPrompt(prompt),
|
Prompt: cleanPrompt(prompt),
|
||||||
@@ -85,12 +86,7 @@ type CompletionUsage struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type CompletionChoice struct {
|
type CompletionChoice struct {
|
||||||
Message CompletionMessage `json:"message"`
|
Text string `json:"text"`
|
||||||
FinishReason string `json:"finish_reason"`
|
FinishReason string `json:"finish_reason"`
|
||||||
Index int `json:"index"`
|
Index int `json:"index"`
|
||||||
}
|
|
||||||
|
|
||||||
type CompletionMessage struct {
|
|
||||||
Role string `json:"role"`
|
|
||||||
Content string `json:"content"`
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user