Posts

Showing posts with the label AI

I have created an application to extract text from image using AI

Image
 In this article, I am going to demonstrate how text is getting extracted from image file using Gemini AI model. Also, will explain how the application is developed with the help of chat GPT and some custom code.     Very first i gone to chatGPT application and added below prompts so that my application structure i can get the application code to start with. Following is the screenshot of the prompt i have written and answer given by chatGPT.    I have copied the code given by chat gpt and modified as per my requirement that means i got 70 to 80 percentage code to develop the application. Following are the Prerequisites required for development of this application : Visual studio code Python Api Key of Gemini can be obtain from https://aistudio.google.com    Open visual studio code and create the file with name " imagetextextractapp .py". Now in visual studio code and go to terminal menu and click on New terminal link it will open new terminal. In t...

Create Chat bot application using Python, Streamlit and Gemini AI

Image
In this article I am going to explain creating chat bot application using Python, Streamlit library and Gemini AI. In this chat bot application application will be self host with specific port on computer ad can be accessible from browser.     following Prerequisites required for development of this application : Visual studio code Python Api Key of Gemini can be obtain from https://aistudio.google.com    Open visual studio code and create the file with name "chatbot.py". Now in visual studio code and go to terminal menu and click on New terminal link it will open new terminal. In terminal enter below command to install the Google generative AI library and steamlit library in your machine.   pip install google-generativeai langchain-google-genai streamlit   Now copy below code and paste in the " chatbot .py" file. import streamlit as st import google.generativeai as genai genai.configure(api_key="enter your key obtain from aistudio.google.com...

Query your own documents with LlamaIndex and Gemini

Image
In this article I am going to explain about on creating application for indexing and querying your own documents using LlamaIndex and Gemini. I will provide step by step guide to create application in python.   Prerequisites for this example is as follows: Visual studio code Python Api Key of Gemini can be obtain from https://aistudio.google.com    Open visual studio code and create the file with name "demo.py". Now in visual studio code and go to terminal menu and click on New terminal link it will open new terminal. In terminal enter below command to install the LlamaIndex library and LlamaIndex gemini library in your machine. pip install llama-index llama-index-llms-gemini llama-index-embeddings-gemini Create the folder named "doc" in root directory of the application as shown in below image and store the documents you want to query.       Now copy below code and paste in the "demo.py" file. from llama_index.embeddings.gemini import GeminiEmbedd...

Working with Langchain and google Gemini Integration step by step

Image
 In this article I am going to explain about how can we use Gemini AI model with Lanchain library in python by step by step. The langchain is powerful library framework by using it we can develop LLM app easily.     Prerequisites for this example is as follows: Visual studio code Python Api Key of Gemini can be obtain from https://aistudio.google.com    Open visual studio code and create the file with name "langchainexample.py" and add below code in the file.Now in visual studio code and go to terminal menu and click on New terminal link it will open new terminal. In terminal enter below command to install the Langchain library for google gen ai in your machine. pip install langchain-google-genai Now add below code in the "langchainexample.py" file. from langchain_google_genai import ChatGoogleGenerativeAI apikey="your api key" inputstr="" llm=ChatGoogleGenerativeAI(model="gemini-pro",google_api_key=apikey) while inputst...