Update adapter.py

This commit is contained in:
Vasilije 2025-01-16 13:24:42 +01:00 committed by GitHub
parent 0a9c9438ed
commit b6e82dfb4f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -35,22 +35,7 @@ class OpenAIAdapter(LLMInterface):
transcription_model: str,
streaming: bool = False,
):
self.aclient = instructor.from_litellm(litellm.acompletion)
self.client = instructor.from_litellm(litellm.completion)
self.transcription_model = transcription_model
self.model = model
self.api_key = api_key
self.endpoint = endpoint
self.api_version = api_version
self.streaming = streaming
base_config = get_base_config()
if base_config.monitoring_tool == MonitoringTool.LANGFUSE:
self.aclient.success_callback = ["langfuse"]
self.aclient.failure_callback = ["langfuse"]
self.client.success_callback = ["langfuse"]
self.client.failure_callback = ["langfuse"]