Skip to content

feat: Support additional create methods for agent and agent_graph (PR-2)#102

Open
jsonbailey wants to merge 10 commits intomainfrom
jb/aic-1664/adapter-executor-factory
Open

feat: Support additional create methods for agent and agent_graph (PR-2)#102
jsonbailey wants to merge 10 commits intomainfrom
jb/aic-1664/adapter-executor-factory

Conversation

@jsonbailey
Copy link
Contributor

@jsonbailey jsonbailey commented Mar 10, 2026

feat!: Rename AIProviderFactory → RunnerFactory, create_model/agent/agent_graph()


Note

Medium Risk
Changes the provider factory API and renames exported provider classes, which can break integrations and alter provider initialization behavior (notably OpenAI client/env handling).

Overview
Refactors provider construction around a new RunnerFactory, replacing AIProviderFactory (now deleted) and updating LDAIClient to use RunnerFactory.create_model() when creating chats and judges.

AIProvider is redefined as a per-provider factory interface with new instance methods create_model, create_agent, and create_agent_graph (default no-op), and both the LangChain and OpenAI provider packages are updated to match: LangChain is renamed/exported as LangChainRunnerFactory with an instance create_model, and OpenAI moves to openai_runner_factory.py with env-based client initialization and a non-async create_model that reuses the client. Tests are updated accordingly.

Written by Cursor Bugbot for commit 3baae96. This will update automatically on new commits. Configure here.

@jsonbailey jsonbailey marked this pull request as ready for review March 10, 2026 22:59
@jsonbailey jsonbailey requested a review from a team as a code owner March 10, 2026 22:59
@jsonbailey jsonbailey changed the title feat: Support addtional create methods for agent and agent_graph feat: Support additional create methods for agent and agent_graph Mar 10, 2026
@jsonbailey jsonbailey force-pushed the jb/aic-1664/adapter-executor-factory branch from dd194a8 to fd13f66 Compare March 11, 2026 17:25
@jsonbailey jsonbailey marked this pull request as draft March 11, 2026 17:26
@jsonbailey jsonbailey force-pushed the jb/aic-1664/adapter-executor-factory branch from fd13f66 to 4bef65c Compare March 11, 2026 17:55
@jsonbailey jsonbailey changed the title feat: Support additional create methods for agent and agent_graph feat: Support additional create methods for agent and agent_graph (PR-1) Mar 11, 2026
@jsonbailey jsonbailey changed the title feat: Support additional create methods for agent and agent_graph (PR-1) feat: Support additional create methods for agent and agent_graph (PR-2) Mar 11, 2026
jsonbailey and others added 3 commits March 25, 2026 08:54
Keep uv-based CI setup (drop poetry steps added in main), accept version
bump to 0.16.1 from main while preserving x-release-please-version comment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
feat!: Rename AIProviderFactory → RunnerFactory
feat!: Rename OpenAIProvider → OpenAIRunnerFactory import from ldai_openai.openai_runner_factory
feat!: Rename LangChainProvider to LangChainRunnerFactory import from ldai_langchain.langchain_runner_factory
feat: Add create_model(), create_agent(), create_agent_graph() to AIProvider ABC (non-abstract, default warns)
@jsonbailey jsonbailey force-pushed the jb/aic-1664/adapter-executor-factory branch from 4bef65c to e10be52 Compare March 25, 2026 14:33
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jsonbailey jsonbailey marked this pull request as ready for review March 25, 2026 14:56
Base automatically changed from jb/aic-1664/uv-conversion to main March 25, 2026 15:51
Resolve conflicts:
- Makefiles (langchain, openai, server-ai): accept main's `uv sync --all-groups`
  over branch's `--group dev` to pick up the tooling update from main
- client.py: keep branch's `RunnerFactory` import (the PR 1 rename)
  over main's stale `AIProviderFactory` import

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove module-level docstring strings from all modified files (not
  idiomatic Python)
- Replace all "connector" terminology with "provider" in class docstrings,
  method docstrings, and log warning messages
- Fix stale "ExecutorFactory" references in provider class docstrings
  → RunnerFactory
- Add assert guards for Optional[BaseChatModel] before invocation in
  LangChainRunnerFactory to satisfy mypy
- Fix trailing blank lines (W391) across modified files

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

class OpenAIProvider(AIProvider):
"""
OpenAI implementation of AIProvider.
OpenAI provider for the LaunchDarkly AI SDK.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenAI class not renamed to match its file

Medium Severity

The file was renamed from openai_provider.py to openai_runner_factory.py, but the class inside is still OpenAIProvider. The LangChain counterpart was consistently renamed — file to langchain_runner_factory.py and class to LangChainRunnerFactory. This inconsistency between the file name and class name in the OpenAI package will confuse developers expecting a parallel naming convention.

Additional Locations (1)
Fix in Cursor Fix in Web

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.

2 participants