env vars testing
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import io
|
||||
import os
|
||||
import openai
|
||||
import config
|
||||
import aiohttp
|
||||
import asyncio
|
||||
import discord
|
||||
@@ -11,9 +11,9 @@ from garfpy import logger
|
||||
|
||||
class GarfAI:
|
||||
def __init__(self):
|
||||
self.openaikey = config.OPENAI_TOKEN
|
||||
self.txtmodel = config.TXT_MODEL
|
||||
self.imgmodel = config.IMG_MODEL
|
||||
self.openaikey = os.getenv('OPENAI_TOKEN')
|
||||
self.txtmodel = os.getenv('TXT_MODEL')
|
||||
self.imgmodel = os.getenv('IMG_MODEL')
|
||||
self.image_request_queue = asyncio.Queue()
|
||||
|
||||
async def garfpic(self, ctx, prompt):
|
||||
@@ -82,7 +82,7 @@ class GarfAI:
|
||||
try:
|
||||
client = AsyncOpenAI(api_key=self.openaikey)
|
||||
response = await client.chat.completions.create(
|
||||
model=self.txtmodel,
|
||||
model=self.txtmodel, # type: ignore
|
||||
messages=[
|
||||
{
|
||||
"role": "system",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import config
|
||||
import os
|
||||
import requests
|
||||
from base64 import b64encode
|
||||
from garfpy import logger
|
||||
@@ -6,8 +6,8 @@ from garfpy import logger
|
||||
|
||||
class Kroger:
|
||||
def __init__(self):
|
||||
self.client_id = config.CLIENT_ID
|
||||
self.client_secret = config.CLIENT_SECRET
|
||||
self.client_id = os.getenv('CLIENT_ID')
|
||||
self.client_secret = os.getenv('CLIENT_SECRET')
|
||||
self.auth = b64encode(
|
||||
f"{self.client_id}:{self.client_secret}".encode()
|
||||
).decode()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import os
|
||||
import re
|
||||
import config
|
||||
import discord
|
||||
import aiohttp
|
||||
from garfpy import logger
|
||||
@@ -7,7 +7,7 @@ from garfpy import logger
|
||||
|
||||
class WeatherAPI:
|
||||
def __init__(self, api_key=None):
|
||||
self.api_key = api_key or config.WEATHER_TOKEN
|
||||
self.api_key = api_key or os.getenv("WEATHER_TOKEN")
|
||||
self.base_url = "https://api.openweathermap.org/data/2.5/weather"
|
||||
|
||||
def parse_location(self, location):
|
||||
|
||||
Reference in New Issue
Block a user