Spaces:
Sleeping
Sleeping
ajout du prompt
Browse files
agent.py
CHANGED
|
@@ -47,6 +47,15 @@ def arvix_search(query: str) -> str:
|
|
| 47 |
return {"arvix_results": formatted_search_docs}
|
| 48 |
|
| 49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
@tool
|
| 51 |
def web_search_openai_tool(query: str) -> str:
|
| 52 |
"""Call web search and the output is a structured text answering the query)
|
|
@@ -56,7 +65,7 @@ def web_search_openai_tool(query: str) -> str:
|
|
| 56 |
response = client.responses.create(
|
| 57 |
model="gpt-4o",
|
| 58 |
tools=[{"type": "web_search_preview"}],
|
| 59 |
-
input=
|
| 60 |
)
|
| 61 |
|
| 62 |
return {"web_results": response.output_text}
|
|
|
|
| 47 |
return {"arvix_results": formatted_search_docs}
|
| 48 |
|
| 49 |
|
| 50 |
+
|
| 51 |
+
prompt_web="""
|
| 52 |
+
"You are a websearch agent.\n\n"
|
| 53 |
+
"INSTRUCTIONS:\n"
|
| 54 |
+
"- Assist ONLY with internet related tasks. DO NOT do any math\n"
|
| 55 |
+
"- After you're done with your tasks, respond to the supervisor directly\n"
|
| 56 |
+
"- Respond ONLY with the results of your work, do NOT include ANY other text."
|
| 57 |
+
"- You can browse the web then give your results to your supervisor "
|
| 58 |
+
"""
|
| 59 |
@tool
|
| 60 |
def web_search_openai_tool(query: str) -> str:
|
| 61 |
"""Call web search and the output is a structured text answering the query)
|
|
|
|
| 65 |
response = client.responses.create(
|
| 66 |
model="gpt-4o",
|
| 67 |
tools=[{"type": "web_search_preview"}],
|
| 68 |
+
input=prompt_web + query
|
| 69 |
)
|
| 70 |
|
| 71 |
return {"web_results": response.output_text}
|