diff --git a/requirements-dev.lock b/requirements-dev.lock index 3a78938..dfc5774 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -14,7 +14,7 @@ certifi==2023.11.17 cfgv==3.4.0 click==8.1.7 distlib==0.3.7 -eden-logos @ git+https://github.com/edenartlab/logos +dnspython==2.4.2 fastapi==0.104.1 filelock==3.13.1 fire==0.5.0 @@ -42,6 +42,7 @@ pydantic==2.5.2 pydantic-core==2.14.5 pyflakes==3.1.0 pygments==2.17.2 +pymongo==4.6.1 pytest==7.4.3 python-dateutil==2.8.2 python-dotenv==1.0.0 diff --git a/requirements.lock b/requirements.lock index 61f7ef6..b81250c 100644 --- a/requirements.lock +++ b/requirements.lock @@ -11,23 +11,20 @@ annotated-types==0.6.0 anyio==3.7.1 certifi==2023.11.17 click==8.1.7 -eden-logos @ git+https://github.com/edenartlab/logos +dnspython==2.4.2 fastapi==0.104.1 fire==0.5.0 h11==0.14.0 httpcore==1.0.2 httpx==0.25.2 idna==3.6 -iniconfig==2.0.0 markdown-it-py==3.0.0 mdurl==0.1.2 orjson==3.9.10 -packaging==23.2 -pluggy==1.3.0 pydantic==2.5.2 pydantic-core==2.14.5 pygments==2.17.2 -pytest==7.4.3 +pymongo==4.6.1 python-dateutil==2.8.2 python-dotenv==1.0.0 rich==13.7.0 diff --git a/src/server.py b/src/server.py index 5e19977..28a1f71 100644 --- a/src/server.py +++ b/src/server.py @@ -5,7 +5,6 @@ from fastapi.responses import JSONResponse from fastapi.exceptions import RequestValidationError from pydantic import BaseModel, Field -import pymongo from pymongo import MongoClient from bson.objectid import ObjectId from dotenv import load_dotenv @@ -14,13 +13,8 @@ load_dotenv() -print("SECRETS") -print(os.getenv("MONGO_URI"), os.getenv("MONGO_DB_NAME")) MONGO_URI = os.getenv("MONGO_URI") MONGO_DB_NAME = os.getenv("MONGO_DB_NAME") -print("SECRETS") -print(MONGO_URI, MONGO_DB_NAME) -print("SECRETS") app = FastAPI() client = MongoClient(MONGO_URI) @@ -86,6 +80,19 @@ async def interact(assistant: EdenAssistantInput, interaction: InteractionInput) return response -# @app.post("/test") -# async def test(assistant: EdenAssistantInput, interaction: InteractionInput): - + +@app.post("/test") +async def test(assistant: EdenAssistantInput, interaction: InteractionInput): + character = EdenAssistant( + name=assistant.name, + identity=assistant.identity, + knowledge=assistant.knowledge, + knowledge_summary=assistant.knowledge_summary, + ) + message = { + "prompt": interaction.prompt, + "attachments": interaction.attachments, + } + response = character(message, session_id=interaction.author_id) + print(response) + return response