Files
DeepTutor/deeptutor/tutorbot/providers/deeptutor_adapter.py
Bingxi Zhao (Frank) eff1c0dff6 prepare v1.3.6 release
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-03 16:35:52 +08:00

21 lines
741 B
Python

"""LLM provider adapter that reuses DeepTutor's LLM configuration.
When TutorBot runs in-process inside the DeepTutor server, this provider
reads api_key / model / base_url from DeepTutor's unified config and
delegates to the appropriate provider (OpenAICompat or Anthropic).
"""
from __future__ import annotations
from typing import cast
from deeptutor.services.llm.config import LLMConfig
from deeptutor.tutorbot.providers.base import LLMProvider
def create_deeptutor_provider(config: LLMConfig | None = None) -> LLMProvider:
"""Build a provider pre-configured from DeepTutor's LLMConfig."""
from deeptutor.services.llm.provider_factory import get_runtime_provider
return cast(LLMProvider, get_runtime_provider(config))