-
Notifications
You must be signed in to change notification settings - Fork 0
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
[pull] main from ag2ai:main #61
Conversation
* [Bug Fix] Tool signature error for Anthropic #1091 * tests added * updated tests to reflect test coverage * pre-commit checks --------- Co-authored-by: Davor Runje <[email protected]>
* Enable code execution in reasoning agent 1. enable code execution 2. remove the "verbose" parameter, and replace with AG2's default "silent" parameter. * init _user_proxy * notebook update * notebook update * add test case for running code in reasoning agent * use mock credential for reasoning test * reasoning prompt update * mock credentials for more tests * Update .secrets.baseline * clear notebook outputs * remove variable F
Found 1 changed notebook. Review the changes at https://app.gitnotebooks.com/Stars1233/ag2/pull/61 |
🚨 gitStream Monthly Automation Limit Reached 🚨 Your organization has exceeded the number of pull requests allowed for automation with gitStream. To continue automating your PR workflows and unlock additional features, please contact LinearB. |
Reviewer's Guide by SourceryThis pull request introduces several enhancements to the ReasoningAgent, including code execution during reasoning, deprecation of the verbose parameter, and new examples in the notebook. It also updates the Anthropic client to correctly convert tool definitions. Sequence diagram for code execution during reasoningsequenceDiagram
participant ReasoningAgent
participant UserProxyAgent
participant ThinkerAgent
ReasoningAgent->>ThinkerAgent: _expand(node)
ThinkerAgent-->>ReasoningAgent: Returns options with code
alt code execution enabled
ReasoningAgent->>UserProxyAgent: send(code)
UserProxyAgent->>UserProxyAgent: Execute code
UserProxyAgent-->>ReasoningAgent: Returns code execution result
ReasoningAgent->>ThinkerAgent: node.content += result
end
Updated class diagram for ReasoningAgentclassDiagram
class ReasoningAgent {
- _verbose: bool
- _llm_config: dict
- _grader_llm_config: dict
- _reason_config: dict
- _root: ThinkNode
- _thinker: AssistantAgent
- _grader: AssistantAgent
+ __init__(
name: str,
llm_config: dict[str, Any],
grader_llm_config: Optional[dict[str, Any]] = None,
max_depth: int = 4,
beam_size: int = 3,
answer_approach: str = "pool",
reason_config: Optional[dict[str, Any]] = None,
**kwargs: Any
) : None
+ generate_forest_response(
messages: Optional[List[Dict]] = None,
sender: Optional[Agent] = None,
config: Optional[Dict] = None
) : Tuple[bool, Union[str, Dict, None]]
+ rate_node(node: ThinkNode, ground_truth: str = None, is_outcome: bool = False) : float
- _beam_reply(prompt: str, ground_truth: str = "") : str
- _mtcs_reply(prompt: str, ground_truth: str = "") : str
- _expand(node: ThinkNode) : list
- _is_terminal(node: ThinkNode) : bool
}
class AssistantAgent
class ThinkNode
ReasoningAgent -- AssistantAgent : has _thinker
ReasoningAgent -- AssistantAgent : has _grader
ReasoningAgent -- ThinkNode : has _root
note for ReasoningAgent "verbose parameter deprecated, use silent instead"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAttention: Patch coverage is
|
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.1)
Can you help keep this open source service alive? 💖 Please sponsor : )
Summary by Sourcery
This pull request enhances the ReasoningAgent with code execution capabilities and the ability to use a separate model for grading. It also includes updates to the Anthropic client for better tool handling and a new test case for code execution.
New Features:
grader_llm_config
argument when initializing theReasoningAgent
.Enhancements:
code_execution_config
is not given.Tests: