williamcotton / guish

A GUI for constructing and executing Unix pipelines

Repository from Github https://github.comwilliamcotton/guishRepository from Github https://github.comwilliamcotton/guish

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

williamcotton opened this issue · comments

This section of code here:

    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.