(reader io.Reader)
| 91 | } |
| 92 | |
| 93 | func processSSEStream(reader io.Reader) error { |
| 94 | scanner := bufio.NewScanner(reader) |
| 95 | |
| 96 | fmt.Println("SSE Stream:") |
| 97 | fmt.Println("---") |
| 98 | |
| 99 | for scanner.Scan() { |
| 100 | line := scanner.Text() |
| 101 | fmt.Println(line) |
| 102 | } |
| 103 | |
| 104 | if err := scanner.Err(); err != nil { |
| 105 | return fmt.Errorf("error reading stream: %v", err) |
| 106 | } |
| 107 | |
| 108 | return nil |
| 109 | } |
| 110 | |
| 111 | func printUsage() { |
| 112 | fmt.Println("Usage: go run main-testopenai.go [--model <model>] [--tools] [message]") |
no test coverage detected