File size: 648 Bytes
158d846
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import asyncio
import os

from amp_sdk import AmpOptions, execute

prompt = """
what account am I logged in as?
"""


async def main():
    # Use the toolbox directory to share tools with Amp
    toolbox_dir = os.path.join(os.getcwd(), "toolbox")
    messages = []
    async for message in execute(
        prompt,
        AmpOptions(
            cwd=os.getcwd(),
            toolbox=toolbox_dir,
            visibility="workspace",
            dangerously_allow_all=True,
        ),
    ):
        messages.append(message)

    for msg in messages:
        print(msg.model_dump_json(indent=2))


if __name__ == "__main__":
    asyncio.run(main())