-
Notifications
You must be signed in to change notification settings - Fork 8
Added Global Policy and Agent Code Snippet support #10
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
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…licy' into AddingGlobalAgentPolicy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for a global policy and code sample integration across the agent system, enhances the interactive agent setup workflow, updates JSON blueprints, and introduces a new code‐sample loader.
- Extended
AgentSystemandAgentto load and include a global policy and per-agent code samples - Enhanced
create_agent_system.pyfor global policy definition and interactive code sample assignment - Added
load_adata.pycode sample and updated JSON blueprints withglobal_policyandcode_samples - Injected code samples into prompts in both interactive and automated testers
- Minor cleanup in tester scripts (removed unused imports, fixed typos)
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| benchmarking/prompt_testing/MultiAgentTester.py | Updated prompt building to include global policy and inject code samples on delegation |
| benchmarking/prompt_testing/MultiAgentAutoTester.py | Removed unused imports, fixed prompt typo, and injected global policy and code samples |
| benchmarking/code_samples/load_adata.py | New script for loading AnnData objects as code samples |
| benchmarking/agents/system_blueprint.json | Added global_policy and code_samples fields |
| benchmarking/agents/integration_system.json | Added global_policy |
| benchmarking/agents/create_agent_system.py | Added global policy step, code sample assignment, and updated save to include global policy |
| benchmarking/agents/AgentSystem.py | Extended to read and include global policy and code samples, updated prompts/instructions |
Comments suppressed due to low confidence (2)
benchmarking/prompt_testing/MultiAgentAutoTester.py:81
- The code references
datetime.utcnow()but thedatetimeclass is no longer imported in this file. Addfrom datetime import datetimeto the imports to avoid a NameError.
timestamp = datetime.utcnow().strftime("%Y%m%d-%H%M%S")
benchmarking/prompt_testing/MultiAgentAutoTester.py:109
- This line calls
json.dumpsbutjsonis no longer imported. Please reintroduceimport jsonat the top of the file.
fh.write(json.dumps(record) + "\n")
| console.print(f"[yellow]🔄 Routing to '{tgt}' via {cmd}") | ||
| history.append({"role": "assistant", "content": f"🔄 Routing to **{tgt}** (command `{cmd}`)"}) | ||
|
|
||
| # INJECT LOADED CODE SAMPLES ON DELEGATION --- |
Copilot
AI
Jul 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The code-sample injection logic is duplicated in both MultiAgentTester.py and MultiAgentAutoTester.py. Consider extracting this into a shared helper to reduce duplication and ease future updates.
This pull request introduces enhancements to the agent system for better functionality, including support for global policies, code sample integration, and improved configuration workflows. The changes span multiple files, focusing on extending the
AgentSystemclass, updating JSON blueprints, and enhancing the interactive agent creation process.Agent System Enhancements:
benchmarking/agents/AgentSystem.py: Added support for loading a global policy and associating agents with code samples. TheAgentclass now includes acode_samplesattribute, and theget_full_promptmethod was updated to include code sample details. TheAgentSystemclass was modified to load code samples from disk and include the global policy in its representation. [1] [2] [3]Interactive Agent Creation Improvements:
benchmarking/agents/create_agent_system.py: Introduced a global policy definition step and the ability to assign code samples to agents interactively. Added new methods likeassign_code_samplesand updated thesave_configurationfunction to include the global policy. [1] [2] [3] [4] [5]JSON Configuration Updates:
benchmarking/agents/integration_system.jsonandbenchmarking/agents/system_blueprint.json: Added aglobal_policyfield and updated agents to include acode_samplesfield where applicable. [1] [2] [3]Code Sample Integration:
benchmarking/code_samples/load_adata.py: Added a new Python script for loading AnnData objects, which can now be assigned to agents as a code sample.Minor Cleanup:
benchmarking/prompt_testing/MultiAgentAutoTester.py: Removed unused imports for cleaner code.