-
Notifications
You must be signed in to change notification settings - Fork 33
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
Add stream output for Agent #833
Labels
enhancement
New feature or request
Comments
Undertone0809
added a commit
that referenced
this issue
Aug 3, 2024
Related to #833 Add stream mode output to ToolAgent. * Modify `promptulate/agents/tool_agent/agent.py` to add a `stream` parameter to the `run` method and implement logic to handle streaming output. * Update `example/agent/tool_agent_usage.py` to demonstrate the usage of `agent.run(..., stream=True)`. * Add tests in `tests/agents/test_tool_agent.py` to verify the stream mode output functionality. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/Undertone0809/promptulate/issues/833?shareId=XXXX-XXXX-XXXX-XXXX).
ToolAgent + stream mode need to support output schema, but output schema only use in final output now. Need to raise error if stream=True and output_schema is not True. |
Undertone0809
added a commit
that referenced
this issue
Aug 3, 2024
Related to #833 Add stream output support for ToolAgent. * **ToolAgent Class**: - Add `stream` parameter to the `run` method. - Implement logic to handle the `stream` parameter. - Modify the `_run` method to support streaming output. - Raise error if `stream=True` and `output_schema` is not provided. * **BaseAgent Class**: - Add `stream` parameter to the `run` method. - Implement `_run_stream` method to handle streaming output. * **Example**: - Update `example/agent/tool_agent_usage.py` to demonstrate the usage of `agent.run(..., stream=True)`. * **Tests**: - Add tests in `tests/agents/test_tool_agent.py` to verify the stream mode output functionality. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/Undertone0809/promptulate/issues/833?shareId=XXXX-XXXX-XXXX-XXXX).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🚀 Feature Request
Current, ToolAgent cannot use stream mode output. As a ReAct prompt pattern, the intermediate thought steps need to be output. Now we use hooks system to extract middle step, but agent.run(..., stream=True) is simpler.
How to do?
Add stream parameter, use agent.run(..., stream=True).
Reference: https://github.com/InternLM/MindSearch/blob/main/mindsearch/agent/mindsearch_agent.py#L196
The text was updated successfully, but these errors were encountered: