Skip to content

Instantly share code, notes, and snippets.

@veekaybee
Created July 31, 2023 20:18
Show Gist options
  • Save veekaybee/fdaeb6ca5b564227e7cfe6fe2c364b41 to your computer and use it in GitHub Desktop.
Save veekaybee/fdaeb6ca5b564227e7cfe6fe2c364b41 to your computer and use it in GitHub Desktop.
# this allows us to build a query string as well as use the search box
@app.route("/search", methods=["POST", "GET"])
def search() -> str:
word = None
if request.method == "POST":
word = request.form.get("query", "")
elif request.method == "GET":
word = request.args.get("query", "")
return get_model_results(word, retriever)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment