Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update assistants to use streaming API #873

Merged
merged 14 commits into from
Mar 20, 2024
Merged

Update assistants to use streaming API #873

merged 14 commits into from
Mar 20, 2024

Conversation

jlowin
Copy link
Member

@jlowin jlowin commented Mar 18, 2024

Updates assistants to use the streaming API. Nearly no user-facing impact, but much better UX especially because we can stream outputs live to the terminal:

import marvin
from marvin.beta.assistants import CodeInterpreter

def add(a, b):
    return a + b

# a = marvin.beta.assistants.Assistant(tools=[CodeInterpreter])
a = marvin.beta.assistants.Assistant(tools=[add, CodeInterpreter])

a.say('add one and two using the add tool, then use the interpreter to subtract a random number from it')
image

@jlowin jlowin marked this pull request as ready for review March 20, 2024 01:53
src/marvin/beta/assistants/assistants.py Outdated Show resolved Hide resolved
src/marvin/beta/assistants/assistants.py Outdated Show resolved Hide resolved
@jlowin jlowin merged commit 7257289 into main Mar 20, 2024
13 of 15 checks passed
@jlowin jlowin deleted the streaming branch March 20, 2024 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants