SDK Upgrade Guide: v0.6.0 → v0.6.1¶
Date: 2026-01-19
Effort: ~5 minutes (optional improvements only)
Breaking Changes: None ✅
TL;DR¶
- No code changes required - v0.6.1 is 100% backward compatible
- Optional: Add type hints for better IDE support
- Optional: Migrate from
initialize_tracing()toauto_trace()orsafe_initialize()
What's New in v0.6.1¶
| Feature | Benefit |
|---|---|
| Type exports | IDE autocomplete & type checking |
py.typed marker |
Full mypy/pyright support |
| Deprecation warnings | Guides you to newer APIs |
| Clean interface | Better documentation |
Upgrade Steps¶
Step 1: Update Dependency¶
Or install directly:
Step 2: Verify (No Changes Needed)¶
Your existing code will work as-is:
# ✅ This still works exactly the same
from swisper_studio_sdk import auto_trace
async def startup():
status = await auto_trace()
print(f"Tracing enabled: {status['enabled']}")
Optional Improvements¶
A) Add Type Hints (Recommended)¶
Before (v0.6.0):
from swisper_studio_sdk import auto_trace
async def startup():
status = await auto_trace() # status is 'Any' - no IDE help
After (v0.6.1):
from swisper_studio_sdk import auto_trace, AutoTraceStatus
async def startup():
status: AutoTraceStatus = await auto_trace()
# Now your IDE knows:
# status['enabled']: bool
# status['redis']: bool
# status['langgraph_patched']: bool
# etc.
B) Available Type Exports¶
from swisper_studio_sdk import (
# Status types
InitializationStatus, # Return type of safe_initialize()
AutoTraceStatus, # Return type of auto_trace()
TracingConfig, # Configuration options
# Literal types
ObservationType, # "AUTO" | "SPAN" | "GENERATION" | "TOOL" | "AGENT"
)
C) Migrate Deprecated Function (Optional)¶
If you see this warning:
Before:
from swisper_studio_sdk import initialize_tracing
# Old API - still works but deprecated
result = initialize_tracing(
api_url="http://localhost:8000",
project_id="my-project",
api_key="my-key"
)
After (Option 1 - Recommended):
from swisper_studio_sdk import auto_trace
# One-line initialization - reads from environment
status = await auto_trace()
After (Option 2 - Manual):
from swisper_studio_sdk import safe_initialize
# Explicit configuration
status = await safe_initialize(
redis_url="redis://redis:6379",
project_id="my-project"
)
Environment Variables (for auto_trace)¶
If using auto_trace(), set these environment variables:
# Required
SWISPER_STUDIO_PROJECT_ID=your-project-id
# Optional (defaults shown)
SWISPER_STUDIO_REDIS_URL=redis://redis:6379
SWISPER_STUDIO_STREAM_NAME=observability:events
SWISPER_STUDIO_ENABLED=true
Type Reference¶
AutoTraceStatus¶
class AutoTraceStatus(TypedDict):
enabled: bool # Overall tracing status
initialized: bool # SDK initialized
redis: bool # Redis connected
write: bool # Can write to stream
consumer: bool # Consumer verified
langgraph_patched: bool # LangGraph auto-instrumented
llm_wrapper: bool # LLM wrapper active
environment: Optional[str] # Environment name
error: Optional[str] # Error message if any
InitializationStatus¶
class InitializationStatus(TypedDict):
enabled: bool # Tracing enabled
redis: bool # Redis connected
write: bool # Can write events
consumer: bool # Consumer running
initialized: bool # Fully initialized
ObservationType¶
Verification¶
After upgrading, verify the SDK works:
python -c "
from swisper_studio_sdk import __version__, AutoTraceStatus
print(f'SDK Version: {__version__}')
print(f'Type exports available: AutoTraceStatus = {AutoTraceStatus}')
"
Expected output:
SDK Version: 0.6.1
Type exports available: AutoTraceStatus = <class 'swisper_studio_sdk._types.AutoTraceStatus'>
FAQ¶
Q: Will my existing code break?
A: No. v0.6.1 is 100% backward compatible.
Q: Do I need to change anything?
A: No. Changes are optional improvements.
Q: What if I ignore the deprecation warning?
A: initialize_tracing() will continue to work. We'll give 6+ months notice before any removal.
Q: Does this affect production?
A: No functional changes. Only adds type information and deprecation guidance.
Support¶
Questions? Contact the SwisperStudio team or check:
- SDK README: sdk/README.md
- Integration Guide: docs/guides/swisper_studio_sdk_integration_guide.md