Skip to content

Commit

Permalink
fix for colab create_function
Browse files Browse the repository at this point in the history
  • Loading branch information
zainhoda committed Jun 7, 2024
1 parent 202d730 commit eb07108
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
9 changes: 3 additions & 6 deletions src/vanna/flask/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,13 +585,10 @@ def add_training_data(user: any):
print("TRAINING ERROR", e)
return jsonify({"type": "error", "error": str(e)})

@self.flask_app.route("/api/v0/create_function", methods=["POST"])
@self.flask_app.route("/api/v0/create_function", methods=["GET"])
@self.requires_auth
def create_function(user: any):
question = flask.request.json.get("question")
sql = flask.request.json.get("sql")
id = flask.request.json.get("id")

@self.requires_cache(["question", "sql"])
def create_function(user: any, id: str, question: str, sql: str):
plotly_code = self.cache.get(id=id, field="plotly_code")

if plotly_code is None:
Expand Down
Loading

0 comments on commit eb07108

Please sign in to comment.