open-index/open-npm huggingface dataset:
npm package: @react-ai-assist/duckdb
Description: The DuckDB addon for SQL query with react-ai-assist
Latest version: 0.0.1

# DuckDB addon for react-ai-assist

This addon provides a way to query your dataset or selected columns using DuckDB WASM database via the Ai assistant chat interface in react-ai-assist.

## Installation

This addon depends on the following packages:
- react-ai-assist
- duckdb-wasm
- apache-arrow

If you are using tailwindcss, you can install the addon by running:

```bash
yarn add react-ai-assist @ai-assist/duckdb @duckdb/duckdb-wasm apache-arrow
```

Then, you need to add the following to your tailwind.config.js file:

```js
   content: [
     ...,
     './node_modules/@ai-assist/duckdb/dist/**/*.{js,ts,jsx,tsx}',
   ]
```

## Usage

To use this addon, you need to import the `queryDuckDBCallbackMessage` component from the addon and pass the `db` object to it.

```tsx
import { AiAssistant } from 'react-ai-assist';
import { queryDuckDBFunctionDefinition } from '@ai-assist/duckdb';

const myFunctions = [
  ...otherFunctions,
  queryDuckDBFunctionDefinition({
    getValues: (datasetName: string, variableName: string) => {
      // get the values of the variable from the dataset,
      // the values will be used to create and plot the histogram
      return [];
    }
  }),
];

<AiAssistant
  provider="openai"
  model="gpt-4o"
  apiKey="your-api-key"
  name="My AI Assistant"
  version="1.0.0"
  functions={myFunctions}
/>
```

With the above code, the AI assistant will be able to query the dataset or selected columns using DuckDB WASM database. Users can prompt the AI assistant to query the dataset or selected columns by asking it to query the dataset or selected columns.

For example:

```
Query the dataset "my_dataset" and select the top 10 rows of the column "age".
```
npm package: @react-ai-assist/echarts
Description: The eCharts addon for plotting with react-ai-assist
Latest version: 0.0.2

# eCharts addon for react-ai-assist

This addon provides a way to plot different types of charts using eCharts library via the Ai assistant chat interface in react-ai-assist.

## Installation

This addon depends on the following packages:
- echarts
- react-ai-assist
- tailwindcss

If you are using tailwindcss, you can install the addon by running:

```bash
yarn add react-ai-assist @ai-assist/echarts echarts
```

Then, you need to add the following to your tailwind.config.js file:

```js
   content: [
     ...,
     './node_modules/@ai-assist/echarts/dist/**/*.{js,ts,jsx,tsx}',
   ]
```

If you are not using tailwindcss, you can install the addon by running:

```bash
yarn add react-ai-assist @ai-assist/echarts echarts
```

Then, you need to add the following to import the css file:

```tsx
import '@ai-assist/echarts/dist/index.css';
```

## Usage

```tsx
import { AiAssistant } from 'react-ai-assist';
import { histogramFunctionDefinition, GetValues } from '@ai-assist/echarts';

const myFunctions = [
  ...otherFunctions,
  histogramFunctionDefinition({
    getValues: (datasetName: string, variableName: string) => {
      // get the values of the variable from the dataset,
      // the values will be used to create and plot the histogram
      return [];
    }
  }),
];

<AiAssistant
  provider="openai"
  model="gpt-4o"
  apiKey="your-api-key"
  name="My AI Assistant"
  version="1.0.0"
  functions={myFunctions}
/>
```

With the above code, the AI assistant will be able to plot a histogram chart using the values returned by the `getValues` function. Users can prompt the AI assistant to plot a histogram chart by asking it to plot the histogram of a variable.

For example:

```
Plot the histogram of the variable "age" in the dataset "my_dataset".
```
npm package: @react-ai-assist/geoda
Description: The GeoDa addon for spatial data analysis with react-ai-assist
Latest version: 0.0.3

# Geoda addon for react-ai-assist

This addon provides a way to do spatial data analysis using GeoDa library via the Ai assistant chat interface in react-ai-assist.

## Installation

```bash
yarn add react-ai-assist
yarn add @ai-assist/geoda
yarn add geoda
```

## Usage

```tsx
import { AiAssistant } from 'react-ai-assist';
import { dataClassifyCallbackFunction } from '@ai-assist/geoda';

const myFunctions = [
  ...otherFunctions,
  dataClassifyCallbackFunction({
    getValues: (datasetName: string, variableName: string) => {
      // get the values of the variable from the dataset,
      // the values will be used to create and plot the histogram
      return [];
    }
  }),
];

<AiAssistant
  provider="openai"
  model="gpt-4o"
  apiKey="your-api-key"
  name="My AI Assistant"
  version="1.0.0"
  functions={myFunctions}
/>
```

With the above code, the AI assistant will be able to classify the data into k bins or classes using the values returned by the `getValues` function. Users can prompt the AI assistant to classify the data into k bins or classes by asking it to classify the data of a variable.

For example:

```
Classify the data of population into 5 classes using the natural breaksmethod.
```

The Ai assistant will use this addons to classify the data of population into 5 classes using the natural breaksmethod and the LLM will return the break points to the user.