Added Global Policy and Agent Code Snippet support#10
Merged
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…licy' into AddingGlobalAgentPolicy
Contributor
There was a problem hiding this comment.
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 --- |
There was a problem hiding this comment.
[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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.