jonbot fixes

This commit is contained in:
2026-06-19 01:12:46 -05:00
parent e94173b3da
commit 39cc53d501
3 changed files with 8 additions and 8 deletions

View File

@@ -33,7 +33,8 @@ if not logger.hasHandlers():
openai.api_key = config.OPENAI_TOKEN
jonkey = config.JONBOT_TOKEN
model = config.TXT_MODEL
txtmodel = config.TXT_MODEL
sysprompt = config.SYSTEM_PROMPT
intents = discord.Intents.default()
intents.messages = True
@@ -47,7 +48,7 @@ client = commands.Bot(
@client.event
async def on_ready():
print(f"Logged in as {client.user.name} running {model}.", flush=True)
print(f"Logged in as {client.user.name} running {txtmodel}.", flush=True)
@client.command(name="chat")
async def jonchat(ctx, *, prompt):
@@ -80,12 +81,12 @@ oai = AsyncOpenAI(
base_url=config.BASE_URL,
)
async def generate_chat(self, question: str) -> str:
async def generate_chat(question: str) -> str:
try:
response = await oai.chat.completions.create(
model=self.txtmodel,
model=txtmodel,
messages=[
{"role": "system", "content": self.sysprompt},
{"role": "system", "content": sysprompt},
{"role": "user", "content": question},
],
max_tokens=400,