handling incomplete responses from session api
This commit is contained in:
parent
25f672f7e5
commit
1092b20bb5
2 changed files with 5 additions and 2 deletions
|
@ -108,7 +108,10 @@ class KagiSkill(FallbackSkill):
|
|||
return False
|
||||
|
||||
def clean_session_string(self, raw_text):
|
||||
text = json.loads(raw_text)
|
||||
# sometimes it bails before finishing the json string
|
||||
# if that happens let's fix it and read what we managed to get
|
||||
jsonstr = raw_text if raw_text.endswith('"') else raw_text + '"'
|
||||
text = json.loads(jsonstr)
|
||||
pattern_refs = re.compile(r'<div[^>]*>.*$', re.DOTALL)
|
||||
pattern_sups = re.compile(r'<sup[^>]*>.*?</sup>', re.DOTALL)
|
||||
pattern_tags = re.compile(r'<.*?>')
|
||||
|
|
2
setup.py
2
setup.py
|
@ -4,7 +4,7 @@ import os
|
|||
from os import walk, path
|
||||
|
||||
PYPI_NAME = "skill-ovos-fallback-kagi" # pip install PYPI_NAME
|
||||
VERSION = "0.1.8"
|
||||
VERSION = "0.1.9"
|
||||
URL = f"https://code.sitosis.com/rudism/{PYPI_NAME}"
|
||||
SKILL_CLAZZ = "KagiSkill" # needs to match __init__.py class name
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue