Claude in python
A simple command-line tool to interact with the Gemini AI model using Python. Send prompts and receive AI-generated responses right from your terminal.
- Easy command-line interface
- Seamless interaction with Gemini AI
- Environment variable support for API keys
- Token usage reporting
$ python3 main.py "Tell me a joke."
Here's a joke from Gemini AI:
Why did the AI go to school? Because it had a lot of learning to do!
Prompt tokens: 7
Response tokens: 18
=======
This project is a simple command-line interface for interacting with the Gemini AI model using Python. It allows you to send a prompt and receive generated responses directly from your terminal.
- Python 3.7 or higher
- A Gemini API key
python-dotenv
andgoogle
Python packages
-
Clone this repository:
git clone https://github.com/GitJohnFis/AI-agent.git cd AI-agent
-
Install dependencies: =======
- The following Python packages (see
requirements.txt
for details)
- Clone this repository.
- Install dependencies:
Example
for installation process directly in the Command Line
bash pip install -r requirements.txt
Create a .env
file in the project root with your API key:
GEMINI_API_KEY=your-gemini-api-key-here
Tip: See
.env.example
for a template.
-
Create a
.env
file in the project root with your API key:GEMINI_API_KEY=your-gemini-api-key-here
Run the following command in your terminal:
python3 main.py "Your prompt here"
You will receive a response from the Gemini model, along with token usage statistics.
python3 main.py "Write a poem about oceans."
Example output:
Here's a poem about volcanoes:
...
Prompt tokens: 8
Response tokens: 42
=======
python3 main.py "Write a poem about the valcanoes."
GEMINI_API_KEY=your-gemini-api-key-here
python-dotenv
google
Contributions are welcome! Please open an issue or submit a pull request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/your-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin feature/your-feature
) - Open a pull request
This project is licensed under the MIT License. See the LICENSE file for details.
GitJohnFis