@@ -24,18 +24,18 @@ package main
24
24
import (
25
25
" context"
26
26
" fmt"
27
- gogpt " github.com/sashabaranov/go-openai"
27
+ openai " github.com/sashabaranov/go-openai"
28
28
)
29
29
30
30
func main () {
31
- client := gogpt .NewClient (" your token" )
31
+ client := openai .NewClient (" your token" )
32
32
resp , err := c.CreateChatCompletion (
33
33
context.Background (),
34
- gogpt .ChatCompletionRequest {
35
- Model: gogpt .GPT3Dot5Turbo ,
36
- Messages: []gogpt .ChatCompletionMessage {
34
+ openai .ChatCompletionRequest {
35
+ Model: openai .GPT3Dot5Turbo ,
36
+ Messages: []openai .ChatCompletionMessage {
37
37
{
38
- Role: " user " ,
38
+ Role: openai. ChatMessageRoleUser ,
39
39
Content: " Hello!" ,
40
40
},
41
41
},
@@ -64,15 +64,15 @@ package main
64
64
import (
65
65
" context"
66
66
" fmt"
67
- gogpt " github.com/sashabaranov/go-openai"
67
+ openai " github.com/sashabaranov/go-openai"
68
68
)
69
69
70
70
func main () {
71
- c := gogpt .NewClient (" your token" )
71
+ c := openai .NewClient (" your token" )
72
72
ctx := context.Background ()
73
73
74
- req := gogpt .CompletionRequest {
75
- Model: gogpt .GPT3Ada ,
74
+ req := openai .CompletionRequest {
75
+ Model: openai .GPT3Ada ,
76
76
MaxTokens: 5 ,
77
77
Prompt: " Lorem ipsum" ,
78
78
}
@@ -96,15 +96,15 @@ import (
96
96
" context"
97
97
" fmt"
98
98
" io"
99
- gogpt " github.com/sashabaranov/go-openai"
99
+ openai " github.com/sashabaranov/go-openai"
100
100
)
101
101
102
102
func main () {
103
- c := gogpt .NewClient (" your token" )
103
+ c := openai .NewClient (" your token" )
104
104
ctx := context.Background ()
105
105
106
- req := gogpt .CompletionRequest {
107
- Model: gogpt .GPT3Ada ,
106
+ req := openai .CompletionRequest {
107
+ Model: openai .GPT3Ada ,
108
108
MaxTokens: 5 ,
109
109
Prompt: " Lorem ipsum" ,
110
110
Stream: true ,
@@ -146,15 +146,15 @@ import (
146
146
" context"
147
147
" fmt"
148
148
" io"
149
- gogpt " github.com/sashabaranov/go-openai"
149
+ openai " github.com/sashabaranov/go-openai"
150
150
)
151
151
152
152
func main () {
153
- c := gogpt .NewClient (" your token" )
153
+ c := openai .NewClient (" your token" )
154
154
ctx := context.Background ()
155
155
156
- req := gogpt .CompletionRequest {
157
- Model: gogpt .GPT3Ada ,
156
+ req := openai .CompletionRequest {
157
+ Model: openai .GPT3Ada ,
158
158
MaxTokens: 5 ,
159
159
Prompt: " Lorem ipsum" ,
160
160
Stream: true ,
0 commit comments