File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 2020})
2121
2222try :
23+ # Warm up the APIM instance prior to the first meaningful request.
24+ apim_status_url = f"{ apim_resource_gateway_url } /status-0123456789abcdef"
25+ print (f"🔥 Warming up the APIM instance with a GET request to { apim_status_url } " )
26+ response = session .get (apim_status_url )
27+ print (f"Response status: { response .status_code } \n " )
28+
2329 for i in range (runs ):
2430 print (f"▶️ Run { i + 1 } /{ runs } :" )
2531
Original file line number Diff line number Diff line change 2424 response_time = time .time () - start_time
2525 print (f"⌚ { response_time :.2f} seconds" )
2626 if response .usage :
27- print (f"Token usage: Total tokens: { response .usage .total_tokens } ( Prompt tokens: { response .usage .prompt_tokens } & Completion tokens: { response .usage .completion_tokens } ) " )
27+ print (f"Token usage:\n Total tokens: { response .usage .total_tokens } \n Prompt tokens: { response .usage .prompt_tokens } \n Completion tokens: { response .usage .completion_tokens } \n " )
2828 print (f"💬 { response .choices [0 ].message .content } \n " )
2929
3030 time .sleep (sleep_time_ms / 1000 )
You can’t perform that action at this time.
0 commit comments