From 2a490edff5373f88ed1f25b1a989add0676bf3ee Mon Sep 17 00:00:00 2001 From: Xin Wang Date: Fri, 20 Jun 2025 10:03:39 +0800 Subject: [PATCH] Add env and entrypoint --- .env | 10 ++++++++++ .gitignore | 2 ++ entrypoint.sh | 1 + src/api/__init__.py | 1 + src/main.py | 3 +-- 5 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 .env create mode 100644 entrypoint.sh create mode 100644 src/api/__init__.py diff --git a/.env b/.env new file mode 100644 index 0000000..9a8c46e --- /dev/null +++ b/.env @@ -0,0 +1,10 @@ +DATABASE_URL=sqlite:///./test.db +SECRET_KEY=your_secret_key +DEBUG=True + +ANALYSIS_SERVICE_URL=http://101.89.151.141:3000/api/v1/chat/completions +ANALYSIS_AUTH_TOKEN=fastgpt-hSPnXMoBNGVAEpTLkQT3YfAnN26gQSyvLd4ABL1MRDoh68nL4RDlopFHXqmH8 +APP_ID=683ea1bc86197e19f71fc1ae +DELETE_SESSION_URL=http://101.89.151.141:3000/api/core/chat/delHistory?chatId={chatId}&appId={appId} +DELETE_CHAT_URL=http://101.89.151.141:3000/api/core/chat/item/delete?contentId={contentId}&chatId={chatId}&appId={appId} +GET_CHAT_RECORDS_URL=http://101.89.151.141:3000/api/core/chat/getPaginationRecords diff --git a/.gitignore b/.gitignore index e69de29..09bf5d6 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,2 @@ +*.pyc +__pycache__/ \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..ca898d0 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1 @@ +uvicorn src.main:app --host 0.0.0.0 --port 8000 \ No newline at end of file diff --git a/src/api/__init__.py b/src/api/__init__.py new file mode 100644 index 0000000..82789f2 --- /dev/null +++ b/src/api/__init__.py @@ -0,0 +1 @@ +# This file is intentionally left blank. \ No newline at end of file diff --git a/src/main.py b/src/main.py index d783452..bcb2ebc 100644 --- a/src/main.py +++ b/src/main.py @@ -1,7 +1,6 @@ from fastapi import FastAPI import sys -sys.path.append('..') -from api.endpoints import router as api_router +from .api.endpoints import router as api_router app = FastAPI( title="AI Accident Information Collection API",