mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-04 11:10:10 +08:00
51 lines
1.2 KiB
Python
51 lines
1.2 KiB
Python
"""
|
|
Services Layer
|
|
==============
|
|
|
|
Unified service layer for DeepTutor providing:
|
|
- LLM client and configuration
|
|
- Embedding client and configuration
|
|
- RAG pipelines and components
|
|
- Prompt management
|
|
- TTS configuration
|
|
- System setup utilities
|
|
- Configuration loading
|
|
|
|
Usage:
|
|
from src.services.llm import get_llm_client
|
|
from src.services.embedding import get_embedding_client
|
|
from src.services.rag import get_pipeline
|
|
from src.services.prompt import get_prompt_manager
|
|
from src.services.tts import get_tts_config
|
|
from src.services.setup import init_user_directories
|
|
from src.services.config import load_config_with_main
|
|
|
|
# LLM
|
|
llm = get_llm_client()
|
|
response = await llm.complete("Hello, world!")
|
|
|
|
# Embedding
|
|
embed = get_embedding_client()
|
|
vectors = await embed.embed(["text1", "text2"])
|
|
|
|
# RAG
|
|
pipeline = get_pipeline("raganything")
|
|
result = await pipeline.search("query", "kb_name")
|
|
|
|
# Prompt
|
|
pm = get_prompt_manager()
|
|
prompts = pm.load_prompts("guide", "tutor_agent")
|
|
"""
|
|
|
|
from . import config, embedding, llm, prompt, rag, setup, tts
|
|
|
|
__all__ = [
|
|
"llm",
|
|
"embedding",
|
|
"rag",
|
|
"prompt",
|
|
"tts",
|
|
"setup",
|
|
"config",
|
|
]
|