Start a Recall Trace

Start a recall trace against a source.

1from reasoner import Reasoner
2
3r = Reasoner(api_key=”foobar”)
4
5... # Add files and urls, build index
6
7# Recall query on the index (blocking call)
8response = r.recall('this is the question', index.uid, source.uid, wait=True)
9
10# Recall query on the index (non-blocking call)
11response_uid = r.recall('this is the question', index.uid, source.uid)
12
13answer = None
14while True:
15 response = r.traces.get(response_uid)
16 if response['status'] == 'success':
17 answer = response.response
18 break
19 else:
20 # decide whether to show partial answer
21 continue