Skip to main content

A CLI tool to interface with multiple AI APIs for prompt-response handling.

Project description

Repartee

Repartee is a command-line interface (CLI) tool designed to interface with multiple AI APIs to handle various functionalities, including sending prompts and receiving responses from AI models. It tracks spending based on token usage and offers a flexible configuration system.

Core Functionality

  • Interface with multiple AI APIs (GPT-4o, GPT-4-turbo, GPT-3.5-turbo from OpenAI, Claude 3, Gemini 1.5, Perplexity).
  • Securely store API keys in environment variables.
  • Configure API parameters such as max tokens and temperature.
  • Support YAML configuration files for settings.
  • Command-line argument parsing for API selection and prompt input.
  • Output formatting options (standard output, file, REPL).
  • Interactive REPL prompt.
  • Input from files and shell command piping.
  • Advanced features like error handling, retry mechanisms, and spending tracking.

Project Structure

repartee/
│
├── repartee/
│   ├── __init__.py
│   ├── cli.py
│   ├── config.py
│   ├── api_clients/
│   │   ├── __init__.py
│   │   ├── openai_api.py
│   │   ├── claude3.py
│   │   ├── gemini15.py
│   │   └── perplexity.py
│   ├── prompt_handler.py
│   ├── output_formatter.py
│   ├── repl.py
│   ├── spending_tracker.py
│   └── utils.py
│
├── tests/
│   ├── __init__.py
│   ├── test_cli.py
│   ├── test_config.py
│   ├── test_api_clients.py
│   ├── test_prompt_handler.py
│   ├── test_output_formatter.py
│   ├── test_repl.py
│   └── test_spending_tracker.py
│
├── .gitignore
├── README.md
├── setup.py
└── requirements.txt

Key Components

  1. cli.py: Handles command-line argument parsing and routes the inputs to the appropriate API client.
  2. config.py: Manages loading and accessing configuration settings from YAML files.
  3. api_clients/openai_api.py: Contains functions to interact with OpenAI's GPT models, including checking API key availability and making API requests.
  4. output_formatter.py: Formats the AI responses into markdown format suitable for Obsidian, with specific callout blocks for system and user messages.
  5. spending_tracker.py: Tracks token usage and calculates spending based on the model's token cost.
  6. repl.py: Provides an interactive Read-Eval-Print Loop (REPL) for live prompt-response sessions.

Roadmap

  • Set up the initial project structure
  • Implement CLI argument parsing
  • Implement configuration management
  • Implement OpenAI API client
  • Implement Claude 3 API client
  • Implement Gemini 1.5 API client
  • Implement Perplexity API client
  • Implement basic output formatting
  • Implement spending tracker
  • Implement REPL interface
  • Write tests for CLI
  • Write tests for configuration management
  • Write tests for API clients
  • Write tests for prompt handler
  • Write tests for output formatter
  • Write tests for REPL
  • Write tests for spending tracker

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

repartee-0.1.1.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

repartee-0.1.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file repartee-0.1.1.tar.gz.

File metadata

  • Download URL: repartee-0.1.1.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.1.dev0+g94f810c.d20240510 CPython/3.12.3

File hashes

Hashes for repartee-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8b6bd7bf27157248a348c803ee31a5e1e3d01d090db202066eb7dca7c18bab0e
MD5 e64b075a3f60450ba4edf4450a1c6582
BLAKE2b-256 a0a1cc82b5b6a8b87affbabc755d40b2ac5051929410cd891b062aafa9d10ed1

See more details on using hashes here.

File details

Details for the file repartee-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: repartee-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.1.dev0+g94f810c.d20240510 CPython/3.12.3

File hashes

Hashes for repartee-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 605ef7034ad920e5356261aea44334cece4e613479e141632af5659961e9f732
MD5 37c4e241c7eadf200f4722bf707400c8
BLAKE2b-256 f79eebbd9a91e2c621cade5a009494dea163c42b0bae2e1ba4df9e126c57222e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page