Skip to content

Commit f2f5c90

Browse files
committed
style: format with black for CI stability
1 parent 9fbaf6d commit f2f5c90

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

orbit_agent/advisor.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,12 @@ def _call_llm_with_retry(self, module, **kwargs):
158158

159159
est_in_toks = int((in_chars / 4.0) + 0.5)
160160
est_out_toks = int((out_chars / 4.0) + 0.5)
161-
if cfg.track_usage and (cfg.cost_per_1k_prompt > 0 or cfg.cost_per_1k_completion > 0):
162-
cost = (
163-
(est_in_toks / 1000.0) * cfg.cost_per_1k_prompt
164-
+ (est_out_toks / 1000.0) * cfg.cost_per_1k_completion
165-
)
161+
if cfg.track_usage and (
162+
cfg.cost_per_1k_prompt > 0 or cfg.cost_per_1k_completion > 0
163+
):
164+
cost = (est_in_toks / 1000.0) * cfg.cost_per_1k_prompt + (
165+
est_out_toks / 1000.0
166+
) * cfg.cost_per_1k_completion
166167
logger.info(
167168
f"LLM {module.__class__.__name__}: {duration_ms:.0f} ms, in≈{est_in_toks} tok, out≈{est_out_toks} tok, cost≈${cost:.4f}"
168169
)

orbit_agent/config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ def __post_init__(self):
9393
def _determine_model_and_key() -> tuple[str, Optional[str]]:
9494
"""Determine which model and API key to use"""
9595
explicit_model = os.getenv("ORBIT_LM")
96-
provider_hint = os.getenv("LM_PROVIDER") # Optional compatibility env: openai|anthropic|ollama
96+
provider_hint = os.getenv(
97+
"LM_PROVIDER"
98+
) # Optional compatibility env: openai|anthropic|ollama
9799
openai_key = os.getenv("OPENAI_API_KEY")
98100
anthropic_key = os.getenv("ANTHROPIC_API_KEY")
99101

0 commit comments

Comments
 (0)