diff --git a/sukoon-frontend/src/index.html b/sukoon-frontend/src/index.html index c801d4c..6f272c0 100644 --- a/sukoon-frontend/src/index.html +++ b/sukoon-frontend/src/index.html @@ -2,6 +2,15 @@ + + + Sukoon Chat diff --git a/sukoon.py b/sukoon.py index 4aa1742..6a6db50 100644 --- a/sukoon.py +++ b/sukoon.py @@ -13,7 +13,6 @@ from langchain_core.runnables import RunnableConfig from langgraph.store.base import BaseStore - import os import yaml, uuid import json diff --git a/sukoon_api.py b/sukoon_api.py index f19fe7d..36dda8b 100644 --- a/sukoon_api.py +++ b/sukoon_api.py @@ -3,6 +3,12 @@ from typing import TypedDict, Annotated import uvicorn +# from fastapi import Request +# from fastapi.responses import HTMLResponse +# from fastapi.templating import Jinja2Templates +# import json +# from datetime import datetime + from sukoon import chat from fastapi.middleware.cors import CORSMiddleware @@ -39,4 +45,35 @@ async def root(): # return RedirectResponse("/docs") if __name__ == "__main__": - uvicorn.run(app, host = "127.0.0.1", port = 8001) \ No newline at end of file + uvicorn.run(app, host = "127.0.0.1", port = 8001) + + +# for google analytics +# templates = Jinja2Templates(directory="templates") + +# # Track conversation events +# async def track_conversation_event(conversation_id: str, event_type: str, data: dict): +# # Send to Google Analytics +# event = { +# 'conversation_id': conversation_id, +# 'event_type': event_type, +# 'timestamp': datetime.utcnow().isoformat(), +# 'data': data +# } +# # Log for analysis +# print(json.dumps(event)) + +# @app.post("/chat") +# async def chat_endpoint(request: Request): +# # Your existing chat logic +# conversation_id = "unique_id" # Generate unique ID + +# # Track conversation start +# await track_conversation_event( +# conversation_id=conversation_id, +# event_type="conversation_start", +# data={ +# 'user_id': request.client.host, +# 'timestamp': datetime.utcnow().isoformat() +# } +# ) \ No newline at end of file