Get Trace

Get the response of a trace.

1from reasoner import Reasoner
2
3r = Reasoner(api_key=”foobar”)
4
5... # start a non-blocking trace and record the response_uid
6
7answer = None
8while True:
9 response = r.traces.get(response_uid)
10 if response['status'] == 'success':
11 answer = response["response"]
12 break
13 else:
14 # decide whether to show partial answer
15 # or sleep before checking status again
16 continue