Spaces:
Sleeping
Sleeping
Update agentic.py
Browse files- agentic.py +8 -7
agentic.py
CHANGED
@@ -473,7 +473,7 @@ Now provide your response immediately without any preamble.
|
|
473 |
"data": image_base64,
|
474 |
}
|
475 |
|
476 |
-
vision_provider = "mistral"
|
477 |
|
478 |
if vision_provider == "openai":
|
479 |
image_handling = openai_image_handling
|
@@ -762,7 +762,7 @@ Now provide your response immediately respecting this format: 'next node: \'the
|
|
762 |
"""
|
763 |
|
764 |
downloaded = ""
|
765 |
-
# If there's an input file, download it
|
766 |
if state.get("input_file", None):
|
767 |
downloaded = download_input_file(state.get("task_id"))
|
768 |
|
@@ -772,7 +772,7 @@ Now provide your response immediately respecting this format: 'next node: \'the
|
|
772 |
|
773 |
entry_node_response[-1].pretty_print()
|
774 |
|
775 |
-
regex_result = re.search(r'.*next\snode:\s+(?P<next_node
|
776 |
|
777 |
next_node = "END"
|
778 |
if regex_result:
|
@@ -837,10 +837,11 @@ if __name__ == "__main__":
|
|
837 |
|
838 |
# print(vision_node.__doc__)
|
839 |
|
840 |
-
input =
|
841 |
-
"task_id": "
|
842 |
-
"question": "
|
843 |
-
"
|
|
|
844 |
}
|
845 |
|
846 |
question = input.get("question", "No question found")
|
|
|
473 |
"data": image_base64,
|
474 |
}
|
475 |
|
476 |
+
vision_provider = os.getenv("VLM_PROVIDER", "mistral")
|
477 |
|
478 |
if vision_provider == "openai":
|
479 |
image_handling = openai_image_handling
|
|
|
762 |
"""
|
763 |
|
764 |
downloaded = ""
|
765 |
+
# If there's an input file, download it directlynext node:
|
766 |
if state.get("input_file", None):
|
767 |
downloaded = download_input_file(state.get("task_id"))
|
768 |
|
|
|
772 |
|
773 |
entry_node_response[-1].pretty_print()
|
774 |
|
775 |
+
regex_result = re.search(r'.*next\snode:\s+(?P<next_node>[a-z_]*)$', entry_node_response[-1].content)
|
776 |
|
777 |
next_node = "END"
|
778 |
if regex_result:
|
|
|
837 |
|
838 |
# print(vision_node.__doc__)
|
839 |
|
840 |
+
input = {
|
841 |
+
"task_id": "cca530fc-4052-43b2-b130-b30968d8aa44",
|
842 |
+
"question": "Review the chess position provided in the image. It is black's turn. Provide the correct next move for black which guarantees a win. Please provide your response in algebraic notation.",
|
843 |
+
"Level": "1",
|
844 |
+
"file_name": "cca530fc-4052-43b2-b130-b30968d8aa44.png"
|
845 |
}
|
846 |
|
847 |
question = input.get("question", "No question found")
|