Snap Search is a multi-modal search application that allows users to search using both text and images. It utilizes the Google Generative AI API to generate responses based on the provided input.
- Image Upload: Users can upload an image as part of their search query.
- Text Query: Users can enter a text query to supplement their image search.
- Google Generative AI API Integration: The application submits the image and text query to the Google Generative AI API and generates a response based on the input.
- Reset Functionality: Users can easily reset the prompts and response.
Follow these steps to get the application up and running:
- Clone the repository:
git clone https://github.com/your-repo/snap-search.git
- Install dependencies: Navigate to the project directory and install the dependencies:
cd snap-search
npm install
-
Set up the Google Generative AI API key:
Obtain an API key from the Google Cloud Console. Create a
.env.local
file in the root directory of the project. Add the following line to the file, replacing<YOUR_API_KEY>
with your actual API key:
NEXT_PUBLIC_GOOGLE_API_KEY=<YOUR_API_KEY>
- Start the development server:
npm run dev
-
Access the application:
Open your browser and navigate to
http:https://localhost:3000
to see the application in action.
- Click the "Add Photo" button or the image preview area to upload an image.
- Enter a text query in the input field.
- Click the "Send" button or press Enter to submit the query.
- Wait for the response to be generated and displayed in the result area.
- To reset the prompts and response, click the "Reset" button.