# jupytee - magics for using GPT-like models inside Jupyter

## Usage

To load the extension, use

`%load_ext jupytee`

1. Explore the database:

```jupyter
%explore_db tpch
```

2. AI Chat for exploring:

```jupyter
%aichat Let's start our data exploring travel. If you are ready respond ok
```

3. Generate SQL by prompt question:

```jupyter
%chat2sql find top 5 supplier in orders
```

4. Paste the SQL into shell:

```jupyter
%pastesql
```


* context.py context 的读写接口
* openai.py 访问 gpt4 并且管理 prompt template 的接口，后续embedding 的动作也在这个文件内
* data_explore.py, ai_task.py 各个不同阶段的 magic function 实现
* jupytee.py 暴露给 jupyter notebook 类的 MagicClass 包装实现
* mock.py mock magic function 实现，方便测试