File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ func (ps *PromptSession) Run(ctx context.Context) {
183183 ourContent := ""
184184 for _ , c := range choice .Content .Parts {
185185 if c .Text != "" {
186- ourContent += c .Text
186+ ourContent += fixUnsupportedCharacters ( c .Text )
187187 }
188188 if c .FunctionCall != nil {
189189 fc := * c .FunctionCall
@@ -383,6 +383,11 @@ func (ps *PromptSession) Run(ctx context.Context) {
383383 _ = ps .conn .Close (websocket .StatusNormalClosure , "" )
384384}
385385
386+ func fixUnsupportedCharacters (s string ) string {
387+ // Replace the narrow non-breaking space with a regular non-breaking space.
388+ return strings .ReplaceAll (s , "\u202f " , "\u00a0 " )
389+ }
390+
386391func (ps * PromptSession ) storeThread (ctx context.Context , messages []* genai.Content ) error {
387392 ctx , span := beeline .StartSpan (ctx , "store_thread" )
388393 defer span .Send ()
You can’t perform that action at this time.
0 commit comments