Skip to content

GitJohnFis/AI-agent

Repository files navigation

AI-agent

Claude in python

License: MIT 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.


Table of Contents


CI Agent Tool

Whisk_storyboard2b5bac12f1c14e5b9130df3f

Features

  • Easy command-line interface
  • Seamless interaction with Gemini AI
  • Environment variable support for API keys
  • Token usage reporting

Demo

$ 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

=======

Whisk_storyboard302628a0621f4e0fa8f93033

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.

Prerequisites

  • Python 3.7 or higher
  • A Gemini API key
  • python-dotenv and google Python packages

Installation

  1. Clone this repository:

    git clone https://github.com/GitJohnFis/AI-agent.git
    cd AI-agent
  2. Install dependencies: =======

  • The following Python packages (see requirements.txt for details)

Setup

  1. Clone this repository.
  2. Install dependencies:

Example for installation process directly in the Command Line bash pip install -r requirements.txt

Configuration

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.

Usage

Send a prompt to Gemini AI from your terminal:

  1. Create a .env file in the project root with your API key:

    GEMINI_API_KEY=your-gemini-api-key-here

Usage

Run the following command in your terminal:

python3 main.py "Your prompt here"

The response and usage statistics will be displayed.

You will receive a response from the Gemini model, along with token usage statistics.

Example

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."

Sample .env file

GEMINI_API_KEY=your-gemini-api-key-here

requirements.txt

python-dotenv
google

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/your-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin feature/your-feature)
  5. Open a pull request

License

This project is licensed under the MIT License. See the LICENSE file for details.

Author

Author

GitJohnFis

About

Claude in python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published