feat: save account model and thinking settings for Hermes
Rebuild & Deploy / rebuild (push) Successful in 1m9s
Rebuild & Deploy / rebuild (push) Successful in 1m9s
This commit is contained in:
1 parent
a45569f8c1
commit
6cb4427210
13 files changed
+798
-16
No files matched your search
+9
-1
@@ -111,9 +111,17 @@ async def entrypoint(ctx: JobContext):
|
||||
await stop_notice()
|
||||
notice_task = spawn(play_notice(text))
|
||||
|
||||
async def model_settings():
|
||||
# Fetch at each turn, not just on join/poll: saved account changes apply
|
||||
# immediately to the next request even in already-connected rooms.
|
||||
current = await resolve_room(ctx.room.name)
|
||||
if current["user"]["id"] != user_id:
|
||||
raise RuntimeError("Account mismatch")
|
||||
return current["model_settings"]
|
||||
|
||||
bridge = HermesLLM(base_url=account["hermes_url"], api_key=account["hermes_api_key"], user_id=user_id,
|
||||
room_id=ctx.room.name, on_progress=progress, on_wait_notice=wait_notice,
|
||||
on_answer_start=stop_notice)
|
||||
on_answer_start=stop_notice, get_model_settings=model_settings)
|
||||
tts = azure.TTS(voice=DEFAULT_VOICE, sample_rate=24000,
|
||||
speech_key=os.getenv("AZURE_SPEECH_KEY", ""), speech_region=os.getenv("AZURE_SPEECH_REGION", "eastus"))
|
||||
session = AgentSession(stt=azure.STT(speech_key=os.getenv("AZURE_SPEECH_KEY", ""),
|
||||
|
||||
Reference in new issue
Block a user