avsolatorio commited on
Commit
d617788
·
1 Parent(s): 0c13494

Fix output format

Browse files

Signed-off-by: Aivin V. Solatorio <avsolatorio@gmail.com>

Files changed (1) hide show
  1. services.py +2 -2
services.py CHANGED
@@ -99,7 +99,7 @@ def search_relevant_indicators(
99
 
100
  return {
101
  "indicators": [
102
- SearchOutput(**out)
103
  for out in get_top_k(query=query, top_k=top_k, fields=["idno", "name"])
104
  ],
105
  "note": "IMPORTANT: Let the user know that the search is not exhaustive. The search is based on the semantic similarity of the query to the indicator definitions. It may not be optimal and the LLM may use this as shortlist and pick the most relevant from the list (if any).",
@@ -119,7 +119,7 @@ def indicator_info(indicator_ids: list[str]) -> list[DetailedOutput]:
119
  indicator_ids = [indicator_ids]
120
 
121
  return [
122
- DetailedOutput(**out)
123
  for out in df.loc[indicator_ids][
124
  ["idno", "name", "definition", "time_coverage", "geographic_coverage"]
125
  ].to_dict("records")
 
99
 
100
  return {
101
  "indicators": [
102
+ SearchOutput(**out).model_dump()
103
  for out in get_top_k(query=query, top_k=top_k, fields=["idno", "name"])
104
  ],
105
  "note": "IMPORTANT: Let the user know that the search is not exhaustive. The search is based on the semantic similarity of the query to the indicator definitions. It may not be optimal and the LLM may use this as shortlist and pick the most relevant from the list (if any).",
 
119
  indicator_ids = [indicator_ids]
120
 
121
  return [
122
+ DetailedOutput(**out).model_dump()
123
  for out in df.loc[indicator_ids][
124
  ["idno", "name", "definition", "time_coverage", "geographic_coverage"]
125
  ].to_dict("records")