Ver código fonte

Merge branch 'feature/compapi'

* feature/compapi:
  适配 go 官方 sdk
boweniac 1 mês atrás
pai
commit
5bd51b17cf
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      internal/utils/compapi/func.go

+ 1 - 1
internal/utils/compapi/func.go

@@ -91,7 +91,7 @@ func DoChatCompletionsStream(ctx context.Context, client *openai.Client, chatInf
 	defer chatStream.Close()
 	for chatStream.Next() {
 		chunk := chatStream.Current()
-		fmt.Fprintf(hw, "event:%s\ndata:%s\n\n", chunk.Event, chunk.Data.RAW)
+		fmt.Fprintf(hw, "data:%s\n\n", chunk.Data.RAW)
 		flusher.Flush()
 		//time.Sleep(1 * time.Millisecond)
 	}