add
This commit is contained in:
@@ -184,7 +184,10 @@ class Anthropic(Platform):
|
||||
async with self.http.post(endpoint, headers=headers, data=json.dumps(req_body)) as response:
|
||||
if response.status != 200:
|
||||
raise ValueError(f"Error: {await response.text()}")
|
||||
async for line_bytes in response.content.iter_lines():
|
||||
while True:
|
||||
line_bytes = await response.content.readline()
|
||||
if not line_bytes:
|
||||
break
|
||||
line = line_bytes.decode("utf-8").strip()
|
||||
if not line.startswith("data: "):
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user