Spaces:
Sleeping
Sleeping
Update agentic.py
Browse files- agentic.py +7 -8
agentic.py
CHANGED
|
@@ -288,7 +288,7 @@ search_tools = [
|
|
| 288 |
|
| 289 |
download_file_tool = [ download_input_file ]
|
| 290 |
|
| 291 |
-
web_search_node_agent =
|
| 292 |
|
| 293 |
def thinking_node(state: State) -> dict:
|
| 294 |
"""
|
|
@@ -371,7 +371,7 @@ Now provide your response immediately without any preamble in text but not in ma
|
|
| 371 |
|
| 372 |
sys_msg = SystemMessage(content=prompt)
|
| 373 |
|
| 374 |
-
code_node_response = [
|
| 375 |
|
| 376 |
code_node_response[-1].pretty_print()
|
| 377 |
|
|
@@ -919,8 +919,8 @@ if __name__ == "__main__":
|
|
| 919 |
|
| 920 |
agent_graph = build_graph()
|
| 921 |
|
| 922 |
-
with open("image.png", "wb") as png:
|
| 923 |
-
|
| 924 |
|
| 925 |
# print(vision_node.__doc__)
|
| 926 |
|
|
@@ -928,10 +928,9 @@ if __name__ == "__main__":
|
|
| 928 |
json_responses = json.loads(responses.read())
|
| 929 |
|
| 930 |
json_questions = [{
|
| 931 |
-
"
|
| 932 |
-
"
|
| 933 |
-
"
|
| 934 |
-
"file_name": ""
|
| 935 |
}]
|
| 936 |
|
| 937 |
# with open("questions.json", "r") as questions:
|
|
|
|
| 288 |
|
| 289 |
download_file_tool = [ download_input_file ]
|
| 290 |
|
| 291 |
+
web_search_node_agent = general_model.bind_tools(search_tools, parallel_tool_calls=False)
|
| 292 |
|
| 293 |
def thinking_node(state: State) -> dict:
|
| 294 |
"""
|
|
|
|
| 371 |
|
| 372 |
sys_msg = SystemMessage(content=prompt)
|
| 373 |
|
| 374 |
+
code_node_response = [general_model.invoke([sys_msg])]
|
| 375 |
|
| 376 |
code_node_response[-1].pretty_print()
|
| 377 |
|
|
|
|
| 919 |
|
| 920 |
agent_graph = build_graph()
|
| 921 |
|
| 922 |
+
# with open("image.png", "wb") as png:
|
| 923 |
+
# png.write(agent_graph.get_graph(xray=True).draw_mermaid_png(draw_method=MermaidDrawMethod.PYPPETEER))
|
| 924 |
|
| 925 |
# print(vision_node.__doc__)
|
| 926 |
|
|
|
|
| 928 |
json_responses = json.loads(responses.read())
|
| 929 |
|
| 930 |
json_questions = [{
|
| 931 |
+
"question": "The attached Excel file contains the sales of menu items for a local fast-food chain. What were the total sales that the chain made from food (not including drinks)? Express your answer in USD with two decimal places.",
|
| 932 |
+
"file_name": "7bd855d8-463d-4ed5-93ca-5fe35145f733.xlsx",
|
| 933 |
+
"task_id": "7bd855d8-463d-4ed5-93ca-5fe35145f733"
|
|
|
|
| 934 |
}]
|
| 935 |
|
| 936 |
# with open("questions.json", "r") as questions:
|