MCPcopy Create free account
hub / github.com/caesarHQ/textSQL / get_suggestion

Function get_suggestion

api/app/api/routes.py:162–175  ·  view source on GitHub ↗

Get suggested query, to build on top of a given query or as a similar query

()

Source from the content-addressed store, hash-verified

160
161@bp.route('/get_suggestion', methods=['POST'])
162def get_suggestion():
163 """
164 Get suggested query, to build on top of a given query or as a similar query
165 """
166 request_body = request.get_json()
167 natural_language_query = request_body.get("natural_language_query")
168 scope = request_body.get("scope", "USA")
169 parent_id = request_body.get("generation_id")
170 session_id = request_body.get("session_id")
171 if session_id in ["", "None", "null" ]:
172 session_id = None
173
174 suggested_query, generation_id = generate_suggestion(scope, natural_language_query, parent_id, session_id)
175 return make_response(jsonify({"suggested_query": suggested_query, "generation_id": generation_id}), 200)
176
177
178@bp.route('/execute_sql', methods=['POST'])

Callers

nothing calls this directly

Calls 1

generate_suggestionFunction · 0.85

Tested by

no test coverage detected