Hotfix/global agent manager workaround (#3157)

* Add indirection layer to entry point

* Get around singleton pattern for AgentManager to fix tests
This commit is contained in:
James Collins
2023-04-24 13:27:31 -07:00
committed by GitHub
parent a5cc67badd
commit b984f985bc
3 changed files with 4 additions and 2 deletions

View File

@@ -1,5 +1,4 @@
"""The application entry point. Can be invoked by a CLI or any other front end application."""
import logging
import sys
from pathlib import Path

BIN
mem.sqlite3 Normal file

Binary file not shown.

View File

@@ -8,6 +8,9 @@ from tests.utils import requires_api_key
@pytest.fixture
def agent_manager():
# Hack, real gross. Singletons are not good times.
if AgentManager in AgentManager._instances:
del AgentManager._instances[AgentManager]
return AgentManager()
@@ -23,7 +26,7 @@ def prompt():
@pytest.fixture
def model():
return "gpt-4"
return "gpt-3.5-turbo"
@requires_api_key("OPENAI_API_KEY")