init: Kira — AI body double with Honcho memory
Full voice pipeline (Whisper STT -> DeepSeek LLM -> OpenAI TTS), animated SVG avatar (Live2D-ready), girly-pop UI, lofi music, timer/notes/pets/wardrobe widgets, 10 background scenes with particle effects, Honcho cross-session memory.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
"""LLM service — DeepSeek API"""
|
||||
|
||||
import logging
|
||||
from openai import AsyncOpenAI
|
||||
from config import settings
|
||||
|
||||
logger = logging.getLogger("kira.llm")
|
||||
|
||||
|
||||
def _get_client() -> AsyncOpenAI:
|
||||
return AsyncOpenAI(
|
||||
api_key=settings.deepseek_api_key,
|
||||
base_url=settings.deepseek_base_url,
|
||||
)
|
||||
|
||||
|
||||
async def get_kira_response(messages: list[dict]) -> str:
|
||||
"""Get Kira's response from the LLM."""
|
||||
try:
|
||||
client = _get_client()
|
||||
resp = await client.chat.completions.create(
|
||||
model=settings.deepseek_model,
|
||||
messages=messages,
|
||||
max_tokens=300,
|
||||
temperature=0.7,
|
||||
)
|
||||
return resp.choices[0].message.content or "Mhm, I'm here!"
|
||||
except Exception as e:
|
||||
logger.error(f"LLM error: {e}")
|
||||
return "I'm still here with you! Could you say that again?"
|
||||
Reference in New Issue
Block a user