Refactor AI Assistant code
Related to #8
Refactor `AiAssistants.run` to return `ChatCompletionMessageParam[]` instead of modifying `updatedChatHistory` directly.
* **src/AiAssistants.ts**
- Modify `AiAssistants.run` to return a `ChatCompletionMessageParam[]`.
- Update the function signature and implementation to reflect the return type.
* **src/ai-assistants/postgresAssistant.ts**
- Modify `postgresAssistant` to return a `ChatCompletionMessageParam[]`.
- Update the function signature and implementation to reflect the return type.
* **src/useAIAssistant.ts**
- Update the call to `AiAssistants.run` to use the returned chat history.
- Adjust the function implementation to handle the returned chat history.
* **src/ai-assistants/postgresAssistant.test.ts**
- Update tests to reflect the changes in `postgresAssistant`.
- Adjust the test cases to handle the returned chat history.
---
For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/williamcotton/guish/issues/8?shareId=276841fd-2fe9-4709-95f9-d460dac43dbd).
合并状态:已合并 合并于 2024-08-01 关闭于 2024-08-01 0 条评论