Add prints and logging
Browse files
app.py
CHANGED
|
@@ -67,11 +67,15 @@ class BasicAgent:
|
|
| 67 |
def assistant(self, state: State):
|
| 68 |
# System message
|
| 69 |
textual_description_of_tool="""
|
| 70 |
-
search_tool(question: str) -> str:
|
| 71 |
Search info in the web.
|
|
|
|
|
|
|
|
|
|
| 72 |
|
| 73 |
Args:
|
| 74 |
question: Question string
|
|
|
|
| 75 |
|
| 76 |
Returns:
|
| 77 |
A single string containing the info from the web.
|
|
@@ -100,7 +104,9 @@ class BasicAgent:
|
|
| 100 |
A single string containing the info from the web.
|
| 101 |
"""
|
| 102 |
search = DuckDuckGoSearchRun()
|
| 103 |
-
|
|
|
|
|
|
|
| 104 |
|
| 105 |
|
| 106 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
|
|
| 67 |
def assistant(self, state: State):
|
| 68 |
# System message
|
| 69 |
textual_description_of_tool="""
|
| 70 |
+
search_tool(question: str, max_length: int = 1024) -> str:
|
| 71 |
Search info in the web.
|
| 72 |
+
Call example:
|
| 73 |
+
|
| 74 |
+
self.search_tool("Who won the election 2008 in the USA?", max_length = 4096)
|
| 75 |
|
| 76 |
Args:
|
| 77 |
question: Question string
|
| 78 |
+
max_length: maximum chars in the output (if exceeded the first "max_length" characters will be taken)
|
| 79 |
|
| 80 |
Returns:
|
| 81 |
A single string containing the info from the web.
|
|
|
|
| 104 |
A single string containing the info from the web.
|
| 105 |
"""
|
| 106 |
search = DuckDuckGoSearchRun()
|
| 107 |
+
res = search.invoke(question)
|
| 108 |
+
print("Search res:", res)
|
| 109 |
+
return res[:max_length]
|
| 110 |
|
| 111 |
|
| 112 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|