Skip to content

Commit 2897288

Browse files
committed
add experimental label
1 parent 51f3ba6 commit 2897288

11 files changed

Lines changed: 126 additions & 57 deletions

File tree

packages/ai-providers/server-ai-langchain/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ dependencies = [
2525
]
2626

2727
[project.optional-dependencies]
28-
graph = ["langgraph>=0.1.0"]
28+
graph = ["langgraph>=1.0.0"]
2929

3030
[project.urls]
3131
Homepage = "https://docs.launchdarkly.com/sdk/ai/python"
@@ -39,7 +39,7 @@ dev = [
3939
"mypy==1.18.2",
4040
"pycodestyle>=2.11.0",
4141
"isort>=5.12.0",
42-
"langgraph>=0.1.0",
42+
"langgraph>=1.0.0",
4343
]
4444

4545
[build-system]

packages/ai-providers/server-ai-langchain/src/ldai_langchain/langchain_agent_runner.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
"""LangChain agent runner for LaunchDarkly AI SDK."""
2-
31
from typing import Any
42

53
from ldai import log
@@ -14,6 +12,11 @@
1412

1513
class LangChainAgentRunner(AgentRunner):
1614
"""
15+
CAUTION:
16+
This feature is experimental and should NOT be considered ready for production use.
17+
It may change or be removed without notice and is not subject to backwards
18+
compatibility guarantees.
19+
1720
AgentRunner implementation for LangChain.
1821
1922
Wraps a compiled LangChain agent graph (from ``langchain.agents.create_agent``)

packages/ai-providers/server-ai-langchain/src/ldai_langchain/langchain_runner_factory.py

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,38 @@
1414
class LangChainRunnerFactory(AIProvider):
1515
"""LangChain ``AIProvider`` implementation for the LaunchDarkly AI SDK."""
1616

17+
def create_agent(self, config: Any, tools: Optional[ToolRegistry] = None) -> LangChainAgentRunner:
18+
"""
19+
CAUTION:
20+
This feature is experimental and should NOT be considered ready for production use.
21+
It may change or be removed without notice and is not subject to backwards
22+
compatibility guarantees.
23+
24+
Create a configured LangChainAgentRunner for the given AI agent config.
25+
26+
:param config: The LaunchDarkly AI agent configuration
27+
:param tools: ToolRegistry mapping tool names to callables
28+
:return: LangChainAgentRunner ready to run the agent
29+
"""
30+
from langchain.agents import create_agent as lc_create_agent
31+
instructions = (config.instructions or '') if hasattr(config, 'instructions') else ''
32+
llm = create_langchain_model(config)
33+
lc_tools = build_tools(config, tools or {})
34+
35+
agent = lc_create_agent(
36+
llm,
37+
tools=lc_tools or None,
38+
system_prompt=instructions or None,
39+
)
40+
return LangChainAgentRunner(agent)
41+
1742
def create_agent_graph(self, graph_def: Any, tools: ToolRegistry) -> Any:
1843
"""
44+
CAUTION:
45+
This feature is experimental and should NOT be considered ready for production use.
46+
It may change or be removed without notice and is not subject to backwards
47+
compatibility guarantees.
48+
1949
Create a configured LangGraphAgentGraphRunner for the given graph definition.
2050
2151
:param graph_def: The AgentGraphDefinition to execute
@@ -36,23 +66,3 @@ def create_model(self, config: AIConfigKind) -> LangChainModelRunner:
3666
"""
3767
llm = create_langchain_model(config)
3868
return LangChainModelRunner(llm)
39-
40-
def create_agent(self, config: Any, tools: Optional[ToolRegistry] = None) -> LangChainAgentRunner:
41-
"""
42-
Create a configured LangChainAgentRunner for the given AI agent config.
43-
44-
:param config: The LaunchDarkly AI agent configuration
45-
:param tools: ToolRegistry mapping tool names to callables
46-
:return: LangChainAgentRunner ready to run the agent
47-
"""
48-
from langchain.agents import create_agent as lc_create_agent
49-
instructions = (config.instructions or '') if hasattr(config, 'instructions') else ''
50-
llm = create_langchain_model(config)
51-
lc_tools = build_tools(config, tools or {})
52-
53-
agent = lc_create_agent(
54-
llm,
55-
tools=lc_tools or None,
56-
system_prompt=instructions or None,
57-
)
58-
return LangChainAgentRunner(agent)

packages/ai-providers/server-ai-openai/src/ldai_openai/openai_agent_graph_runner.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
"""OpenAI agent graph runner for LaunchDarkly AI SDK."""
2-
31
import re
42
import time
53
from typing import Any, Dict, List, Optional
@@ -34,6 +32,11 @@ def __init__(self, last_handoff_ns: int, last_node_key: str) -> None:
3432

3533
class OpenAIAgentGraphRunner(AgentGraphRunner):
3634
"""
35+
CAUTION:
36+
This feature is experimental and should NOT be considered ready for production use.
37+
It may change or be removed without notice and is not subject to backwards
38+
compatibility guarantees.
39+
3740
AgentGraphRunner implementation for the OpenAI Agents SDK.
3841
3942
Runs the agent graph with the OpenAI Agents SDK and automatically records

packages/ai-providers/server-ai-openai/src/ldai_openai/openai_agent_runner.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
"""OpenAI agent runner for LaunchDarkly AI SDK."""
2-
31
from typing import Any, Dict, List
42

53
from ldai import log
@@ -14,6 +12,11 @@
1412

1513
class OpenAIAgentRunner(AgentRunner):
1614
"""
15+
CAUTION:
16+
This feature is experimental and should NOT be considered ready for production use.
17+
It may change or be removed without notice and is not subject to backwards
18+
compatibility guarantees.
19+
1720
AgentRunner implementation for OpenAI.
1821
1922
Executes a single agent using the OpenAI Agents SDK (``openai-agents``).

packages/ai-providers/server-ai-openai/src/ldai_openai/openai_runner_factory.py

Lines changed: 39 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -36,37 +36,13 @@ def _extract_model_config(self, config: AIConfigKind) -> tuple:
3636
model_dict = config_dict.get('model') or {}
3737
return model_dict.get('name', ''), model_dict.get('parameters') or {}
3838

39-
def create_model(self, config: AIConfigKind) -> OpenAIModelRunner:
40-
"""
41-
Create a configured OpenAIModelRunner for the given AI config.
42-
43-
Reuses the underlying AsyncOpenAI client so connection pooling is preserved.
44-
Tool definitions are converted from LD's flat format to the Chat Completions
45-
API format, with native tools mapped to their correct API type.
46-
47-
:param config: The LaunchDarkly AI configuration
48-
:return: OpenAIModelRunner ready to invoke the model
49-
"""
50-
model_name, parameters = self._extract_model_config(config)
51-
parameters = dict(parameters)
52-
tool_defs = parameters.pop('tools', None) or []
53-
if tool_defs:
54-
parameters['tools'] = normalize_tool_types(tool_defs)
55-
return OpenAIModelRunner(self._client, model_name, parameters)
56-
57-
def create_agent_graph(self, graph_def: Any, tools: ToolRegistry) -> Any:
58-
"""
59-
Create a configured OpenAIAgentGraphRunner for the given graph definition.
60-
61-
:param graph_def: The AgentGraphDefinition to execute
62-
:param tools: Registry mapping tool names to callables
63-
:return: OpenAIAgentGraphRunner ready to execute the graph
64-
"""
65-
from ldai_openai.openai_agent_graph_runner import OpenAIAgentGraphRunner
66-
return OpenAIAgentGraphRunner(graph_def, tools)
67-
6839
def create_agent(self, config: Any, tools: Optional[ToolRegistry] = None) -> 'OpenAIAgentRunner':
6940
"""
41+
CAUTION:
42+
This feature is experimental and should NOT be considered ready for production use.
43+
It may change or be removed without notice and is not subject to backwards
44+
compatibility guarantees.
45+
7046
Create a configured OpenAIAgentRunner for the given AI agent config.
7147
7248
:param config: The LaunchDarkly AI agent configuration
@@ -88,6 +64,40 @@ def create_agent(self, config: Any, tools: Optional[ToolRegistry] = None) -> 'Op
8864
tools or {},
8965
)
9066

67+
def create_agent_graph(self, graph_def: Any, tools: ToolRegistry) -> Any:
68+
"""
69+
CAUTION:
70+
This feature is experimental and should NOT be considered ready for production use.
71+
It may change or be removed without notice and is not subject to backwards
72+
compatibility guarantees.
73+
74+
Create a configured OpenAIAgentGraphRunner for the given graph definition.
75+
76+
:param graph_def: The AgentGraphDefinition to execute
77+
:param tools: Registry mapping tool names to callables
78+
:return: OpenAIAgentGraphRunner ready to execute the graph
79+
"""
80+
from ldai_openai.openai_agent_graph_runner import OpenAIAgentGraphRunner
81+
return OpenAIAgentGraphRunner(graph_def, tools)
82+
83+
def create_model(self, config: AIConfigKind) -> OpenAIModelRunner:
84+
"""
85+
Create a configured OpenAIModelRunner for the given AI config.
86+
87+
Reuses the underlying AsyncOpenAI client so connection pooling is preserved.
88+
Tool definitions are converted from LD's flat format to the Chat Completions
89+
API format, with native tools mapped to their correct API type.
90+
91+
:param config: The LaunchDarkly AI configuration
92+
:return: OpenAIModelRunner ready to invoke the model
93+
"""
94+
model_name, parameters = self._extract_model_config(config)
95+
parameters = dict(parameters)
96+
tool_defs = parameters.pop('tools', None) or []
97+
if tool_defs:
98+
parameters['tools'] = normalize_tool_types(tool_defs)
99+
return OpenAIModelRunner(self._client, model_name, parameters)
100+
91101
def get_client(self) -> AsyncOpenAI:
92102
"""
93103
Return the underlying AsyncOpenAI client.

packages/sdk/server-ai/src/ldai/client.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,11 @@ async def create_agent(
390390
default_ai_provider: Optional[str] = None,
391391
) -> Optional[ManagedAgent]:
392392
"""
393+
CAUTION:
394+
This feature is experimental and should NOT be considered ready for production use.
395+
It may change or be removed without notice and is not subject to backwards
396+
compatibility guarantees.
397+
393398
Creates and returns a new ManagedAgent for AI agent invocations.
394399
395400
:param key: The key identifying the AI agent configuration to use
@@ -675,6 +680,11 @@ async def create_agent_graph(
675680
default_ai_provider: Optional[str] = None,
676681
) -> Optional[ManagedAgentGraph]:
677682
"""
683+
CAUTION:
684+
This feature is experimental and should NOT be considered ready for production use.
685+
It may change or be removed without notice and is not subject to backwards
686+
compatibility guarantees.
687+
678688
Creates and returns a new ManagedAgentGraph for AI agent graph execution.
679689
680690
Resolves the graph configuration via ``agent_graph()``, creates a

packages/sdk/server-ai/src/ldai/providers/agent_graph_runner.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
@runtime_checkable
77
class AgentGraphRunner(Protocol):
88
"""
9+
CAUTION:
10+
This feature is experimental and should NOT be considered ready for production use.
11+
It may change or be removed without notice and is not subject to backwards
12+
compatibility guarantees.
13+
914
Runtime capability interface for multi-agent graph execution.
1015
1116
An AgentGraphRunner is a focused, configured object returned by

packages/sdk/server-ai/src/ldai/providers/agent_runner.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
@runtime_checkable
77
class AgentRunner(Protocol):
88
"""
9+
CAUTION:
10+
This feature is experimental and should NOT be considered ready for production use.
11+
It may change or be removed without notice and is not subject to backwards
12+
compatibility guarantees.
13+
914
Runtime capability interface for single-agent execution.
1015
1116
An AgentRunner is a focused, configured object returned by

packages/sdk/server-ai/src/ldai/providers/ai_provider.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ def create_model(self, config: Any) -> Optional[Any]:
7575

7676
def create_agent(self, config: Any, tools: Optional[ToolRegistry] = None) -> Optional[Any]:
7777
"""
78+
CAUTION:
79+
This feature is experimental and should NOT be considered ready for production use.
80+
It may change or be removed without notice and is not subject to backwards
81+
compatibility guarantees.
82+
7883
Create a configured agent executor for the given AI config and tool registry.
7984
8085
Default implementation warns. Provider implementations should override this method.
@@ -88,6 +93,11 @@ def create_agent(self, config: Any, tools: Optional[ToolRegistry] = None) -> Opt
8893

8994
def create_agent_graph(self, graph_def: Any, tools: Any) -> Optional[Any]:
9095
"""
96+
CAUTION:
97+
This feature is experimental and should NOT be considered ready for production use.
98+
It may change or be removed without notice and is not subject to backwards
99+
compatibility guarantees.
100+
91101
Create a configured agent graph executor for the given graph definition and tools.
92102
93103
Default implementation warns. Provider implementations should override this method.

0 commit comments

Comments
 (0)