mirror of
https://github.com/NousResearch/atropos.git
synced 2026-04-19 12:57:58 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
836c346406
commit
64d3ee1bd6
2 changed files with 14 additions and 6 deletions
|
|
@ -211,6 +211,8 @@ class BaseEnvConfig(BaseModel):
|
|||
"no thinking prompt is injected. Use HERMES_REASONING_PROMPT from "
|
||||
"eval_helpers for the standard Hermes reasoning prompt.",
|
||||
)
|
||||
|
||||
|
||||
class BaseEnv(ABC):
|
||||
name: Optional[str] = None
|
||||
env_config_cls: BaseEnvConfig = BaseEnvConfig
|
||||
|
|
@ -1436,13 +1438,13 @@ class BaseEnv(ABC):
|
|||
cli_passed_flags, openai_full_prefix
|
||||
) # CLI args
|
||||
yaml_oai_config = yaml_config.get(OPENAI_NAMESPACE, {})
|
||||
|
||||
|
||||
# Debug logging for CLI args
|
||||
print(f"[CLI DEBUG] cli_passed_flags = {cli_passed_flags}")
|
||||
print(f"[CLI DEBUG] openai_full_prefix = {openai_full_prefix}")
|
||||
print(f"[CLI DEBUG] oai_cli_passed_args = {oai_cli_passed_args}")
|
||||
print(f"[CLI DEBUG] yaml_oai_config = {yaml_oai_config}")
|
||||
|
||||
|
||||
# Auto-convert ServerBaseline to APIServerConfig when CLI/YAML overrides are provided
|
||||
# This allows any environment to use --openai.* CLI args without modifying config_init
|
||||
# Use a new variable to avoid UnboundLocalError from closure scoping
|
||||
|
|
@ -1456,7 +1458,7 @@ class BaseEnv(ABC):
|
|||
logger.info(
|
||||
"Auto-converted ServerBaseline to APIServerConfig for CLI/YAML overrides"
|
||||
)
|
||||
|
||||
|
||||
if (
|
||||
isinstance(effective_server_configs, list)
|
||||
and len(effective_server_configs) == 1
|
||||
|
|
@ -1470,13 +1472,17 @@ class BaseEnv(ABC):
|
|||
if isinstance(default_openai_config_, APIServerConfig) and isinstance(
|
||||
yaml_oai_config, dict
|
||||
):
|
||||
print(f"[CLI DEBUG] default_openai_config_.model_dump() = {default_openai_config_.model_dump()}")
|
||||
print(
|
||||
f"[CLI DEBUG] default_openai_config_.model_dump() = {default_openai_config_.model_dump()}"
|
||||
)
|
||||
openai_config_dict = merge_dicts(
|
||||
default_openai_config_.model_dump(), # Default APIServerConfig (or from class init)
|
||||
yaml_oai_config,
|
||||
oai_cli_passed_args,
|
||||
)
|
||||
print(f"[CLI DEBUG] openai_config_dict after merge = {openai_config_dict}")
|
||||
print(
|
||||
f"[CLI DEBUG] openai_config_dict after merge = {openai_config_dict}"
|
||||
)
|
||||
else:
|
||||
print(
|
||||
"[CLI DEBUG] Not merging: default_openai_config_ "
|
||||
|
|
|
|||
|
|
@ -200,7 +200,9 @@ def resolve_openai_configs(
|
|||
) from e
|
||||
elif isinstance(default_server_configs, APIServerConfig):
|
||||
# Check APIServerConfig BEFORE ServerBaseline since APIServerConfig inherits from ServerBaseline
|
||||
logger.info("Using single OpenAI server configuration based on merged settings (default/YAML/CLI).")
|
||||
logger.info(
|
||||
"Using single OpenAI server configuration based on merged settings (default/YAML/CLI)."
|
||||
)
|
||||
try:
|
||||
final_openai_config = APIServerConfig(**openai_config_dict)
|
||||
except Exception as e:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue