ITADN

Get pg connection info from pgPlugin and use to call getPgSchema in App

#6Closedwilliamcotton 创建于 2024-07-30
W
williamcottoncommented
This section of code here: ```ts const newMessage: ChatCompletionMessageParam = { role: "user", content: store.inputMessage, }; const contextMessage: ChatCompletionMessageParam = { role: "system", content: `Current bash command: ${store.inputCommand}`, }; const outputMessages: ChatCompletionMessageParam[] = store.outputs.map( (output, i) => ({ role: "system", content: `Module ${i + 1} output: ${output.slice(0, 100)}...`, }) ); const updatedChatHistory = [...store.chatHistory, contextMessage, ...outputMessages, newMessage]; ``` Updates the chat history. connection info from any pg module. Then we want to include this pg schema info in the system message of the updated chatHistory. We only need to include this schema info once so we shouldn't add it if it is already part of the chat history.
关闭于 2024-07-30 0 条评论