Skip to content

Commit

Permalink
evcerdsfjk
Browse files Browse the repository at this point in the history
  • Loading branch information
jmilldotdev committed Dec 20, 2023
1 parent cd2e5af commit 5f1735e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
3 changes: 2 additions & 1 deletion requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 16 additions & 9 deletions src/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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

0 comments on commit 5f1735e

Please sign in to comment.