From 09d9defcc29a4e8ef927da59487a2f4ee989a987 Mon Sep 17 00:00:00 2001 From: moon Date: Sat, 19 Aug 2023 14:53:25 -0700 Subject: [PATCH] Tests are set up, some still failing --- lucidserver/__init__.py | 3 +++ lucidserver/actions/main.py | 2 +- lucidserver/app.py | 2 +- lucidserver/endpoints/main.py | 4 ++-- lucidserver/memories/main.py | 2 +- lucidserver/tests/__init__.py | 3 +++ lucidserver/tests/memories_tests.py | 1 - requirements.txt | Bin 394 -> 394 bytes test.py | 1 + 9 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 test.py diff --git a/lucidserver/__init__.py b/lucidserver/__init__.py index e69de29..efff7fb 100644 --- a/lucidserver/__init__.py +++ b/lucidserver/__init__.py @@ -0,0 +1,3 @@ +from .actions import * +from .endpoints import * +from .memories import * \ No newline at end of file diff --git a/lucidserver/actions/main.py b/lucidserver/actions/main.py index a69a54f..f1e83f1 100644 --- a/lucidserver/actions/main.py +++ b/lucidserver/actions/main.py @@ -331,7 +331,7 @@ def call_function_by_name(function_name, prompt, messages): return response def search_chat_with_dreams(function_name, prompt, user_email, messages=None): - from memories import search_dreams + from lucidserver.memories import search_dreams global message_histories # Access the global dictionary try: diff --git a/lucidserver/app.py b/lucidserver/app.py index 5f126de..7d4d273 100644 --- a/lucidserver/app.py +++ b/lucidserver/app.py @@ -1,7 +1,7 @@ # app.py from flask import Flask -from endpoints import register_endpoints +from lucidserver.endpoints import register_endpoints from agentlogger import print_header app = Flask(__name__) diff --git a/lucidserver/endpoints/main.py b/lucidserver/endpoints/main.py index 7a7e749..2cbc9de 100644 --- a/lucidserver/endpoints/main.py +++ b/lucidserver/endpoints/main.py @@ -5,7 +5,7 @@ import json from webargs import fields from webargs.flaskparser import use_args -from memories import ( +from lucidserver.memories import ( create_dream, get_dreams, get_dream, @@ -15,7 +15,7 @@ search_dreams, delete_dream ) -from actions import search_chat_with_dreams, regular_chat +from lucidserver.actions import search_chat_with_dreams, regular_chat from agentlogger import log import traceback diff --git a/lucidserver/memories/main.py b/lucidserver/memories/main.py index 3af63df..d986f4f 100644 --- a/lucidserver/memories/main.py +++ b/lucidserver/memories/main.py @@ -1,7 +1,7 @@ import time from agentlogger import log from agentmemory import create_memory, get_memories, update_memory, get_memory, search_memory, delete_memory -from actions import generate_dream_analysis, generate_dream_image, get_image_summary +from lucidserver.actions import generate_dream_analysis, generate_dream_image, get_image_summary def create_dream(title, date, entry, userEmail): """Create a new dream in the memory. diff --git a/lucidserver/tests/__init__.py b/lucidserver/tests/__init__.py index e69de29..d3a5933 100644 --- a/lucidserver/tests/__init__.py +++ b/lucidserver/tests/__init__.py @@ -0,0 +1,3 @@ +from .actions_tests import * +from .endpoints_tests import * +from .memories_tests import * \ No newline at end of file diff --git a/lucidserver/tests/memories_tests.py b/lucidserver/tests/memories_tests.py index 54d946f..f4d631b 100644 --- a/lucidserver/tests/memories_tests.py +++ b/lucidserver/tests/memories_tests.py @@ -1,7 +1,6 @@ import sys sys.path.append('.') -import pytest from lucidserver.memories.main import create_dream, get_dream, get_dreams, get_dream_analysis, get_dream_image, update_dream_analysis_and_image, search_dreams from lucidserver.actions.main import generate_dream_analysis, generate_dream_image, get_image_summary diff --git a/requirements.txt b/requirements.txt index 303838204596806710e28149d6837c4f1328e482..2ec814ca6311edd726d687fb7ab54f2be73f0d9c 100644 GIT binary patch delta 12 TcmeBT?qZ(c!)U(I*On0g7xx2e delta 12 TcmeBT?qZ(c!)US5*On0g7yJWk diff --git a/test.py b/test.py new file mode 100644 index 0000000..1b53339 --- /dev/null +++ b/test.py @@ -0,0 +1 @@ +from lucidserver.tests import * \ No newline at end of file