Elysiadev11 commited on
Commit
e0778bc
·
verified ·
1 Parent(s): 52f717e

Fix syntax error: replace multi-line f-strings with variables in stream_anthropic

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -282,14 +282,15 @@ async def stream_anthropic(ollama_stream, original_model: str):
282
 
283
  if content:
284
  # Send text_delta
285
- yield f"data: {json.dumps({
286
  'type': 'content_block_delta',
287
  'index': 0,
288
  'delta': {
289
  'type': 'text_delta',
290
  'text': content
291
  }
292
- })}\n\n"
 
293
  except json.JSONDecodeError:
294
  continue
295
 
 
282
 
283
  if content:
284
  # Send text_delta
285
+ content_block_delta_data = {
286
  'type': 'content_block_delta',
287
  'index': 0,
288
  'delta': {
289
  'type': 'text_delta',
290
  'text': content
291
  }
292
+ }
293
+ yield f"data: {json.dumps(content_block_delta_data)}\n\n"
294
  except json.JSONDecodeError:
295
  continue
296