File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
9079for chunk in edgee.stream(model = " gpt-4o" , input = " Tell me a story" ):
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 6363print (f"Tool calls: { response3 .tool_calls } " )
6464print ()
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" )
7668for chunk in edgee .stream (model = "mistral/mistral-small-latest" , input = "What is Python?" ):
7769 if chunk .text :
7870 print (chunk .text , end = "" , flush = True )
You can’t perform that action at this time.
0 commit comments