8000 Add verbose to reAct operation by ohdearquant · Pull Request #540 · khive-ai/lionagi · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add verbose to reAct operation #540

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

Merged
merged 8 commits into from
Jan 21, 2025
Merged

Add verbose to reAct operation #540

merged 8 commits into from
Jan 21, 2025

Conversation

ohdearquant
Copy link
Collaborator
@ohdearquant ohdearquant commented Jan 21, 2025

PR Description

Summary
This PR introduces a verbose option for our ReAct operation, allowing developers to see detailed chain-of-thought logs and debug information at each expansion round. Key highlights include:

  1. Verbose ReAct Flow

    • Added a verbose parameter in the ReAct function to print each round’s analysis.
    • Enhanced output includes the analysis (analysis field), planned actions, and final decision on whether another round is needed.
  2. Action Logging

    • Each tool invocation (function call) now logs invocation success/failure along with status messages.
    • A verbose_action flag in the operate/act routines to control detailed logs around tool usage.
  3. Batch and Strategy Improvements

    • Introduced a action_strategy field and optional action_batch_size in the ReAct schema to allow the LLM to specify how it wants actions to run (concurrent, sequential, batch).
  4. Documentation & Code Cleanup

    • Updated docstrings to reflect the new parameters.
    • Minor refactors in branch.py and operate.py for clarity.

Why This Is Useful

  • With verbose logging, developers can observe each intermediate step the LLM is taking, making debugging and fine-tuning simpler.
  • The new strategy fields give more control to the LLM about how it sequences or batches multiple actions in a single round.

Testing

  • Verified locally using react.ipynb notebook with sample PDF reading + search tools.
  • Confirmed the output matches expectations and includes chain-of-thought logs when verbose_analysis=True.

Impact

  • This is fully backward-compatible.
  • Merges seamlessly with the existing ReAct flow in lionagi.

@ohdearquant ohdearquant merged commit ab0dfab into main Jan 21, 2025
5 checks passed
@ohdearquant ohdearquant deleted the add-verbose branch January 21, 2025 01:41
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.

1 participant
0