refactor: Use latest JSON tool type for structured outputs

This commit is contained in:
Igor Ilic 2025-09-29 17:06:01 +02:00
parent f2e216cdf7
commit 6bc5c6f162

View file

@ -73,8 +73,10 @@ class OpenAIAdapter(LLMInterface):
fallback_api_key: str = None,
fallback_endpoint: str = None,
):
self.aclient = instructor.from_litellm(litellm.acompletion, mode=instructor.Mode.JSON)
self.client = instructor.from_litellm(litellm.completion, mode=instructor.Mode.JSON)
self.aclient = instructor.from_litellm(
litellm.acompletion, mode=instructor.Mode.JSON_SCHEMA
)
self.client = instructor.from_litellm(litellm.completion, mode=instructor.Mode.JSON_SCHEMA)
self.transcription_model = transcription_model
self.model = model
self.api_key = api_key