Niansuh commited on
Commit
8b28257
·
verified ·
1 Parent(s): d67ffc1

Update api/utils.py

Browse files
Files changed (1) hide show
  1. api/utils.py +1 -3
api/utils.py CHANGED
@@ -3,7 +3,6 @@ import json
3
  import uuid
4
  import asyncio
5
  import random
6
- import string
7
  from typing import Any, Dict, Optional
8
 
9
  import httpx
@@ -16,7 +15,6 @@ from api.config import (
16
  AGENT_MODE,
17
  TRENDING_AGENT_MODE,
18
  MODEL_PREFIXES,
19
- MODEL_REFERERS,
20
  )
21
  from api.models import ChatRequest
22
  from api.logger import setup_logger
@@ -144,8 +142,8 @@ async def process_streaming_response(request: ChatRequest):
144
  continue # Skip if buffer is empty after removal
145
 
146
  # Process the buffer to yield content
 
147
  while buffer:
148
- # Decide on a suitable chunk size or yield the entire buffer
149
  content_to_yield = buffer
150
  buffer = ""
151
  # Remove the prefix if present
 
3
  import uuid
4
  import asyncio
5
  import random
 
6
  from typing import Any, Dict, Optional
7
 
8
  import httpx
 
15
  AGENT_MODE,
16
  TRENDING_AGENT_MODE,
17
  MODEL_PREFIXES,
 
18
  )
19
  from api.models import ChatRequest
20
  from api.logger import setup_logger
 
142
  continue # Skip if buffer is empty after removal
143
 
144
  # Process the buffer to yield content
145
+ # Decide on a suitable chunk size or yield the entire buffer
146
  while buffer:
 
147
  content_to_yield = buffer
148
  buffer = ""
149
  # Remove the prefix if present