sqlgen nb
1.0.0
使用本地 gen AI 通过 IBM Granite Code LLM、Ollama on Juypter Notebook 从自然语言编写 PostgreSQL 查询。
受到 Anthropic 提到的一个用例的启发——但它是一个具有最少设置的本地实现。
Jupyter 笔记本 https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter
浪链 https://python.langchain.com/docs/how_to/installation/
奥拉玛 https://ollama.com/download
在终端中拉取IBM Granite Code
模型:
ollama pull granite-code:8b-instruct
sqlgen.ipynb
schema =
中输入您的数据库架构user_prompt =
中输入您的问题Run all
以运行 Juypter Notebook 中的所有单元格Gen AI 是不确定性的。使用相同的用户提示,每次都会生成略有不同的完成结果。使用前请确认。
因为这涉及到 LLM 与数据库的交互。这些代码可以在多代理工作流程中的数据库代理中重用。