-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_document.py
More file actions
28 lines (21 loc) · 943 Bytes
/
Copy pathtest_document.py
File metadata and controls
28 lines (21 loc) · 943 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# test_document.py
from tools import file_operations
import json
def process_document(file_path, question):
print(f"Processing document: {file_path}")
print(f"Question: {question}")
# Read the document
read_input = json.dumps({"action": "read", "file_path": file_path})
content = file_operations.invoke(read_input)
if "Error" in content:
print(f"Failed to read document: {content}")
return
print(f"Document Content:\n{content}")
# Manual answer (agent will automate this later)
if "AI automation" in content and "goal" in question.lower():
answer = "The document states the goal is to create a local AI app for code and document tasks."
else:
answer = "No relevant information found for the question."
print(f"Answer: {answer}")
if __name__ == "__main__":
process_document("./docs/report.txt", "What is the goal of the project?")