Skip to content
Merged
Show file tree
Hide file tree
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
13 changes: 0 additions & 13 deletions src/quant_strategy_plugins/ai_audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,23 +374,10 @@ def _llm_via_gateway(prompt: str, model: str, provider: str, timeout_seconds: fl
raise AiAuditError("ai_gateway_request_failed") from None


def _llm_direct(prompt: str, model: str, provider: str, timeout_seconds: float) -> str:
del prompt, model, provider, timeout_seconds
raise AiAuditError("direct_ai_completion_forbidden")


def _codex_exec_direct(prompt: str, timeout_seconds: float) -> str:
del prompt, timeout_seconds
raise AiAuditError("direct_ai_completion_forbidden")


def _codex_exec_completion(
endpoint: AiAuditEndpoint,
messages: Sequence[Mapping[str, str]],
timeout_seconds: float,
) -> str:
del endpoint, messages, timeout_seconds
raise AiAuditError("direct_ai_completion_forbidden")


def _extract_json_object(value: str | Mapping[str, Any]) -> dict[str, Any]:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_ai_audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def execute(self, *_args, **_kwargs):
),
)
direct_calls: list[str] = []
monkeypatch.setattr(ai_audit, direct_fallback, lambda *_args: direct_calls.append("direct") or "{}")
monkeypatch.setattr(ai_audit, direct_fallback, lambda *_args: direct_calls.append("direct") or "{}", raising=False)

with pytest.raises(AiAuditError, match="ai_gateway_request_failed") as exc_info:
if gateway_call is _llm_via_gateway:
Expand All @@ -391,7 +391,7 @@ def execute(self, *_args, **_kwargs):
def test_gateway_client_import_failure_never_uses_direct_fallback(monkeypatch, gateway_call, direct_fallback) -> None:
monkeypatch.setitem(sys.modules, "ai_gateway_client", None)
direct_calls: list[str] = []
monkeypatch.setattr(ai_audit, direct_fallback, lambda *_args: direct_calls.append("direct") or "{}")
monkeypatch.setattr(ai_audit, direct_fallback, lambda *_args: direct_calls.append("direct") or "{}", raising=False)

with pytest.raises(AiAuditError, match="ai_gateway_client_unavailable"):
if gateway_call is _llm_via_gateway:
Expand Down
Loading