{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Import the function in main.py" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import sys\n", "import os\n", "sys.path.append(os.path.dirname(os.path.dirname(os.getcwd())))\n", "\n", "%load_ext autoreload\n", "%autoreload 2\n", "\n", "from climateqa.engine.talk_to_data.main import ask_vanna\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Create a human query" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "query = \"Comment vont évoluer les températures à marseille ?\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Call the function ask vanna, it gives an output of a the sql query and the dataframe of the result (tuple)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sql_query, df, fig = ask_vanna(query)\n", "print(df.head())\n", "fig.show()" ] } ], "metadata": { "kernelspec": { "display_name": "climateqa", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.9" } }, "nbformat": 4, "nbformat_minor": 2 }