Closed baptisterajaut closed 7 months ago
So just to check i added :
try:
cards.append(TavernAICard.from_dict(entry))
except:
print(f"{entry} is brokey?");
count += 1
which produce
results is brokey?
count is brokey?
results is brokey?
count is brokey?
results is brokey?
count is brokey?
results is brokey?
count is brokey?
results is brokey?
count is brokey?
and the categories don't appear in the extension. So api change?
Same here
same here, and i'm new to these stuff and i don't know how to add characters so if anyone knows a different way please tell me
Hi there! Thanks for the issue and the insight. I'll be looking to fix this in the upcoming days, so please be patient. If you do encounter any more ways that it could be fixed, it would help me if you post them here. Thanks!
When parsing the returned values entry
eventually gets the string results
as it's value, which is not a dict.
Dirty hack to fix; check the type(entry) is a dict
before making a TavernAICard:
@@ -416,7 +415,7 @@ class TavernAIService:
@staticmethod
def __parseAmount(decoded, amount):
if amount == -1:
- return [TavernAICard.from_dict(entry) for entry in decoded]
+ return [TavernAICard.from_dict(entry) for entry in decoded if type(entry) is dict]
cards: list[TavernAICard] = []
count = 0
@@ -424,9 +423,10 @@ class TavernAIService:
for entry in decoded:
if count >= amount:
break
-
- cards.append(TavernAICard.from_dict(entry))
- count += 1
+
+ if type(entry) is dict:
+ cards.append(TavernAICard.from_dict(entry))
+ count += 1
return cards
It doesn't fix everything but it at least allows the extension to start. Some categories etc. are not showing correctly with this change.
Bug has been found! It was certainly a slight change in the TavernAI API when fetching specific category cards. Thanks for the insight to all!
Update has been released. Please update the extension!
Good day gents. Look like tavern ai broke something somewhere? Or i'm confused. The extension doesn't start anymore.
Traceback :