WildOjisan commited on
Commit
f6000f0
ยท
1 Parent(s): 40b8c49
Files changed (2) hide show
  1. requirements.txt +1 -0
  2. routers/llm_router.py +11 -2
requirements.txt CHANGED
@@ -6,3 +6,4 @@ python-jose[cryptography]
6
  pydantic
7
  sqlalchemy
8
  psycopg[binary]
 
 
6
  pydantic
7
  sqlalchemy
8
  psycopg[binary]
9
+ requests
routers/llm_router.py CHANGED
@@ -1,6 +1,7 @@
1
  """
2
  https://chatgpt.com/share/6a03d706-d848-83a9-b06d-d0a7fb83b79d
3
  """
 
4
  from fastapi import APIRouter, Form, File, UploadFile
5
  from utils.common import CommonResponse
6
  from utils.db import get_connection
@@ -53,7 +54,12 @@ def test_home(userquery: str = Form("")):
53
  "messages": [
54
  {
55
  "role": "system",
56
- "content": "๋‹น์‹ ์€ ์นœ์ ˆํ•œ ํƒ€๋กœ ์ƒ๋‹ด์‚ฌ์ž…๋‹ˆ๋‹ค. ์ดˆ๋ณด์ž๋„ ์ดํ•ดํ•˜๊ธฐ ์‰ฝ๊ฒŒ ํ•œ๊ตญ์–ด๋กœ ๋‹ต๋ณ€ํ•˜์„ธ์š”."
 
 
 
 
 
57
  },
58
  {
59
  "role": "user",
@@ -61,7 +67,7 @@ def test_home(userquery: str = Form("")):
61
  }
62
  ],
63
  "temperature": 0.8,
64
- "max_tokens": 800,
65
  "stream": False
66
  }
67
 
@@ -76,6 +82,9 @@ def test_home(userquery: str = Form("")):
76
  )
77
 
78
  result = response.json()
 
 
 
79
 
80
  # 5. AI ์‘๋‹ต ํ…์ŠคํŠธ ๊บผ๋‚ด๊ธฐ
81
  answer = result["choices"][0]["message"]["content"]
 
1
  """
2
  https://chatgpt.com/share/6a03d706-d848-83a9-b06d-d0a7fb83b79d
3
  """
4
+ import requests
5
  from fastapi import APIRouter, Form, File, UploadFile
6
  from utils.common import CommonResponse
7
  from utils.db import get_connection
 
54
  "messages": [
55
  {
56
  "role": "system",
57
+ "content": """
58
+ ๋‹น์‹ ์€ ์นœ์ ˆํ•œ ํƒ€๋กœ ์ƒ๋‹ด์‚ฌ์ž…๋‹ˆ๋‹ค.
59
+ ๋ฐ˜๋“œ์‹œ ํ•œ๊ตญ์–ด๋กœ ๋‹ต๋ณ€ํ•˜์„ธ์š”.
60
+ ๋‹ต๋ณ€์€ 5๋ฌธ์žฅ ์ด๋‚ด๋กœ ์งง๊ฒŒ ํ•˜์„ธ์š”.
61
+ ๋ณต์žกํ•œ ์„ค๋ช…์€ ํ•˜์ง€ ๋งˆ์„ธ์š”.
62
+ """
63
  },
64
  {
65
  "role": "user",
 
67
  }
68
  ],
69
  "temperature": 0.8,
70
+ "max_tokens": 4000,
71
  "stream": False
72
  }
73
 
 
82
  )
83
 
84
  result = response.json()
85
+ print("========== Pollinations raw result ==========")
86
+ print(result)
87
+ print("============================================")
88
 
89
  # 5. AI ์‘๋‹ต ํ…์ŠคํŠธ ๊บผ๋‚ด๊ธฐ
90
  answer = result["choices"][0]["message"]["content"]