You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Search functions now return funny values for the content field.
defsearch(cursor, query_embedding):
"""Search matching documents with a given query and return a dict."""data= {
'text': ' '.join(sys.argv[1:]),
'query_embedding': query_embedding,
'match_threshold': 0.5,
'match_count': 10,
'weights': json.dumps(FINESSE_JSON_PARSED_WEIGHTS)
}
cursor.execute(""" SELECT * FROM search(%(text)s, %(query_embedding)s::vector, %(match_threshold)s, %(match_count)s, %(weights)s::JSONB) """, data)
# turn into list of dict now to preserve dictionariesresults=cursor.fetchall()
frompprintimportpprintpprint(results)
return [dict(r) forrinresults[0]["search"]]
The chunk's full text or snippet is expected to be received in the content field.
The subtitle values also look funny, although I'm not sure what is supposed to be received there.
I suggest we receive the value (list of results) of the search field instead of [ { "search": [...] } ]
For comparison we receive this from azure-db:
[
{
"content": "Kochhar\n\n\n CFIA <strong>President</strong>\n Dr.",
"id": "ZGI2M2VmNjktNTVmMC00ODQ2LThlZWItZDljYTYwZDMwNTI10",
"last_updated": "2023-04-18T00:00:00Z",
"score": 8.465198,
"title": "Dr. Harpreet S. Kochhar - Canadian Food Inspection Agency",
"url": "https://inspection.canada.ca/about-cfia/organizational-structure/cfia-president/eng/1681496883837/1681496884212",
},
{
"content": "<strong>The</strong> CFIA is headed by a ""<strong>President</strong>, who has <strong>the</strong> rank ""and all <strong>the</strong> powers of a Deputy Head of a ""Department.",
"id": "ZDg1YzNlMjEtMzhjMS00NTQ2LWFhYTEtM2ZjOWUyOTZmZWFm0",
"last_updated": "2017-08-28T00:00:00Z",
"score": 8.322858,
"title": "Canadian Food Inspection Agency (CFIA) - Quarterly Financial ""Report (QFR) for the Quarter ended June 30, 2017 - Canadian Food ""Inspection Agency",
"url": "https://inspection.canada.ca/about-cfia/transparency/corporate-management-reporting/reports-to-parliament/financial-reporting/quarter-ended-june-30-2017/eng/1502989987656/1502989988316",
},
]
Acceptance criteria
Full text or relevant snippet is received in the content field
The text was updated successfully, but these errors were encountered:
Description
Search functions now return funny values for the
content
field.Printed value for "who's the president?"
content
field.search
field instead of[ { "search": [...] } ]
For comparison we receive this from azure-db:
Acceptance criteria
content
fieldThe text was updated successfully, but these errors were encountered: