File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change 11package main
22
33func main () {
4-
4+ MongoRestClient ()
55}
Original file line number Diff line number Diff line change @@ -250,12 +250,8 @@ func (s *RestStreamCallback) OnReferences(r ReferencesMsg) {
250250 s .f .Flush ()
251251}
252252
253- // FIXME: ai doesn't parse the output quite nicely with escape chars and whatnot
254253func escapeJSON (s string ) string {
255- //if !strings.Contains(s, " ") {
256- // //fmt.Println("contains", s)
257- // return s
258- //}
254+ s = strings .ReplaceAll (s , "\\ n" , "\n " )
259255 b , _ := json .Marshal (s )
260256 return string (b [1 : len (b )- 1 ])
261257}
@@ -305,6 +301,7 @@ func MongoRestClient() {
305301 log .Fatal (err )
306302 }
307303}
304+
308305func cHandler (c * gin.Context ) {
309306 var req OpenaiRequest
310307 flusher , ok := c .Writer .(http.Flusher )
You can’t perform that action at this time.
0 commit comments