-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
63 lines (50 loc) · 1.55 KB
/
main.py
File metadata and controls
63 lines (50 loc) · 1.55 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
"""
Entry point for the bioinformatics agent.
Interactive loop with progressive disclosure of skills.
"""
import os
import sys
from dotenv import load_dotenv
load_dotenv()
from app.orchestrator import Agent
def main():
print("=" * 60)
print(" Bioinformatics Agent")
print(" Progressive Disclosure with SkillToolset")
print("=" * 60)
print()
print("The agent discovers its skills automatically.")
print("Example questions:")
print(' "What skills do you have?"')
print(' "Read the FASTA file and tell me how many organisms there are"')
print(' "What is the GC content of the sequence ATCGATCG?"')
print(' "Translate ATGATGATG to protein"')
print(' "Detect mutation A->G at position 1000 of the first virus"')
print()
print("Type 'exit' to quit.")
print("=" * 60)
print()
api_key = os.environ.get("ANTHROPIC_API_KEY")
if not api_key:
print("ERROR: Set ANTHROPIC_API_KEY in the .env file")
sys.exit(1)
agent = Agent(api_key=api_key)
while True:
try:
question = input("\nYou: ").strip()
except (EOFError, KeyboardInterrupt):
print("\nExiting...")
break
if not question:
continue
if question.lower() in ("sair", "exit", "quit"):
print("Exiting...")
break
print()
try:
response = agent.chat(question)
print(f"\nAgent: {response}")
except Exception as e:
print(f"\nError: {e}")
if __name__ == "__main__":
main()