Improve image upload in debug drawer
This commit is contained in:
@@ -9,11 +9,14 @@ DATABASE_URL=postgresql+asyncpg://postgres:postgres@localhost:5432/postgres
|
||||
# ---- 服务监听 & 跨域 ----
|
||||
HOST=0.0.0.0
|
||||
PORT=8000
|
||||
# NLTK 3.9+ import guard vs local .venv under backend/ (set in app.py by default; override here if needed)
|
||||
# NLTK_DISABLE_IMPORT_SECURITY=1
|
||||
# 前端开发地址,允许跨域(公网部署时加上实际前端 origin)
|
||||
CORS_ORIGINS=http://localhost:3000,http://127.0.0.1:3000
|
||||
|
||||
# ---- RustFS / S3-compatible storage ----
|
||||
S3_ENDPOINT_URL=http://localhost:9000
|
||||
# Use 127.0.0.1 (not localhost) if HTTP_PROXY is set — proxies often return 502 for localhost.
|
||||
S3_ENDPOINT_URL=http://127.0.0.1:9000
|
||||
S3_ACCESS_KEY=rustfsadmin
|
||||
S3_SECRET_KEY=rustfsadmin
|
||||
S3_BUCKET=ai-video
|
||||
|
||||
@@ -12,6 +12,12 @@
|
||||
/api/webrtc/ice-servers WebRTC STUN/TURN 配置
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
# NLTK 3.9+ blocks dependency imports when .venv lives under cwd (local dev layout).
|
||||
# pipecat -> nltk -> regex hits this false positive; disable before any nltk import.
|
||||
os.environ.setdefault("NLTK_DISABLE_IMPORT_SECURITY", "1")
|
||||
|
||||
from contextlib import asynccontextmanager
|
||||
|
||||
import settings
|
||||
|
||||
@@ -235,6 +235,9 @@ class ConversationRecorder:
|
||||
},
|
||||
)
|
||||
)
|
||||
# Flush before artifact insert: db.get() below autoflushes and
|
||||
# can otherwise write conversation_artifacts first (FK violation).
|
||||
await db.flush()
|
||||
db.add(
|
||||
ConversationArtifact(
|
||||
id=artifact_id,
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ TURN_PASSWORD = os.getenv("TURN_PASSWORD", "")
|
||||
TURN_CREDENTIAL_TTL = int(os.getenv("TURN_CREDENTIAL_TTL", "86400"))
|
||||
|
||||
# ---- S3-compatible object storage (RustFS in local compose) ----
|
||||
S3_ENDPOINT_URL = os.getenv("S3_ENDPOINT_URL", "http://localhost:9000")
|
||||
S3_ENDPOINT_URL = os.getenv("S3_ENDPOINT_URL", "http://127.0.0.1:9000")
|
||||
S3_ACCESS_KEY = os.getenv("S3_ACCESS_KEY", "rustfsadmin")
|
||||
S3_SECRET_KEY = os.getenv("S3_SECRET_KEY", "rustfsadmin")
|
||||
S3_BUCKET = os.getenv("S3_BUCKET", "ai-video")
|
||||
|
||||
@@ -122,6 +122,9 @@ class ConversationRecorderTest(unittest.IsolatedAsyncioTestCase):
|
||||
def add(self, value):
|
||||
self.added.append(value)
|
||||
|
||||
async def flush(self):
|
||||
return None
|
||||
|
||||
async def get(self, _model, _session_id):
|
||||
return conversation
|
||||
|
||||
|
||||
Reference in New Issue
Block a user