An open API service indexing awesome lists of open source software.

https://github.com/fitri-hy/hy-gemini-ai-react

A simple Gemini AI Chatbot project using simple ReactJS
https://github.com/fitri-hy/hy-gemini-ai-react

chatbot-gemini gemini geminiai react-gemini react-gpt

Last synced: about 20 hours ago
JSON representation

A simple Gemini AI Chatbot project using simple ReactJS

Awesome Lists containing this project

README

          

# Modules Floating Chat GPT AI (Gemini) for React

ss

ReactJS modules are simple but have many advantages, one of which is that you can customize them freely.

## NPM Installation
```sh
npm i hytech-component
npm i @google/generative-ai
npm i react-markdown
```

## Import Modules
```sh
import GeminiAI,{ ButtonGpt, CloseButtonGpt, FormInputGpt, MessageGpt } from "hytech-component/GeminiAI";
import Markdown from 'react-markdown';
```
## Setup Config
```sh
const apiKey = 'Your apiKey'; // Use your GeminiAI Api here
const command = 'You have to pretend to be a AI for HyTech Group';
const aiModel = 'gemini-pro';
const {
showBoxAI,
toggleBox,
loading,
response,
message,
setMessage,
handleSubmit,
} = GeminiAI(apiKey, command, aiModel);
```

## Implementation Component
```sh


AI
{showBoxAI && (





setMessage(e.target.value)} />
Ask


{loading ?

Loading ...
:
{String(response)}

}


)}

```

## Full Code App.js

```sh
import React from "react";
import GeminiAI,{ ButtonGpt, CloseButtonGpt, FormInputGpt, MessageGpt } from "hytech-component/GeminiAI";
import Markdown from 'react-markdown';

function App() {
const apiKey = 'Your apiKey'; // Use your GeminiAI Api here
const command = 'You have to pretend to be a AI for HyTech Group';
const aiModel = 'gemini-pro';
const {
showBoxAI,
toggleBox,
loading,
response,
message,
setMessage,
handleSubmit,
} = GeminiAI(apiKey, command, aiModel);

return (


AI
{showBoxAI && (





setMessage(e.target.value)}
/>

Ask



{loading ?

Loading ...
:
{String(response)}

}


)}

);
}

export default App;
```

## Get ApiKey
Go to : HERE

Official Site: HyTech Group