Expose entity resolution response schemas to JSON object providers
This commit is contained in:
1 parent
4fa7fb6e74
commit
4c73b00494
6 files changed
+92
-12
No files matched your search
@@ -75,12 +75,12 @@ def test_real_contextual_identity_resolution_with_fixture_llm(service, tmp_path)
|
||||
async def generate(self, config, request, *, max_response_bytes):
|
||||
self.calls.append(request['prompt_version'])
|
||||
data=json.loads(request['messages'][1]['content'])
|
||||
if request['prompt_version']=='entity_resolution_plan_v1':
|
||||
if request['prompt_version']=='entity_resolution_plan_v2':
|
||||
self.mention=next(k for k,v in data['context']['sources'].items() if v['kind']=='fact'
|
||||
and v['data'].get('name')=='project_description'
|
||||
and 'Wild Wolpertinger' in json.dumps(v['data']['value']))
|
||||
doc={'searches':[{'catalog':'creatures','term':'Wild Wolpertinger','role':'affected_subject','source_ids':[self.mention]}]}
|
||||
elif request['prompt_version']=='entity_resolution_assessment_v1':
|
||||
elif request['prompt_version']=='entity_resolution_assessment_v2':
|
||||
candidates=data['candidates']
|
||||
assert len(candidates)==1 and candidates[0]['id']=='23487'
|
||||
assert data['captures']['V0001']['result']['items'][0]['row']['name']=='Wild Wolpertinger'
|
||||
|
||||
Reference in new issue
Block a user