-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli.py
29 lines (22 loc) · 897 Bytes
/
cli.py
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
29
from Orquestra import graph, HumanMessage
from prettyprint import stream_agent_execution
import argparse
import sys
def main():
parser = argparse.ArgumentParser(description='Run financial analysis workflow')
parser.add_argument('query', type=str, nargs='?', help='Analysis query (e.g., "Analyze PETR4\'s financials")')
parser.add_argument('--recursion-limit', type=int, default=10, help='Maximum recursion depth')
args = parser.parse_args()
# If no query provided, read from stdin
if not args.query:
if sys.stdin.isatty():
parser.print_help()
return
args.query = sys.stdin.read().strip()
input_data = {
"messages": [HumanMessage(content=args.query)]
}
config = {"recursion_limit": args.recursion_limit}
stream_agent_execution(graph, input_data, config)
if __name__ == "__main__":
main()