Skip to content

Commit

Permalink
0.2 - fix testing
Browse files Browse the repository at this point in the history
  • Loading branch information
wwakabobik committed Nov 2, 2023
1 parent 47c636c commit 9bc319b
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 183 deletions.
8 changes: 0 additions & 8 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@
This file is init point for project-wide structure.
"""

# Engines
from .openai_api.src.openai_api.chatgpt import ChatGPT # pylint: disable=unused-import
from .openai_api.src.openai_api.dalle import DALLE # pylint: disable=unused-import
from .leonardo_api.src.leonardo_api.leonardo_sync import Leonardo # pylint: disable=unused-import
from .leonardo_api.src.leonardo_api.leonardo_async import Leonardo as LeonardoAsync # pylint: disable=unused-import


# Utils
from .utils.tts import CustomTTS # pylint: disable=unused-import
from .utils.transcriptors import CustomTranscriptor # pylint: disable=unused-import
from .utils.translators import CustomTranslator # pylint: disable=unused-import
Expand Down
7 changes: 0 additions & 7 deletions __main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@
This file is entry point for project-wide structure.
"""

# Engines
from .openai_api.src.openai_api.chatgpt import ChatGPT # pylint: disable=unused-import
from .openai_api.src.openai_api.dalle import DALLE # pylint: disable=unused-import
from .leonardo_api.src.leonardo_api.leonardo_sync import Leonardo # pylint: disable=unused-import
from .leonardo_api.src.leonardo_api.leonardo_async import Leonardo as LeonardoAsync # pylint: disable=unused-import

# Utils
from .utils.tts import CustomTTS # pylint: disable=unused-import
from .utils.transcriptors import CustomTranscriptor # pylint: disable=unused-import
from .utils.translators import CustomTranslator # pylint: disable=unused-import
Expand Down
2 changes: 1 addition & 1 deletion examples/image_generation/dalle_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
This file contains testing procedures for DALLE experiments
"""
import asyncio
from openai_python_api import DALLE

from examples.creds import oai_token, oai_organization
from openai_api.src.openai_api import DALLE

dalle = DALLE(auth_token=oai_token, organization=oai_organization)

Expand Down
4 changes: 2 additions & 2 deletions examples/image_generation/gpt_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@

import requests
from PIL import Image
from leonardo_api import Leonardo
from openai_python_api import DALLE

from examples.creds import oai_token, oai_organization
from leonardo_api.src.leonardo_api.leonardo_sync import Leonardo
from openai_api.src.openai_api.dalle import DALLE


def get_weather(city, units):
Expand Down
4 changes: 2 additions & 2 deletions examples/image_generation/test_leonardo.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
Description:
This file contains testing procedures for Leonardo experiments
"""
import asyncio
import json

from leonardo_api.src.leonardo_api.leonardo_async import Leonardo
import asyncio
from leonardo_api.leonardo_async import Leonardo


async def main():
Expand Down
7 changes: 4 additions & 3 deletions examples/speak_and_hear/test_gpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@
This file contains testing procedures for ChatGPT experiments
"""

import asyncio
import string
import sys

import asyncio
from openai_python_api import ChatGPT

from examples.creds import oai_token, oai_organization
from utils.audio_recorder import AudioRecorder
from utils.transcriptors import CustomTranscriptor
from utils.tts import CustomTTS
from ..creds import oai_token, oai_organization
from ...openai_api import ChatGPT

gpt = ChatGPT(auth_token=oai_token, organization=oai_organization, model="gpt-3.5-turbo")
gpt.max_tokens = 200
Expand Down
153 changes: 0 additions & 153 deletions examples/speak_and_hear/test_gpt_orig.py

This file was deleted.

9 changes: 5 additions & 4 deletions examples/test_generator/generator_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@
This file contains testing procedures for ChatGPT experiments
"""

import asyncio
import json
import logging

import asyncio
from openai_python_api import ChatGPT

from examples.creds import oai_token, oai_organization
from examples.test_generator.gpt_functions import gpt_functions, gpt_functions_dict
from examples.test_generator.pom_case_generator import PomTestCaseGenerator
from openai_api.src.openai_api import ChatGPT
from openai_api.src.openai_api.logger_config import setup_logger
from utils.logger_config import setup_logger

generator = PomTestCaseGenerator(url="https://www.saucedemo.com/")
# generator = PomTestCaseGenerator(url='https://automationintesting.com/selenium/testpage/')
Expand Down Expand Up @@ -62,7 +63,7 @@ def calculate_button(self):\\n
def setup_gpt():
"""Setup GPT bot with appropriate functions and settings"""
gpt = ChatGPT(auth_token=oai_token, organization=oai_organization, model="gpt-4-0613")
gpt.logger = setup_logger("gpt", "gpt.log", logging.INFO)
gpt.logger = setup_logger("gpt", "gpt.log", logging.INFO) # supress DEBUG output of the ChatGPT
gpt.system_settings = ""
gpt.function_dict = gpt_functions_dict
gpt.function_call = "auto"
Expand Down
1 change: 0 additions & 1 deletion leonardo_api
Submodule leonardo_api deleted from 44c374
1 change: 0 additions & 1 deletion openai_api
Submodule openai_api deleted from 5804e3
7 changes: 6 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,15 @@ pillow==10.1.0
readability==0.3.1
# Testing
webdriver_manager==4.0.1
selenium==4.15.0
selenium==4.15.1
pytest==7.4.3
pytest-json-report==1.5.0
pytest-xdist==3.3.1
# Third-party-test
cohere==4.32
llamaapi==0.1.36
# My AI APIs
leonardo-api==0.0.7
openai-python-api==0.0.4


0 comments on commit 9bc319b

Please sign in to comment.