fix: Modernize devrel agents tutorial to current Python AI SDK 0.20#24
Open
jsonbailey wants to merge 1 commit into
Open
fix: Modernize devrel agents tutorial to current Python AI SDK 0.20#24jsonbailey wants to merge 1 commit into
jsonbailey wants to merge 1 commit into
Conversation
- config_manager.py: replace removed LDAIAgentConfig/LDAIAgentDefaults with AIAgentConfigRequest/AIAgentConfigDefault; default_value= -> default= kwarg rename; replace removed .agent() method with agent_config(...) - Hoist tracker = config.create_tracker() (replaces removed config.tracker) across config_manager, supervisor_agent, security_agent, ld_agent_helpers, agent_service, api/main - Replace non-existent track_latency_ms with track_duration in ld_agent_helpers - Canonicalize from ldai.client -> from ldai imports - Bump pyproject.toml pin to launchdarkly-server-sdk-ai>=0.20.0 Refs AIC-2383 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The tutorial used a chain of pre-0.11 + pre-0.18 APIs: removed
LDAIAgentConfig/LDAIAgentDefaultstypes, removedai_client.agent(...)method, removedconfig.trackerproperty, andtrack_latency_ms(which never existed). Modernize to current Python AI SDK 0.20.x.LDAIAgentConfig→AIAgentConfigRequest;LDAIAgentDefaults→AIAgentConfigDefaultai_client.agent(...)→ai_client.agent_config(...);default_value=→default=kwargtracker = config.create_tracker()everywhereconfig.trackerwas accessedtrack_latency_ms→track_duration(thehasattrguard meant it silently no-op'd before)from ldai.client→from ldailaunchdarkly-server-sdk-ai>=0.1.0→>=0.20.0Refs AIC-2383. Part of the AI Configs docs/example modernization sweep tracked in
python-agent-work/all-docs-review.md.Test plan
python -m py_compileon all modified filespip install -e .(or equivalent) resolves cleanly against current SDKLAUNCHDARKLY_SDK_KEY🤖 Generated with Claude Code