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 streaming processing python #194

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

brnaba-aws
Copy link
Contributor

@brnaba-aws brnaba-aws commented Jan 6, 2025

Issue number:
Adding full streaming support for python.

Summary

Full streaming in python using yield

Changes

route_requesthas now a new parameter, stream_response to either get the Agent's response in chunks (streaming) rather than passing by Callbacks.

async def route_request(self,
                       user_input: str,
                       user_id: str,
                       session_id: str,
                       additional_params: dict[str, str] = {},
                       stream_response: bool | None = False  # wether to stream back the response from the agent
) -> AgentResponse:
        """Route user request to appropriate agent."""

User experience

Please share what the user experience looks like before and after this change

Checklist

If your change doesn't seem to apply, please leave them unchecked.

  • I have performed a self-review of this change
  • Changes have been tested
  • Changes are documented
Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@brnaba-aws brnaba-aws requested a review from cornelcroi January 6, 2025 16:05
@hghandri
Copy link
Contributor

hghandri commented Jan 6, 2025

Hi,

do you mean with this approach we don't anymore to use callback agent through "on_llm_new_token" ?

@brnaba-aws
Copy link
Contributor Author

It might still be needed in some cases. Also, we want to be backward compatible so we would keep it.

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.

2 participants