24 lines
943 B
Python
24 lines
943 B
Python
"""
|
|
llm.py — AI Tutor / LLM Streaming Interface
|
|
STATUS: DEFERRED — Phase 2 (AI Coach LLM integration)
|
|
|
|
This module will provide streaming LLM responses via the local Ollama server
|
|
or a cloud inference endpoint. It is intentionally stubbed out in the current
|
|
production build to avoid dependency on the openai SDK and a running LLM server.
|
|
|
|
When ready to enable:
|
|
1. Add `openai==1.14.0` back to requirements.txt
|
|
2. Set LLM_BASE_URL, LLM_MODEL_NAME, OPENAI_API_KEY in backend/.env
|
|
3. Replace this stub with the full implementation below.
|
|
"""
|
|
from uuid import UUID
|
|
from typing import AsyncIterator
|
|
|
|
|
|
async def stream_tutor_response(user_id: UUID, user_message: str, session) -> AsyncIterator[str]:
|
|
"""
|
|
Stub: yields a single message explaining AI is coming soon.
|
|
Replace with real LLM streaming call in Phase 2.
|
|
"""
|
|
yield "🤖 AI Tutor is coming soon. This feature will be enabled once LLM infrastructure is provisioned."
|