This project demonstrates how to integrate the Gemini API for generating text content using Qt and QML. The application allows users to input a prompt and generate text based on that prompt using the Gemini API.
- Text Input: Users can enter a prompt in a text area.
- Generate Content: Clicking the "Generate content" button sends the prompt to the Gemini API and displays the generated text.
- Error Handling: Displays error messages if the API request fails.
- Qt 6.8 or later
- CMake 3.16 or later
- A valid API key for the Gemini API
-
Clone the Repository:
git clone https://github.com/deniskropp/GeminiAPITest.git cd GeminiAPITest
-
Build the Project:
cmake -B build cmake --build build
-
Run the Application:
./build/appAPITest
- Enter a Prompt: Type your prompt in the text area.
- Generate Content: Click the "Generate content" button.
- View Results: The generated text will appear below the button.
- API Key: Replace the placeholder API key in
main.cpp
with your actual Gemini API key. - Error Handling: The application includes basic error handling to display any issues that occur during the API request.
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit pull requests or open issues for any improvements or bug fixes.
For any questions or support, please contact [email protected].
Note: Ensure you have the necessary permissions and comply with the terms of service for the Gemini API when using this project.