OpenAI/Chat GPT Integration

Built-in OpenAI integration using ASK_OPENAI function

Open AI integration is available as a separate npm package

yarn add @rowsncolumns/openai

Usage

import { SpreadsheetProvider, CanvasGrid } from "@rowsncolumns/spreadsheet"
import {
  ASK_OPENAI,
  functionDescriptions as openAIFunctionDescriptions,
} from "@rowsncolumns/openai";
import { functionDescriptions, functions } from "@rowsncolumns/functions";
import { useSpreadsheetState } from "@rowsncolumns/spreadsheet-state"


const allFunctions = {
  ...functions,
  ASK_OPENAI
}

const allFunctionDescriptions = functionDescriptions.concat(
  openAIFunctionDescriptions
);

const MySpreadsheet = () => {
  const { ... } = useSpreadsheetState({
   functions: allFunctions
  })
  return (
    <CanvasGrid
      functionDescriptions={allFunctionDescriptions}
      {...}
    />
  )
}

export const App = () => (
  <SpreadsheetProvider>
    <MySpreadsheet />
  </SpreadsheetProvider>
)

Last updated