Skip to main content

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

Metadata

Release files for repartee 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for repartee 0.1.1
File Size Uploaded Provenance Actions
repartee-0.1.1.tar.gz 5.8 kB Without provenance Details for repartee-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for repartee 0.1.1
File Interpreter ABI Platform Actions
repartee-0.1.1-py3-none-any.whl Python 3 none any Details for repartee-0.1.1-py3-none-any.whl

Total release size: 12.7 kB

Release files / repartee-0.1.1.tar.gz

Download URL repartee-0.1.1.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8b6bd7bf27157248a348c803ee31a5e1e3d01d090db202066eb7dca7c18bab0e
BLAKE2b-256 checksum
How to use checksums
a0a1cc82b5b6a8b87affbabc755d40b2ac5051929410cd891b062aafa9d10ed1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.1.dev0+g94f810c.d20240510 CPython/3.12.3

Release files / repartee-0.1.1-py3-none-any.whl

Download URL repartee-0.1.1-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
605ef7034ad920e5356261aea44334cece4e613479e141632af5659961e9f732
BLAKE2b-256 checksum
How to use checksums
f79eebbd9a91e2c621cade5a009494dea163c42b0bae2e1ba4df9e126c57222e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.1.dev0+g94f810c.d20240510 CPython/3.12.3

Security for repartee 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page