Update agent.py
Browse files
agent.py
CHANGED
@@ -87,7 +87,7 @@ def answer_question(question: str, task_id: str = None) -> str:
|
|
87 |
yt = get_youtube_transcript(question)
|
88 |
file_context += f"\n[YouTube Transcript] {yt}"
|
89 |
elif "* on the set" in question and file_context:
|
90 |
-
|
91 |
import re
|
92 |
import pandas as pd
|
93 |
|
@@ -106,6 +106,8 @@ def answer_question(question: str, task_id: str = None) -> str:
|
|
106 |
non_comm.add(a)
|
107 |
non_comm.add(b)
|
108 |
result = ", ".join(sorted(non_comm))
|
109 |
-
file_context += f"
|
|
|
110 |
except Exception as e:
|
111 |
-
file_context += f"
|
|
|
|
87 |
yt = get_youtube_transcript(question)
|
88 |
file_context += f"\n[YouTube Transcript] {yt}"
|
89 |
elif "* on the set" in question and file_context:
|
90 |
+
# Parse table to extract non-commutative elements
|
91 |
import re
|
92 |
import pandas as pd
|
93 |
|
|
|
106 |
non_comm.add(a)
|
107 |
non_comm.add(b)
|
108 |
result = ", ".join(sorted(non_comm))
|
109 |
+
file_context += f"
|
110 |
+
[Parsed Non-Commutative Set] {result}"
|
111 |
except Exception as e:
|
112 |
+
file_context += f"
|
113 |
+
[Table Parse Error] {e}"
|