Closed
Description
Hi there,
I cant believe I'm the first to ask this.....
but how can we hook into the text stream?
I'm building a UI for open-interpreter,
and I want to display the text stream in my UI, how do i access the text before it is printed?
Also I wish to send it to Elevenlabs Text2Voice (which supports streaming now)
Any help getting the live text will be helpfull
Thanks a lot and all the best!
Reproduce
- Add function hook, to interpreter, that will recieve all the text the interpreter genererates
interpreter.chat(user_msg, text_stream_hook=myFunc)
Expected behavior
Text stream should be sent to myFunc
Screenshots
No response
Open Interpreter version
0.1.4
Python version
3.11.5
Operating System name and version
Windows 10
Additional context
I would love the hook to exist, but i'll also take where i need to intercept in the code as an answer for now... since i can continue from there...
Activity
fire17 commentedon Sep 18, 2023
I got elevenlabs to play the final output :)
but i need help getting to all the rest of the output
anyone?
MrJarnould commentedon Sep 18, 2023
@fire17 This seems more like a "Feature request – Suggest an idea for this project" than a "Bug – Create a report to help us improve". Perhaps you'll receive more interest from the community if you label this issue as such and follow the Feature request issue template.
fire17 commentedon Sep 18, 2023
@MrJarnould I've marked it as bug since this text should be treated as first class citizen
And be fully accessible from interpreter object
So either it's available and should be better documented or it's a missing piece and not so much of a feature.
Got any suggestions ?
EDIT: I would have prefered choosing a "question" tag, even tried a blank non-templated issue, and tried removing the bug tag..
but i dont understand why you guys are focusing on the label rather than my actual question
anyhow.. i've manage to add streaming support to open-interpreter, please let me know if i should open a pr (in these kinds of projects it's sometimes better to ask)
TheApeMachine commentedon Sep 19, 2023
"a missing piece" also known as a "feature"? First-class citizen notwithstanding, things can only be a bug if they were a feature first right? Or in another way, things have to exist before they can be broken.
[-]How to hook into the Text Stream + ELEVENLABS ! ! ! !!!!!!!!!! [/-][+]How to hook into the Text Stream[/+]fire17 commentedon Sep 22, 2023
Well.... you guys let me know if you want a PR for streaming the text out
Meanwhile, sneak peak

All the best :)
🞉
ericrallen commentedon Oct 10, 2023
Hey there, @fire17!
There are some docs about how to programmatically handle streaming responses from Open Interpreter.
ericrallen commentedon Oct 12, 2023
Going to close this for now due to the requested functionality being documented now.
Feel free to reopen if there’s still an Issue.