Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def fallback_llm(self, message):
def _threaded_get_response(utt, usr):
answer = self._get_llm_response(utt, usr, self._default_llm)
if not answer:
LOG.info(f"No fallback response")
LOG.info("No fallback response")
return
self.speak(answer)

Expand Down Expand Up @@ -207,7 +207,7 @@ def converse(self, message=None):
return False
last_message = self.chatting[user][0]
if time() - last_message > self.chat_timeout_seconds:
LOG.info(f"Chat session timed out")
LOG.info("Chat session timed out")
self._stop_chatting(message)
return False
# Take final utterance as one that wasn't normalized
Expand All @@ -216,11 +216,12 @@ def converse(self, message=None):
# TODO: Imperfect check for "stop" or "exit"
self._stop_chatting(message)
return True
Thread(target=self._threaded_converse, args=(utterance, user),
Thread(target=self._threaded_converse, args=(utterance, user, message),
daemon=True).start()
return True

def _threaded_converse(self, utterance, user):
def _threaded_converse(self, utterance: str, user: str, message: Message):
# `message` required to resolve response routing in `speak`
try:
llm = self.chatting[user][1]
resp = self._get_llm_response(utterance, user, llm)
Expand Down
6 changes: 3 additions & 3 deletions skill.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "LLM Fallback",
"url": "https://github.com/NeonDmitry/skill-fallback_llm_Ua_translate",
"url": "https://github.com/NeonGeckoCom/skill-fallback_llm",
"summary": "Get an LLM response from the Neon Diana backend.",
"short_description": "Get an LLM response from the Neon Diana backend.",
"description": "Converse with an LLM and enable LLM responses when Neon doesn't have a better response. To send a single query to an LLM, you can ask Neon to \"ask Chat GPT <something>\". To start conversing with an LLM, ask to \"talk to Chat GPT\" and have all of your input sent to an LLM until you say goodbye or stop talking for a while. Enable fallback behavior by asking to \"enable LLM fallback skill\" or disable it by asking to \"disable LLM fallback\". To have a copy of LLM interactions sent via email, ask Neon to \"email me a copy of our conversation\".",
Expand Down Expand Up @@ -41,7 +41,7 @@
"categories": [],
"tags": [],
"credits": [],
"skillname": "skill-fallback_llm_Ua_translate",
"authorname": "NeonDmitry",
"skillname": "skill-fallback_llm",
"authorname": "NeonGeckoCom",
"foldername": null
}