Skip to content

llm: live-test the Anthropic and Gemini adapters against a real key #17

Description

@amarjaleelbanbhan

What

OllamaAdapter has a real end-to-end live test (TestLiveOllama) that runs when a local server is reachable and skips otherwise. AnthropicAdapter and GeminiAdapter are only unit-tested against their documented REST schemas — never verified against a real API. Let's close that gap.

Suggested scope

  • Add opt-in live tests that run only when the relevant API key env var is present (e.g. ANTHROPIC_API_KEY / GEMINI_API_KEY) and skip otherwise, mirroring TestLiveOllama's skip-guard pattern.
  • Each test: a minimal real complete(...) round-trip asserting a non-empty response and sane token usage. Keep it to one cheap call per provider.
  • Do not commit any keys. The test reads the key from the environment only.

Why it's a good first issue

Small, isolated to one test module per adapter, and follows an existing pattern. You'll need your own API key to actually run it, but the skip-guard means CI (which has none) stays green.

Pointers

  • Adapters: packages/cortexward-llm/src/cortexward/llm/{anthropic_adapter,gemini_adapter}.py
  • Reference pattern: the TestLiveOllama class in packages/cortexward-llm/tests/.../test_ollama_adapter.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions