Spaces:
Running
on
Zero
Running
on
Zero
dfda
Browse files- chat_history.db +0 -0
- controllers/gpt_enginner20240623063119 +1 -0
- mysite/routers/diamond.py +8 -10
chat_history.db
CHANGED
Binary files a/chat_history.db and b/chat_history.db differ
|
|
controllers/gpt_enginner20240623063119
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
Subproject commit 11b0d512810825a1ce8629244b07d48b83e05666
|
mysite/routers/diamond.py
CHANGED
@@ -10,15 +10,12 @@ from fastapi import APIRouter, HTTPException
|
|
10 |
router = APIRouter(prefix="/leaning", tags=["leaning"])
|
11 |
@router.get("/route/{calat}/{wehth}/{state}/{x}")
|
12 |
async def route(calat: float, wehth: float, state: str, x: int):
|
|
|
|
|
13 |
# Validate input parameters
|
14 |
-
if not (0.0 <= calat <= 90.0):
|
15 |
-
|
16 |
-
|
17 |
-
raise HTTPException(status_code=400, detail="Invalid wehth value.")
|
18 |
-
if state not in ["AC", "AL", "AP", ..., "TO"]:
|
19 |
-
raise HTTPException(status_code=400, detail="Invalid state value.")
|
20 |
-
if not (0 <= x <= 100):
|
21 |
-
raise HTTPException(status_code=400, detail="Invalid x value.")
|
22 |
|
23 |
# Process the request and return a response
|
24 |
# ...
|
@@ -83,7 +80,7 @@ class ProductDatabase:
|
|
83 |
results = cursor.fetchall()
|
84 |
return results
|
85 |
|
86 |
-
def calculate(
|
87 |
# データベース接続情報
|
88 |
DATABASE_URL = "postgresql://miyataken999:yz1wPf4KrWTm@ep-odd-mode-93794521.us-east-2.aws.neon.tech/neondb?sslmode=require"
|
89 |
|
@@ -124,12 +121,13 @@ def calculate(x,y,z,c):
|
|
124 |
query_text = "2.03Very GoodJSI2"
|
125 |
|
126 |
#query_text = "2.03-Very Good-J-SI2-62.2-58.0-7.27-7.33-4.55"
|
127 |
-
results = db.search_similar_vectors(
|
128 |
res_all = ""
|
129 |
print("Search results:")
|
130 |
for result in results:
|
131 |
print(result)
|
132 |
res_all += result+""
|
|
|
133 |
|
134 |
finally:
|
135 |
# 接続を閉じる
|
|
|
10 |
router = APIRouter(prefix="/leaning", tags=["leaning"])
|
11 |
@router.get("/route/{calat}/{wehth}/{state}/{x}")
|
12 |
async def route(calat: float, wehth: float, state: str, x: int):
|
13 |
+
|
14 |
+
result = calculate(x,y,z,c)
|
15 |
# Validate input parameters
|
16 |
+
#if not (0.0 <= calat <= 90.0):
|
17 |
+
# raise HTTPException(status_code=400, detail="Invalid calat value.")
|
18 |
+
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
# Process the request and return a response
|
21 |
# ...
|
|
|
80 |
results = cursor.fetchall()
|
81 |
return results
|
82 |
|
83 |
+
def calculate(query:str):
|
84 |
# データベース接続情報
|
85 |
DATABASE_URL = "postgresql://miyataken999:yz1wPf4KrWTm@ep-odd-mode-93794521.us-east-2.aws.neon.tech/neondb?sslmode=require"
|
86 |
|
|
|
121 |
query_text = "2.03Very GoodJSI2"
|
122 |
|
123 |
#query_text = "2.03-Very Good-J-SI2-62.2-58.0-7.27-7.33-4.55"
|
124 |
+
results = db.search_similar_vectors(query)
|
125 |
res_all = ""
|
126 |
print("Search results:")
|
127 |
for result in results:
|
128 |
print(result)
|
129 |
res_all += result+""
|
130 |
+
# send to chat
|
131 |
|
132 |
finally:
|
133 |
# 接続を閉じる
|