TEXT AND IMAGE RESPONSE GENERATIVE ARTIFICIAL INTELLIGENCE BASED CHAT-BOT
Text
A Generative AI chat bot that can talk to you and help you assist in your work.
WHAT IS GENERATIVE AI?
Generative AI refers to a category of artificial intelligence algorithms that are designed to generate new, previously unseen content.
FrameWork Used
NEXTJS
Nextjs is a full stack framework
that uses React for it's frontend and SSR for backend.Which Makes our work very easy.

NEXT PROVIDES US WITH SERVER SIDE RENDERING

SETTING UP NEXTJS
FRONTEND
REACT
React is a popular JavaScript library for building user interfaces, particularly single-page applications where you need a fast, responsive, and interactive experience.

GOOGLE'S AI (GEMINI) USED FOR THE
AI RELATED API'S
- RELIABLE & CHEAP
- CAN BE FINE TUNED ACCORDING TO USE
- API'S HUGE DOCUMENTATION SUPPORT
REACT HOOKS MAKE'S HANDLING THE
STATES EASIER
SOME OF THE COMMONLY USED HOOKS ARE-
1-useEffect
2-useState
3-useRef
IMPORTANT PARAMETERS OF THE API USED
1-maxOutputTokens: This parameter limits the length of the generated output to a specified number of tokens. In your example, maxOutputTokens: 1000 means the model will generate up to 1000 tokens before stopping. This is useful to control the verbosity and ensure the output doesn't become excessively long.
Text
2.temperature: This parameter controls the randomness of the model's output. Lower values (closer to 0) make the output more deterministic and focused, reducing randomness. Higher values (closer to 1) increase the randomness and creativity of the output. In your example, temperature: 0.1 means the model will produce very deterministic and focused outputs, prioritizing the most likely tokens in its generation process.
SOME FEATURED:=
1- TYPESCRIPT(for type safety)
2- (.ENV) FILES FOR ENVIRONMENT VARIABLES
3- PROPERLY STRUCTURED


TEXT PROMPTS

ON IMAGE PROMPT
image provided is first read and converted into a base64 string and then send back to
the google api to understand the data
HOW DOES THE VISION GENERATIVE AI WORKS??


USING THE GOOGLE GEMINI API FROM
import { GoogleGenerativeAI } from "@google/generative-ai";
Text

deck
By Animesh Rawat
deck
- 152