Skip to content

Commit

Permalink
Complete refactor - must fix broken tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
dreaminglucid committed Aug 19, 2023
1 parent d51bc0e commit e1548bc
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion lucidserver/actions/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .actions_main import (
from .main import (
get_image_summary,
generate_dream_analysis,
generate_dream_image,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.memories_main import search_dreams
from memories import search_dreams
global message_histories # Access the global dictionary

try:
Expand Down
4 changes: 2 additions & 2 deletions lucidserver/actions/tests/actions_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
sys.path.append('.')

import pytest
from lucidserver.memories.memories_main import search_dreams
from lucidserver.actions.actions_main import get_image_summary, generate_dream_analysis, generate_dream_image, regular_chat, call_function_by_name, search_chat_with_dreams
from lucidserver.memories.main import search_dreams
from lucidserver.actions.main import get_image_summary, generate_dream_analysis, generate_dream_image, regular_chat, call_function_by_name, search_chat_with_dreams
from unittest.mock import patch, Mock


Expand Down
2 changes: 1 addition & 1 deletion lucidserver/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# app.py

from flask import Flask
from endpoints.endpoints_main import register_endpoints
from endpoints import register_endpoints
from agentlogger import print_header

app = Flask(__name__)
Expand Down
2 changes: 1 addition & 1 deletion lucidserver/endpoints/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .endpoints_main import (
from .main import (
register_endpoints,
create_dream,
get_dreams,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import json
from webargs import fields
from webargs.flaskparser import use_args
from memories.memories_main import (
from memories import (
create_dream,
get_dreams,
get_dream,
Expand All @@ -15,8 +15,8 @@
search_dreams,
delete_dream
)
from actions.actions_main import search_chat_with_dreams, regular_chat
from agentlogger import log, print_header
from actions import search_chat_with_dreams, regular_chat
from agentlogger import log
import traceback

# Define all your endpoints here, and use the app object passed as an argument to bind them
Expand Down
2 changes: 1 addition & 1 deletion lucidserver/endpoints/tests/endpoints_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from unittest.mock import patch
from lucidserver.app import app
from lucidserver.endpoints.endpoints_main import *
from lucidserver.endpoints.main import *
import pytest
import json

Expand Down
2 changes: 1 addition & 1 deletion lucidserver/memories/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .memories_main import (
from .main import (
create_dream,
get_dream,
get_dreams,
Expand Down
Original file line number Diff line number Diff line change
@@ -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.actions_main import generate_dream_analysis, generate_dream_image, get_image_summary
from 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.
Expand Down
2 changes: 1 addition & 1 deletion lucidserver/memories/tests/memories_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
sys.path.append('.')

import pytest
from lucidserver.memories.memories_main import create_dream, get_dream, get_dreams, get_dream_analysis, get_dream_image, update_dream_analysis_and_image, search_dreams
from lucidserver.memories.main import create_dream, get_dream, get_dreams, get_dream_analysis, get_dream_image, update_dream_analysis_and_image, search_dreams


# Mocking the create_memory function //////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit e1548bc

Please sign in to comment.