Skip to content

Commit 0d933d2

Browse files
committed
added deprecations for old types
1 parent ae7516b commit 0d933d2

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

ldai/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
LDMessage,
1919
ModelConfig,
2020
ProviderConfig,
21+
# Deprecated aliases for backward compatibility
22+
AIConfig,
23+
LDAIAgent,
24+
LDAIAgentConfig,
25+
LDAIAgentDefaults,
2126
)
2227

2328
__all__ = [
@@ -35,4 +40,9 @@
3540
'LDMessage',
3641
'ModelConfig',
3742
'ProviderConfig',
43+
# Deprecated exports
44+
'AIConfig',
45+
'LDAIAgent',
46+
'LDAIAgentConfig',
47+
'LDAIAgentDefaults',
3848
]

ldai/models.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import warnings
12
from dataclasses import dataclass
23
from typing import Any, Dict, List, Literal, Optional
34

@@ -333,3 +334,27 @@ class AIAgentConfigRequest:
333334
# Type alias for multiple agents
334335
AIAgents = Dict[str, AIAgentConfig]
335336

337+
338+
# ============================================================================
339+
# Deprecated Type Aliases for Backward Compatibility
340+
# ============================================================================
341+
342+
# Note: These are type aliases that point to the new types.
343+
# Since Python uses duck typing, these will work at runtime even if type checkers complain.
344+
# The old AIConfig had optional enabled, so it maps to AICompletionConfigDefault
345+
# The old AIConfig return type had required enabled, so it maps to AICompletionConfig
346+
347+
# Deprecated: Use AICompletionConfigDefault instead
348+
# This was the old AIConfig with optional enabled (used as input/default)
349+
# Note: We map to AICompletionConfigDefault since the old AIConfig had optional enabled
350+
AIConfig = AICompletionConfigDefault
351+
352+
# Deprecated: Use AIAgentConfigDefault instead
353+
LDAIAgentDefaults = AIAgentConfigDefault
354+
355+
# Deprecated: Use AIAgentConfigRequest instead
356+
LDAIAgentConfig = AIAgentConfigRequest
357+
358+
# Deprecated: Use AIAgentConfig instead (note: this was the old return type)
359+
LDAIAgent = AIAgentConfig
360+

0 commit comments

Comments
 (0)