changed port 8000 till 7860
Browse files- api/fastapi_server.py +1 -1
- app.py +5 -5
api/fastapi_server.py
CHANGED
@@ -479,4 +479,4 @@ async def startup_event():
|
|
479 |
|
480 |
# Run the application
|
481 |
if __name__ == "__main__":
|
482 |
-
uvicorn.run("app:app", host="0.0.0.0", port=
|
|
|
479 |
|
480 |
# Run the application
|
481 |
if __name__ == "__main__":
|
482 |
+
uvicorn.run("app:app", host="0.0.0.0", port=7860)
|
app.py
CHANGED
@@ -26,7 +26,7 @@ def wait_for_fastapi(timeout=30, interval=0.5):
|
|
26 |
start_time = time.time()
|
27 |
while time.time() - start_time < timeout:
|
28 |
try:
|
29 |
-
response = requests.get("http://127.0.0.1:
|
30 |
if response.status_code == 200:
|
31 |
print("FastAPI server is ready!")
|
32 |
return True
|
@@ -36,7 +36,7 @@ def wait_for_fastapi(timeout=30, interval=0.5):
|
|
36 |
|
37 |
# Run FastAPI server in a separate thread
|
38 |
def run_fastapi():
|
39 |
-
uvicorn.run(fastapi_app, host="0.0.0.0", port=
|
40 |
|
41 |
# Start FastAPI in a background thread
|
42 |
fastapi_thread = threading.Thread(target=run_fastapi, daemon=True)
|
@@ -56,7 +56,7 @@ def respond(message, history, conversation_id=None):
|
|
56 |
try:
|
57 |
# Send request to FastAPI backend
|
58 |
response = requests.post(
|
59 |
-
"http://127.0.0.1:
|
60 |
json={"message": message, "conversation_id": conversation_id}
|
61 |
)
|
62 |
|
@@ -77,7 +77,7 @@ def respond(message, history, conversation_id=None):
|
|
77 |
|
78 |
def build_kb():
|
79 |
try:
|
80 |
-
response = requests.post("http://127.0.0.1:
|
81 |
if response.status_code == 200:
|
82 |
return f"Success: {response.json()['message']}"
|
83 |
else:
|
@@ -101,7 +101,7 @@ def get_kb_size():
|
|
101 |
# Добавим функцию проверки статуса базы знаний
|
102 |
def check_kb_status():
|
103 |
try:
|
104 |
-
response = requests.get("http://127.0.0.1:
|
105 |
if response.status_code == 200:
|
106 |
data = response.json()
|
107 |
if data["knowledge_base_exists"]:
|
|
|
26 |
start_time = time.time()
|
27 |
while time.time() - start_time < timeout:
|
28 |
try:
|
29 |
+
response = requests.get("http://127.0.0.1:7860/health")
|
30 |
if response.status_code == 200:
|
31 |
print("FastAPI server is ready!")
|
32 |
return True
|
|
|
36 |
|
37 |
# Run FastAPI server in a separate thread
|
38 |
def run_fastapi():
|
39 |
+
uvicorn.run(fastapi_app, host="0.0.0.0", port=7860)
|
40 |
|
41 |
# Start FastAPI in a background thread
|
42 |
fastapi_thread = threading.Thread(target=run_fastapi, daemon=True)
|
|
|
56 |
try:
|
57 |
# Send request to FastAPI backend
|
58 |
response = requests.post(
|
59 |
+
"http://127.0.0.1:7860/chat",
|
60 |
json={"message": message, "conversation_id": conversation_id}
|
61 |
)
|
62 |
|
|
|
77 |
|
78 |
def build_kb():
|
79 |
try:
|
80 |
+
response = requests.post("http://127.0.0.1:7860/build-kb")
|
81 |
if response.status_code == 200:
|
82 |
return f"Success: {response.json()['message']}"
|
83 |
else:
|
|
|
101 |
# Добавим функцию проверки статуса базы знаний
|
102 |
def check_kb_status():
|
103 |
try:
|
104 |
+
response = requests.get("http://127.0.0.1:7860/")
|
105 |
if response.status_code == 200:
|
106 |
data = response.json()
|
107 |
if data["knowledge_base_exists"]:
|