Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 'NodeWithScore' object has no attribute 'node_info'. #36 #37

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions flask_react/flask_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ def query_index():
query_text = request.args.get("text", None)
if query_text is None:
return "No text found, please include a ?text=blah parameter in the URL", 400

response = manager.query_index(query_text)._getvalue()
response_json = {
"text": str(response),
"sources": [{"text": str(x.text),
"sources": [{"text": str(x.text),
"similarity": round(x.score, 2),
"doc_id": str(x.id_),
"start": x.node_info['start'],
"end": x.node_info['end'],
"start": x.node.node_info['start'],
"end": x.node.node_info['end'],
} for x in response.source_nodes]
}
return make_response(jsonify(response_json)), 200
Expand Down