Anthropic model support for Gptcmd
Project description
Gptcmd-anthropic
Gptcmd-anthropic adds support for Anthropic's Claude models to Gptcmd.
Python 3.8.6 or later, Gptcmd 2.0.0 or later, and an Anthropic API key are required to use this package. Gptcmd-anthropic is available on PyPI, and can, for instance, be installed with pip install gptcmd-anthropic at a command line shell.
Configuration
To use Gptcmd-anthropic, you'll need to add a new account to your Gptcmd configuration or modify your default account. If no api_key is specified in your configuration, Gptcmd-anthropic uses the API key in the ANTHROPIC_API_KEY environment variable. An example configuration follows:
[accounts.claude]
provider = "anthropic"
api_key = "sk-ant-xxxxx" # Replace with your API key
# Though not required, specifying a model in your configuration, similar to
# openai and azure accounts, will use that model by default
model = "claude-3-5-sonnet-latest"
# Any additional options are passed directly to the Python Anthropic client's
# constructor for this account.
Usage
If you've configured multiple accounts, the account command in Gptcmd can be used to switch between them:
(gpt-4o) account claude
Switched to account 'claude'
(claude-3-5-sonnet-latest) account default
Switched to account 'default'
(gpt-4o)
Consult Gptcmd's readme for additional usage instructions.
Prompt caching
To save costs, Gptcmd-anthropic dynamically inserts cache breakpoints on the system message (if present), the final user message, and the largest messages of a conversation based on content length and number of attachments. This feature is currently not user configurable.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gptcmd_anthropic-1.0.0.tar.gz.
File metadata
- Download URL: gptcmd_anthropic-1.0.0.tar.gz
- Upload date:
- Size: 23.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97ce79f79df5f89e0ba326195c8ad1efb2b3775fcd976dbaeeddf6a8eb51a6ff
|
|
| MD5 |
cdd3ec5b2d1b6a91fbbecabca7cb5082
|
|
| BLAKE2b-256 |
11e9b71b89cc5b55d85ef0d758bc551a4ce11c62dbfc5109b4b48f97706ff1c5
|
File details
Details for the file gptcmd_anthropic-1.0.0-py3-none-any.whl.
File metadata
- Download URL: gptcmd_anthropic-1.0.0-py3-none-any.whl
- Upload date:
- Size: 23.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
588c6803da756206530f9e78080998139052f90c07c29d1ee98e03d459e0bb86
|
|
| MD5 |
5d0201a78ed89a52f84f8760a85e3d39
|
|
| BLAKE2b-256 |
81b3a1752b807e63021860b8274d7ca5cd455655e802aa4e1d5d2938137da19d
|