mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-04 13:29:28 +08:00
21 lines
741 B
Python
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))
|