fdgrg
This commit is contained in:
parent
9168da2537
commit
4827fdd450
@ -70,8 +70,12 @@ async def _owoify_text_ai(text: str) -> str:
|
||||
}
|
||||
async with aiohttp.ClientSession() as session:
|
||||
async with session.post(url, headers=headers, json=payload) as resp:
|
||||
data = await resp.json()
|
||||
return data["choices"][0]["message"]["content"]
|
||||
if resp.content_type == "application/json":
|
||||
data = await resp.json()
|
||||
return data["choices"][0]["message"]["content"]
|
||||
else:
|
||||
text = await resp.text()
|
||||
raise RuntimeError(f"OpenRouter API returned non-JSON response (status {resp.status}): {text[:500]}")
|
||||
|
||||
class OwoifyCog(commands.Cog):
|
||||
def __init__(self, bot: commands.Bot):
|
||||
|
Loading…
x
Reference in New Issue
Block a user