-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
46 lines (40 loc) · 1.37 KB
/
config.py
File metadata and controls
46 lines (40 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
"""
Shared configuration and API clients.
@strlst
"""
import os
import redis
from groq import Groq
API_KEY = os.environ.get("GROQ_API_KEY", "")
MODEL = "qwen/qwen3-32b"
# whisper model used for speech-to-text, excellent Japanese support
STT_MODEL = "whisper-large-v3-turbo"
# edge-tts japanese voice, mayu is younger and cuter than nanami
TTS_VOICE = "ja-JP-NanamiNeural"
PROVIDER = "groq"
SYSTEM = (
# "You are a thoughtful, concise conversation partner. "
# "Respond naturally and keep replies focused."
# 日本語にしましょう!
"あなたは優しくて簡明的な相棒だ。"
"自然に返答し、返信は要点を絞る。"
"必ず日本語で考えてほしい。"
)
# template context passed to all rendered pages
context = {
"chat_model": MODEL,
"chat_provider": PROVIDER,
"localization_info_please_type": "メッセージを入力してください。。。",
"localization_info_start": "会話を始めましょう",
}
client = Groq(api_key=API_KEY)
# persistent history cookie / valkey settings
USER_COOKIE = "aibou_uid"
# persist user-specific session cookie for 1 year
COOKIE_MAX_AGE = 60 * 60 * 24 * 365
# persist history for 90 days
HISTORY_TTL = int(os.environ.get("HISTORY_TTL_SECONDS", 60 * 60 * 24 * 90))
valkey = redis.from_url(
os.environ.get("SESSION_VALKEY_URL", "redis://localhost:6379/0"),
decode_responses=True,
)