Skip to content

Commit a0f3965

Browse files
committed
refactor: remove deprecated invoke_model/invoke_structured_model shims from OpenAIModelRunner
1 parent b6d362a commit a0f3965

1 file changed

Lines changed: 0 additions & 41 deletions

File tree

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

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -151,44 +151,3 @@ def _extract_content(response: Any) -> str:
151151
if message and message.content:
152152
return message.content
153153
return ''
154-
155-
async def invoke_model(self, messages: List[LDMessage]) -> 'ModelResponse':
156-
"""
157-
.. deprecated::
158-
Use :meth:`run` instead.
159-
"""
160-
import warnings
161-
162-
from ldai.providers.types import ModelResponse
163-
warnings.warn(
164-
"invoke_model is deprecated; use run() instead",
165-
DeprecationWarning,
166-
stacklevel=2,
167-
)
168-
result = await self.run(messages)
169-
return ModelResponse(
170-
message=LDMessage(role='assistant', content=result.content),
171-
metrics=result.metrics,
172-
)
173-
174-
async def invoke_structured_model(
175-
self, messages: List[LDMessage], schema: Any
176-
) -> 'StructuredResponse':
177-
"""
178-
.. deprecated::
179-
Use :meth:`run` with ``output_type`` instead.
180-
"""
181-
import warnings
182-
183-
from ldai.providers.types import StructuredResponse
184-
warnings.warn(
185-
"invoke_structured_model is deprecated; use run(output_type=...) instead",
186-
DeprecationWarning,
187-
stacklevel=2,
188-
)
189-
result = await self.run(messages, output_type=schema)
190-
return StructuredResponse(
191-
data=result.parsed or {},
192-
raw_response=result.content,
193-
metrics=result.metrics,
194-
)

0 commit comments

Comments
 (0)