refactor: Refactor imports to be compatible with unit tests

This commit is contained in:
Drikus Roor
2023-04-11 19:53:42 +02:00
committed by Drikus Roor
parent 3d5dba2e57
commit d0ae72e63b
12 changed files with 24 additions and 15 deletions

0
scripts/__init__.py Normal file
View File

View File

@@ -1,7 +1,7 @@
import requests
from bs4 import BeautifulSoup
from config import Config
from llm_utils import create_chat_completion
from .config import Config
from .llm_utils import create_chat_completion
cfg = Config()

View File

@@ -1,8 +1,8 @@
from config import Config
from .config import Config
cfg = Config()
from llm_utils import create_chat_completion
from .llm_utils import create_chat_completion
# This is a magic function that can do anything with no-code. See
# https://github.com/Torantulino/AI-Functions for more info.
def call_ai_function(function, args, description, model=None):

View File

@@ -1,8 +1,8 @@
import json
from typing import Any, Dict, Union
from call_ai_function import call_ai_function
from config import Config
from json_utils import correct_json
from .call_ai_function import call_ai_function
from .config import Config
from .json_utils import correct_json
cfg = Config()

View File

@@ -1,6 +1,6 @@
import re
import json
from config import Config
from .config import Config
cfg = Config()

View File

@@ -1,5 +1,5 @@
import openai
from config import Config
from .config import Config
cfg = Config()
openai.api_key = cfg.openai_api_key