Skip to content

Commit

Permalink
exclude embeddings only
Browse files Browse the repository at this point in the history
  • Loading branch information
Sosek1 committed Sep 29, 2024
1 parent 882b08b commit a715222
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions api.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,16 @@ def knn_search():

@app.route('/list-ngos', methods=['GET'])
def get_ngos():
# Get the array of UUIDs from the query parameters
uuids = request.args.getlist('uuid')

# Filter ngos_data to find objects that match the given UUIDs and exclude specific fields
matched_ngos = [
{
'ID': ngo['ID'],
'name': ngo['Nazwa Organizacji'],
'location': ngo['Lokacja'],
'bio': ngo['Opis']
}
{k: v for k, v in ngo.items() if k not in ['combined', 'n_tokens', 'embedding']}
for ngo in json_data if ngo['ID'] in uuids
]


# Return the matched objects as JSON
return jsonify(matched_ngos)


Expand Down

0 comments on commit a715222

Please sign in to comment.