looks good

This commit is contained in:
2025-06-05 13:33:14 -05:00
parent 82561f050f
commit 353284b2c3
5 changed files with 79 additions and 82 deletions

View File

@ -4,6 +4,7 @@ import config
import aiohttp
import asyncio
import discord
import wikipedia
from openai import AsyncOpenAI
from garfpy import logger
@ -66,8 +67,6 @@ class GarfAI:
self.image_request_queue.task_done()
await asyncio.sleep(2)
# GarfChats
@staticmethod
async def generate_chat(self, question):
try:
client = AsyncOpenAI(api_key = self.openaikey)
@ -89,3 +88,11 @@ class GarfAI:
except Exception as e:
logger.info(e, flush=True)
return f"`GarfBot Error: Lasagna`"
async def wikisum(self, query):
try:
summary = wikipedia.summary(query)
garfsum = await self.generate_chat(f"Please summarize in your own words: {summary}")
return garfsum
except Exception as e:
return e