Update agent.py
Browse files
agent.py
CHANGED
|
@@ -33,14 +33,14 @@ def build_gemini_llm():
|
|
| 33 |
raise ValueError("GOOGLE_API_KEY environment variable is not set.")
|
| 34 |
return ChatGoogleGenerativeAI(model = "gemini-3.7-flash", temperature = 0, max_output_tokens = 1025, include_thoughts=True)
|
| 35 |
|
| 36 |
-
@tool
|
| 37 |
-
def web_search(query:str) -> str:
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
|
| 45 |
@tool
|
| 46 |
def extract_text_from_image(img_path: str) -> str:
|
|
@@ -185,7 +185,7 @@ def wikipedia_search(query: str):
|
|
| 185 |
print(f"Wikipedia search failed for {query}: {e}")
|
| 186 |
return f"Wikipedia search failed for {query} due to {str(e)}."
|
| 187 |
|
| 188 |
-
|
| 189 |
model = build_gemini_llm()
|
| 190 |
tools = [
|
| 191 |
extract_text_from_image,
|
|
|
|
| 33 |
raise ValueError("GOOGLE_API_KEY environment variable is not set.")
|
| 34 |
return ChatGoogleGenerativeAI(model = "gemini-3.7-flash", temperature = 0, max_output_tokens = 1025, include_thoughts=True)
|
| 35 |
|
| 36 |
+
# @tool
|
| 37 |
+
# def web_search(query:str) -> str:
|
| 38 |
+
# """
|
| 39 |
+
# Searches the web for the answer to a given question or topic using DuckDuckGoSearchRun.
|
| 40 |
+
# Args:
|
| 41 |
+
# query (str): the question or topic to search for.
|
| 42 |
+
# """
|
| 43 |
+
# return DuckDuckGoSearchRun()
|
| 44 |
|
| 45 |
@tool
|
| 46 |
def extract_text_from_image(img_path: str) -> str:
|
|
|
|
| 185 |
print(f"Wikipedia search failed for {query}: {e}")
|
| 186 |
return f"Wikipedia search failed for {query} due to {str(e)}."
|
| 187 |
|
| 188 |
+
web_search = DuckDuckGoSearchRun()
|
| 189 |
model = build_gemini_llm()
|
| 190 |
tools = [
|
| 191 |
extract_text_from_image,
|