mirror of
https://github.com/vegu-ai/talemate.git
synced 2026-05-18 05:05:39 +02:00
Major features: - Autonomous scene direction via director agent (replaces auto-direct) - Inline image display in scene feed - Character visuals tab for portrait/cover image management - Character message avatars with dynamic portrait selection - Pocket TTS and llama.cpp client support - Message appearance overhaul with configurable markdown display Improvements: - KoboldCpp: adaptive-p, min-p, presence/frequency penalty support - Setup wizard for initial configuration - Director chat action toggles - Visual agent: resolution presets, prompt revision, auto-analysis - Experimental concurrent requests for hosted LLM clients - Node editor alignment shortcuts (X/Y) and color picker Bugfixes: - Empty response retry loop - Client system prompt display - Character detail pins loading - ComfyUI workflow charset encoding - Various layout and state issues Breaking: Removed INSTRUCTOR embeddings
34 lines
1.0 KiB
Python
34 lines
1.0 KiB
Python
import os
|
|
from fastapi import FastAPI
|
|
from fastapi.responses import HTMLResponse
|
|
from fastapi.staticfiles import StaticFiles
|
|
from starlette.exceptions import HTTPException
|
|
|
|
# Get the directory of the current file
|
|
current_dir = os.path.dirname(os.path.abspath(__file__))
|
|
# Construct the path to the dist directory
|
|
dist_dir = os.path.join(current_dir, "talemate_frontend", "dist")
|
|
|
|
app = FastAPI()
|
|
|
|
# Serve static files, but exclude the root path
|
|
app.mount("/", StaticFiles(directory=dist_dir, html=True), name="static")
|
|
|
|
|
|
@app.get("/", response_class=HTMLResponse)
|
|
async def serve_root():
|
|
index_path = os.path.join(dist_dir, "index.html")
|
|
if os.path.exists(index_path):
|
|
with open(index_path, "r") as f:
|
|
content = f.read()
|
|
return HTMLResponse(
|
|
content=content,
|
|
headers={"Cache-Control": "no-cache, no-store, must-revalidate"},
|
|
)
|
|
else:
|
|
raise HTTPException(status_code=404, detail="index.html not found")
|
|
|
|
|
|
# This is the ASGI application
|
|
application = app
|