Add postgres database context to chatbot integration
Related to #3
Add logic to fetch and include database schema information in system messages when a `pgPlugin` module is utilized.
* **App.tsx**
- Add logic to fetch database schema information when a `pgPlugin` module is utilized.
- Update the `handleSendMessage` function to include database schema information in the system messages.
- Update the `contextMessage` to include the database schema information.
* **pgPlugin.tsx**
- Update the `PgComponent` to fetch and store database schema information.
- Add `schemaInfo` property to `PgModuleType` and `PgComponentProps`.
- Add `useEffect` to fetch schema information when database configuration changes.
* **main.ts**
- Add a function to query the database schema using the provided SQL query.
- Update the `ipcMain.handle` to include a handler for fetching the database schema.
* **preload.ts**
- Expose the method to fetch the database schema to the app.
- Update the `contextBridge.exposeInMainWorld` to include the new method.
---
For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/williamcotton/guish/issues/3?shareId=bd067e4b-689f-46c2-9067-6d6a8d98533d).
合并状态:未合并 关闭于 2024-07-30 0 条评论