Skip to content
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 a sanity test for load_app_config and get_agent_config_arg #6723

Merged
merged 1 commit into from
Feb 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions tests/unit/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
finalize_config,
get_agent_config_arg,
get_llm_config_arg,
load_app_config,
load_from_env,
load_from_toml,
)
Expand Down Expand Up @@ -811,3 +812,29 @@ def test_get_agent_config_arg(temp_toml_file):
assert not agent_config2.memory_enabled
assert agent_config2.enable_prompt_extensions
assert agent_config2.memory_max_threads == 10


def test_agent_config_custom_group_name(temp_toml_file):
temp_toml = """
[core]
max_iterations = 99

[agent.group1]
memory_enabled = true

[agent.group2]
memory_enabled = false
"""
with open(temp_toml_file, 'w') as f:
f.write(temp_toml)

# just a sanity check that load app config wouldn't fail
app_config = load_app_config(config_file=temp_toml_file)
assert app_config.max_iterations == 99

# run_infer in evaluation can use `get_agent_config_arg` to load custom
# agent configs with any group name (not just agent name)
agent_config1 = get_agent_config_arg('group1', temp_toml_file)
assert agent_config1.memory_enabled
agent_config2 = get_agent_config_arg('group2', temp_toml_file)
assert not agent_config2.memory_enabled
Loading