Skip to content

feat/issue65 llm providers#69

Open
ar7casper wants to merge 2 commits into
masterfrom
feat/issue65-llm-providers
Open

feat/issue65 llm providers#69
ar7casper wants to merge 2 commits into
masterfrom
feat/issue65-llm-providers

Conversation

@ar7casper
Copy link
Copy Markdown
Collaborator

ar7casper and others added 2 commits May 24, 2026 15:08
…ti-provider support (issue #65)

Replaces the hardcoded AnthropicClient wrapper used across 15+ files with a
Protocol-based adapter layer. Each pipeline phase (analyze, enhance, verify,
report, dynamic_test, llm_reach, app_context) resolves to a (provider, model)
pair via a registry built from ~/.config/openant/config.json.

Adapter framework (libs/openant-core/utilities/llm/):
* adapter.py    LLMAdapter Protocol, unified content blocks, 5-class error taxonomy
* config.py     v2 schema with v1->v2 migration of legacy api_key
* builtins.py   frozen openant-default config pinning today's Claude defaults
* registry.py   PhaseRegistry with eager adapter instantiation + probe validation
* helpers.py    simple_text + lookup_pricing shortcuts

Shipped adapters (providers/):
* anthropic.py  reference impl, full tool calling, per-model pricing
* openai.py     Chat Completions, splits one-user-with-N-tool-results into N role=tool messages
* google.py     Gemini via google-genai, function_call/function_response Part translation

All three support tool calling. 33-test contract harness runs against all three.

Setup wizard (apps/openant-cli/cmd/setup.go):
* `openant setup llm` walks per-phase provider+model selection
* Per-phase per-provider model defaults + known-models hint
* 1-token probe per unique (provider, model) before save
* OpenAI ChatGPT/Codex-vs-API-key heads-up

Go CLI:
* --model opus/sonnet replaced by --llm-config <name> on analyze/scan/enhance/verify/dynamic-test/report
* internal/config/config.go gains WriteLLMConfig + raw-map round-trip preserving v2 fields
* set-api-key refactored to share the probe helper now used by the wizard

Pipeline migration:
* Every AnthropicClient call site (15+ files) replaced with PhaseBinding threading
* Scanner builds the registry once and probes upfront; standalone verbs build their own
* Defensive _coerce_to_str in reporter so non-string fields from GPT-style responses
  don't crash report generation (analyze prompt also tightened to require string types)

Closes #65.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
README:
* Replace "Using a non-Anthropic provider" with "Setting up an LLM"
  that leads with the `openant setup llm` wizard
* Shipped-adapters table (Anthropic, OpenAI, Google) with
  subscription-vs-API caveats per provider
* 7-phase sample config (with `app_context`)
* New Roadmap section: more adapters, OAuth subscription auth,
  cross-provider tool-call quirks, more languages, hosted scan service

CHANGELOG: bring [2026-05-24] entry in line with reality —
add OpenAI/Google adapters, the setup wizard, the contract harness,
the reporter coercion fix, and the seventh `app_context` phase that
the original entry didn't mention.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant