Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when executing "sudo go run ." #30

Open
vicmac-github opened this issue Feb 18, 2024 · 1 comment
Open

Error when executing "sudo go run ." #30

vicmac-github opened this issue Feb 18, 2024 · 1 comment

Comments

@vicmac-github
Copy link

github.com/sashabaranov/go-openai

/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/chat_stream.go:31:22: error: expected ‘;’ or ‘}’ or newline
31 | *streamReader[ChatCompletionStreamResponse]
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/chat_stream.go:63:74: error: expected ‘,’ or ‘}’
63 | streamReader: &streamReader[ChatCompletionStreamResponse]{
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream.go:15:22: error: expected ‘;’ or ‘}’ or newline
15 | *streamReader[CompletionResponse]
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream.go:52:64: error: expected ‘,’ or ‘}’
52 | streamReader: &streamReader[CompletionResponse]{
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:12:9: error: expected signature or type name
12 | ChatCompletionStreamResponse | CompletionResponse
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:15:21: error: expected ‘]’
15 | type streamReader[T streamable] struct {
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:17:9: error: expected declaration
17 | isFinished bool
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:19:9: error: expected declaration
19 | reader *bufio.Reader
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:20:9: error: expected declaration
20 | response *http.Response
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:21:9: error: expected declaration
21 | errAccumulator errorAccumulator
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:22:9: error: expected declaration
22 | unmarshaler unmarshaler
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:23:1: error: expected declaration
23 | }
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:25:27: error: expected ‘)’
25 | func (stream *streamReader[T]) Recv() (response T, err error) {
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:25:27: error: expected function name
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:25:27: error: expected ‘;’ or newline after top level declaration
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:28:17: error: expected declaration
28 | return
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:29:9: error: expected declaration
29 | }
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:33:1: error: expected declaration
33 | waitForData:
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:35:9: error: expected declaration
35 | if err != nil {
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:37:17: error: expected declaration
37 | if respErr != nil {
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:39:17: error: expected declaration
39 | }
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:40:17: error: expected declaration
40 | return
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:41:9: error: expected declaration
41 | }
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:44:9: error: expected declaration
44 | line = bytes.TrimSpace(line)
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:45:9: error: expected declaration
45 | if !bytes.HasPrefix(line, headerData) {
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:46:67: error: expected declaration
46 | if writeErr := stream.errAccumulator.write(line); writeErr != nil {
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:48:25: error: expected declaration
48 | return
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:49:17: error: expected declaration
49 | }
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:50:17: error: expected declaration
50 | emptyMessagesCount++
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:51:17: error: expected declaration
51 | if emptyMessagesCount > stream.emptyMessagesLimit {
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:53:25: error: expected declaration
53 | return
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:54:17: error: expected declaration
54 | }
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:56:17: error: expected declaration
56 | goto waitForData
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:57:9: error: expected declaration
57 | }
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:59:9: error: expected declaration
59 | line = bytes.TrimPrefix(line, headerData)
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:60:9: error: expected declaration
60 | if string(line) == "[DONE]" {
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:62:17: error: expected declaration
62 | err = io.EOF
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:63:17: error: expected declaration
63 | return
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:64:9: error: expected declaration
64 | }
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:66:9: error: expected declaration
66 | err = stream.unmarshaler.unmarshal(line, &response)
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:67:9: error: expected declaration
67 | return
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:68:1: error: expected declaration
68 | }
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:70:27: error: expected ‘)’
70 | func (stream *streamReader[T]) Close() {
| ^
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:70:27: error: expected function name
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:70:27: error: expected ‘;’ or newline after top level declaration
/root/go/pkg/mod/github.com/sashabaranov/go-openai@v1.9.4/stream_reader.go:72:1: error: expected declaration
72 | }
| ^

@Mxlan2711
Copy link

Same here. Any News on this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants