Skip to main content

Keystroke Agent

A Python project implementing an AI assistant with tool integration, AWS service support, and asynchronous event-driven architecture.

Features

  1. Advanced AI Integration:

    • Uses AWS Bedrock (Claude 3.5 Sonnet) as the default LLM
    • Asynchronous API calls for better performance
    • Configurable model selection
    • Event-driven architecture using asyncio.Queue for handling LLM responses and tool calls
  2. Built-in Tools:

    • Calculator: Mathematical operations and functions
    • File Management: File operations (create, read, update, delete)
    • Presigned URL: AWS S3 presigned URL generation and file transfer
  3. Interactive CLI:

    • Rich text formatting for better readability
    • Command history management
    • Dynamic conversation summarization
    • Dot commands for runtime configuration
    • Asynchronous implementation for improved responsiveness
  4. Customizable Settings:

    • Model selection
    • System message
    • Assistant name
    • History limit
    • Tool enablement

Installation

pip install keystroke-agent

Configuration

  1. Create a .env file with your AWS credentials:
AWS_ACCESS_KEY_ID=your_key_id
AWS_SECRET_ACCESS_KEY=your_secret_key
AWS_SESSION_TOKEN=your_session_token
AWS_DEFAULT_REGION=your_region
  1. Adjust settings in keystroke/settings.py as needed:
AGENT_NAME = "AI Assistant"
DEFAULT_LLM_MODEL = "bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0"
HISTORY_LIMIT = 10
ENABLE_TOOLS = True

Usage

Start the agent:

agent

Available Dot Commands

  • .help - Show available commands
  • .clear - Clear conversation history
  • .model <model_name> - Change the LLM model
  • .view - View current settings
  • .view history - View conversation history
  • .system <message> - Change the system message
  • .name <new_name> - Change the assistant's name

Available Tools

  1. Calculator:

    • Basic arithmetic operations
    • Trigonometric functions
    • Logarithms and exponentials
    • Factorial calculation
  2. File Management:

    • Create, read, update, and delete files
    • List files in directories
    • Copy and rename files
    • Recursive operations support
  3. AWS S3 Integration:

    • Generate presigned URLs for upload/download
    • Upload files using presigned URLs
    • Download files using presigned URLs

Development

Built with:

  • litellm - LLM integration
  • rich - Terminal formatting
  • boto3 - AWS SDK
  • python-dotenv - Environment management
  • asyncio - Asynchronous I/O

License

MIT License

Future Enhancements

  • Streaming Support
  • Asynchronous event-driven architecture
  • Additional tool integrations
  • Web interface option
  • Enhanced error handling
  • Conversation export functionality
  • Tool usage analytics
  • Custom tool loading system

WhatsApp Integration

  • WhatsApp Business API integration
    • Message sending and receiving
    • Media file handling (images, documents, voice notes)
    • Group chat support
    • Interactive buttons and list messages
  • Automated responses through AI
  • Contact management and user session handling
  • Message templates and broadcasting
  • Multi-language support for WhatsApp messages
  • Message status tracking and analytics

Metadata

Release files for keystroke-agent 0.1.7

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

Source distribution (sdist)

Source distribution for keystroke-agent 0.1.7
File Size Uploaded Provenance
keystroke_agent-0.1.7.tar.gz 95.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for keystroke-agent 0.1.7
File Interpreter ABI Platform
keystroke_agent-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 108.8 kB

Release files / keystroke_agent-0.1.7.tar.gz

Download URL keystroke_agent-0.1.7.tar.gz
Size 95.4 kB
Tags Source
SHA-256 checksum
How to use checksums
112f55af308491e23033a980c7564c23fa3b7c0ce42f9d606e63bad0dde78daf
BLAKE2b-256 checksum
How to use checksums
f652e36a26c3b27d563a76e8c6622bb7d40f944e85d87950e3bbdba65df328ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / keystroke_agent-0.1.7-py3-none-any.whl

Download URL keystroke_agent-0.1.7-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
910c4b8b55f5ab98e8d72707f97cf401c788486ac658fc17c868f1108717f48b
BLAKE2b-256 checksum
How to use checksums
71baa1fec42e23059663907edf212fa3dff5f9466bd17fb8a71e4c86dc51a2cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Security for keystroke-agent 0.1.7

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.

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