I need to make an llm which have a basic response when all the documents has a similarity score less then 0.75…in order to do that i use llama but i can t acces score to compare it and see if is over 0.75 i put the response from chatgpt or if it is less to respond with a basic response . The output is the following :
{
"response": "Yes, an operator economic has the right to participate in a restricted auction by submitting their candidacy and subsequently an offer. However, only the economic operators selected by the contracting authority during the evaluation of the candidacy stage can later submit an offer.",
"source_nodes": [
{
"node": {
"id_": "25e8b46c-4f8a-4927-8392-b45edcb736fa",
"embedding": null,
"metadata": {
"file_path": "",
"file_name": "filename.txt",
"file_type": "text/plain",
"file_size": 66668,
"creation_date": "2024-07-16",
"last_modified_date": "2024-07-11"
},
"excluded_embed_metadata_keys": [
"file_name",
"file_type",
"file_size",
"creation_date",
"last_modified_date",
"last_accessed_date"
],
"excluded_llm_metadata_keys": [
"file_name",
"file_type",
"file_size",
"creation_date",
"last_modified_date",
"last_accessed_date"
],
"relationships": {
"1": {
"node_id": "0208b3aa-c5cd-455d-8592-fe8aeb31b933",
"node_type": "4",
"metadata": {
"file_path": "",
"file_name": "",
"file_type": "text/plain",
"file_size": 66668,
"creation_date": "2024-07-16",
"last_modified_date": "2024-07-11"
},
"hash": "ffb015cf81a0882e3032c1c84cfaf07185fbbf783420ee118b7645d02b509b8a"
},
"2": {
"node_id": "f8a709ba-1940-4e6e-8f77-6fcfbb132751",
"node_type": "1",
"metadata": {
"file_path": "",
"file_name": "",
"file_type": "text/plain",
"file_size": 66668,
"creation_date": "2024-07-16",
"last_modified_date": "2024-07-11"
},
"hash": "dd56e44a5e11afead6470fb4a46c9ec883d1280ca6402db4e16479737a2bd3d1"
},
"3": {
"node_id": "395520d8-f637-43a4-b630-6d3c6b8f1243",
"node_type": "1",
"metadata": {},
"hash": "2e1b2013b15a72bcf86f0b46d666939ce75a846d241820b3407e05e2efdab4db"
}
},
"text": "some respnse",
"mimetype": "text/plain",
"start_char_idx": 15417,
"end_char_idx": 18135,
"text_template": "{metadata_str}nn{content}",
"metadata_template": "{key}: {value}",
"metadata_seperator": "n"
},
"score": 0.7998855724690058
}
}
So my question is how should i get the score of each document or how i convert the <class ‘llama_index.core.base.response.schema.Response’> into json ?