We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Is your feature request related to a problem? Please describe.
This should work:
@streaming_action(reads=["prompt"], writes=['response']) def streaming_response(state: State) -> Generator[dict, None, tuple[dict, State]]: response = client.chat.completions.create( model='gpt-3.5-turbo', messages=[{ 'role': 'user', 'content': state["prompt"] }], temperature=0, ) buffer = [] for chunk in response: delta = chunk.choices[0].delta.content buffer.append(delta) # yield partial results yield {'response': delta} full_response = ''.join(buffer) # return the final result return {'response': full_response}, state.update(response=full_response)
Instead the yield needs to be {"response": delta}, None
{"response": delta}, None
Describe the solution you'd like If it's not the last yield, we should just yield the result, no need to specify None for the state update.
None
Tasks:
burr/burr/core/application.py
Line 253 in f883885
Describe alternatives you've considered Not doing it
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Is your feature request related to a problem? Please describe.
This should work:
Instead the yield needs to be
{"response": delta}, None
Describe the solution you'd like
If it's not the last yield, we should just yield the result, no need to specify
None
for the state update.Tasks:
burr/burr/core/application.py
Line 253 in f883885
Describe alternatives you've considered
Not doing it
The text was updated successfully, but these errors were encountered: