File size: 764 Bytes
021e065
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import httpx
import asyncio
import traceback

async def main():
    async with httpx.AsyncClient(timeout=300.0) as client:
        try:
            print("Sending request to http://localhost:9206/api/v1/tax/reason...")
            r = await client.post(
                "http://localhost:9206/api/v1/tax/reason",
                json={
                    "text": "Analyze the compliance implications of the new Finance Bill on digital services tax.",
                    "tier": "D"
                }
            )
            print(f"Status Code: {r.status_code}")
            print(f"Response: {r.text}")
        except Exception as e:
            print("Exception raised:")
            traceback.print_exc()

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