Skip to content

Commit 0279432

Browse files
removed unused post_stream() method
1 parent 96cc693 commit 0279432

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

minds/rest_api.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -60,29 +60,6 @@ def post(self, url, data={}):
6060
_raise_for_status(resp)
6161
return resp
6262

63-
def post_stream(self, url, data={}):
64-
"""Makes a POST request and yields chunks as they arrive (OpenAI-style streaming)."""
65-
with requests.post(
66-
self.base_url + url,
67-
headers=self._headers(),
68-
json=data,
69-
stream=True,
70-
) as resp:
71-
_raise_for_status(resp)
72-
for line in resp.iter_lines():
73-
if not line:
74-
continue
75-
decoded = line.decode("utf-8")
76-
if decoded.startswith("data: "):
77-
payload = decoded[len("data: "):]
78-
if payload.strip() == "[DONE]":
79-
break
80-
try:
81-
obj = json.loads(payload)
82-
yield obj
83-
except json.JSONDecodeError:
84-
yield {"error": f"Failed to parse: {decoded}"}
85-
8663
def put(self, url, data={}):
8764
resp = requests.put(
8865
self.base_url + url,

0 commit comments

Comments
 (0)