Skip to main content

An AI-powered coding assistant for editing files with interactive confirmations

Project description

bespoken


██████╗ ███████╗███████╗██████╗  ██████╗ ██╗  ██╗███████╗███╗   ██╗
██╔══██╗██╔════╝██╔════╝██╔══██╗██╔═══██╗██║ ██╔╝██╔════╝████╗  ██║
██████╔╝█████╗  ███████╗██████╔╝██║   ██║█████╔╝ █████╗  ██╔██╗ ██║
██╔══██╗██╔══╝  ╚════██║██╔═══╝ ██║   ██║██╔═██╗ ██╔══╝  ██║╚██╗██║
██████╔╝███████╗███████║██║     ╚██████╔╝██║  ██╗███████╗██║ ╚████║
╚═════╝ ╚══════╝╚══════╝╚═╝      ╚═════╝ ╚═╝  ╚═╝╚══════╝╚═╝  ╚═══╝


A terminal chat experience that you can configure yourself.

Installation

Basic installation:

uv pip install bespoken

Usage

This library uses llm under the hood to provide you with building blocks to make chat interfaces from the commandline. Here's an example.

from bespoken import chat
from bespoken.tools import FileTool, TodoTools, PlaywrightTool

chat(
    model_name="anthropic/claude-3-5-sonnet-20240620",
    tools=[FileTool("edit.py"), TodoTools(), PlaywrightTool()],
    system_prompt="You are a coding assistant that can make edits to a single file that is defined by the filetool.",
    debug=True,
)

If you now run this Python file, a chat appears on command line.

Why?

The goal is to host a bunch of tools that you can pass to the LLM, but the main idea here is that you can also make it easy to constrain the chat. The FileTool, for example, only allows the LLM to make edits to a single file declared upfront. This significantly reduces any injection risks and still covers a lot of use-cases. It is also a nice exercize to make tools like claude code feel less magical, and you can also swap out the LLM with any other one as you see fit.

This project is in early days at the moment, but it feels exciting to work on!

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

bespoken-0.2.1.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

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

bespoken-0.2.1-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file bespoken-0.2.1.tar.gz.

File metadata

  • Download URL: bespoken-0.2.1.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for bespoken-0.2.1.tar.gz
Algorithm Hash digest
SHA256 89e8cd911592332f888cd360f3d2f3c94d85ffad571f1a2cb199121a944a3951
MD5 14c666119ca3fc4c5cb87cfeb156b146
BLAKE2b-256 5353cba74c68dd77dea625372d26771ff46a712564653a4b02788b589269ba97

See more details on using hashes here.

File details

Details for the file bespoken-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: bespoken-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for bespoken-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5f2a4c77c43d8aa31d60fe703cdece3859d9b47f7a52dc1dfd2ddcdffec30f35
MD5 2693812e32c58a432e877bf2a69e4c46
BLAKE2b-256 b31f68956020a366af1e70bbcc42f1065408a2fb88906c0ac94f673d4f57ac10

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