Spaces:
Sleeping
Sleeping
Update routers/scraping_router.py
Browse files
routers/scraping_router.py
CHANGED
|
@@ -32,9 +32,10 @@ async def generate_cheerio_script(
|
|
| 32 |
try:
|
| 33 |
system_prompt = f"""return cheerio js script to extract {request.user_input} from the following html,
|
| 34 |
enclose the cheerio script in <cheerio_script> .. </cheerio_script> format, {request.html}"""
|
|
|
|
| 35 |
response = ""
|
| 36 |
response = ai_client.chat(
|
| 37 |
-
prompt=
|
| 38 |
system_message=system_prompt,
|
| 39 |
model_id="openai/gpt-4o-mini",
|
| 40 |
api_key=x_api_key
|
|
|
|
| 32 |
try:
|
| 33 |
system_prompt = f"""return cheerio js script to extract {request.user_input} from the following html,
|
| 34 |
enclose the cheerio script in <cheerio_script> .. </cheerio_script> format, {request.html}"""
|
| 35 |
+
user_prompt = "return valid cherio js script enclosed in <cheerio_script> </cheerio_script> format"
|
| 36 |
response = ""
|
| 37 |
response = ai_client.chat(
|
| 38 |
+
prompt=user_prompt,
|
| 39 |
system_message=system_prompt,
|
| 40 |
model_id="openai/gpt-4o-mini",
|
| 41 |
api_key=x_api_key
|