Skip to content

Commit 010dfc9

Browse files
committed
remove stream_text
1 parent 66f5739 commit 010dfc9

3 files changed

Lines changed: 3 additions & 39 deletions

File tree

README.md

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,7 @@ if response.tool_calls:
7373

7474
### Streaming
7575

76-
#### Simple Text Streaming
77-
78-
The simplest way to stream text responses:
79-
80-
```python
81-
for text in edgee.stream_text(model="gpt-4o", input="Tell me a story"):
82-
print(text, end="", flush=True)
83-
```
84-
85-
#### Streaming with More Control
86-
87-
Access chunk properties when you need more control:
76+
Access chunk properties for streaming:
8877

8978
```python
9079
for chunk in edgee.stream(model="gpt-4o", input="Tell me a story"):

edgee/__init__.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -305,20 +305,3 @@ def stream(
305305
Yields StreamChunk objects as they arrive from the API.
306306
"""
307307
return self.send(model=model, input=input, stream=True)
308-
309-
def stream_text(
310-
self,
311-
model: str,
312-
input: str | InputObject | dict,
313-
):
314-
"""Stream only the text content from the completion.
315-
316-
Convenience method that yields only non-empty text strings,
317-
filtering out chunks without content.
318-
319-
Yields:
320-
str: Text content from each chunk
321-
"""
322-
for chunk in self.stream(model=model, input=input):
323-
if chunk.text:
324-
yield chunk.text

example/test.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,8 @@
6363
print(f"Tool calls: {response3.tool_calls}")
6464
print()
6565

66-
# Test 4: Streaming (simplest way)
67-
print("Test 4: Streaming (simplest way)")
68-
for text in edgee.stream_text(
69-
model="mistral/mistral-small-latest", input="Tell me a short story about a robot"
70-
):
71-
print(text, end="", flush=True)
72-
print("\n")
73-
74-
# Test 5: Streaming with more control
75-
print("Test 5: Streaming with more control")
66+
# Test 4: Streaming
67+
print("Test 4: Streaming")
7668
for chunk in edgee.stream(model="mistral/mistral-small-latest", input="What is Python?"):
7769
if chunk.text:
7870
print(chunk.text, end="", flush=True)

0 commit comments

Comments
 (0)