Reduce entity lookup context and configure reasoning effort
This commit is contained in:
1 parent
645cc2e490
commit
79a6934b9e
11 files changed
+166
-17
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_v2':
|
||||
if request['prompt_version']=='entity_resolution_plan_v3':
|
||||
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_v2':
|
||||
elif request['prompt_version']=='entity_resolution_assessment_v3':
|
||||
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