Skip to content

feat(llm): extract BaseAnthropicLLM, add base_url, export extension points#563

Closed
matteomedioli wants to merge 8 commits into
matteo/anthropic-kwargs-bugfixfrom
matteo/base-anthropic-llm-GENKGB-1658
Closed

feat(llm): extract BaseAnthropicLLM, add base_url, export extension points#563
matteomedioli wants to merge 8 commits into
matteo/anthropic-kwargs-bugfixfrom
matteo/base-anthropic-llm-GENKGB-1658

Conversation

@matteomedioli

@matteomedioli matteomedioli commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

No description provided.

…d schema logic

Moves the message-building, schema-conversion, and response-parsing logic
that lived directly on AnthropicLLM into a new BaseAnthropicLLM base class,
mirroring the BaseOpenAILLM/OpenAILLM split. AnthropicLLM becomes a subclass
responsible only for constructing the SDK clients, paving the way for
alternate Anthropic-compatible client implementations.
Allows routing Anthropic requests to a custom Anthropic-compatible
endpoint by passing base_url through to both the sync and async SDK
clients, alongside the existing http_client routing logic.
@matteomedioli matteomedioli changed the title Extract BaseAnthropicLLM to hold shared Anthropic message-building and schema logic refactor: extract BaseAnthropicLLM for shared message/schema logic Jul 16, 2026
Add both base classes to neo4j_graphrag.llm's imports and __all__ so
they are documented, supported entry points for subclassing custom
LLM clients, with a test verifying the exports.
Covers the AnthropicLLM/BaseAnthropicLLM split: confirms AnthropicLLM
subclasses BaseAnthropicLLM, exercises invoke/schema logic through a
minimal BaseAnthropicLLM subclass, and verifies the new base_url
parameter reaches both the sync and async Anthropic SDK clients
(alone and combined with an explicit http_client).
…sses

Adds a Sphinx docs page explaining what BaseAnthropicLLM and BaseOpenAILLM
are for and how the http_client/base_url injection contract works, with a
worked example of subclassing BaseAnthropicLLM to reach a custom endpoint.
Links the page and adds API reference entries for both base classes.
Adds a changelog entry covering the new BaseAnthropicLLM base class, the
base_url parameter on AnthropicLLM, the BaseAnthropicLLM/BaseOpenAILLM
exports, and the new LLM extensibility docs page.
@matteomedioli matteomedioli changed the title refactor: extract BaseAnthropicLLM for shared message/schema logic feat(llm): extract BaseAnthropicLLM, add base_url, export extension points Jul 16, 2026
@matteomedioli

Copy link
Copy Markdown
Contributor Author

Accidentally closed by a branch rename (no content lost, no review activity on this PR). Reopened as #566.

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