-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Anthropic provider to separate package
- Move Anthropic provider to abc_provider_anthropic package - Update abc_generate.py to use entry point system - Move system prompts to abc_cli/prompts.py - Support both GitHub install and local development - Update installation documentation - Add .gitignore, .clinerules Part of #1: Add plugin architecture to support other LLM APIs
- Loading branch information
Showing
13 changed files
with
186 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# abc/.clinerules | ||
|
||
- Always read these files to understand the project and the layout: | ||
|
||
- `README.md` | ||
- always run this at the beginning of a project to understand the Git repo layout: `make tree` | ||
- read files referenced in the above as appropriate for the task at hand | ||
|
||
- When working on a GitHub issue, follow standard best practices with a branch name like: | ||
`issue-NN-{fix,feature}-description-$(date _%Y%m%d) | ||
|
||
- Use the `git` and `gh` CLIs where it makes sense. | ||
|
||
- When an update is complete, the software version can be updated in these five files: | ||
|
||
- `abc_provider_anthropic/pyproject.toml` | ||
- `pyproject.toml` | ||
- `abc_cli/abc_generate.py` | ||
- `README.md` | ||
- `../getabc.sh/app/components/OpenSource.tsx` | ||
|
||
- Uninstall | ||
|
||
```bash | ||
abc_setup --uninstall --no-prompt && | ||
pipx uninstall abc-cli | ||
``` | ||
|
||
- Install for development (editable mode) | ||
|
||
```bash | ||
pipx install -e . && | ||
pipx inject abc-cli -e ./abc_provider_anthropic && | ||
abc_setup --no-prompt | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Python | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
*.so | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# Virtual Environment | ||
venv/ | ||
env/ | ||
ENV/ | ||
.env/ | ||
.venv/ | ||
|
||
# IDE | ||
.idea/ | ||
.vscode/ | ||
*.swp | ||
*.swo | ||
*~ | ||
|
||
# OS | ||
.DS_Store | ||
Thumbs.db | ||
|
||
# Project specific | ||
work/ | ||
*.log | ||
.coverage | ||
htmlcov/ | ||
.pytest_cache/ | ||
.tox/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
"""abc-cli - AI Bash Command Generator.""" | ||
from .llm_provider import LLMProvider | ||
|
||
__all__ = ['LLMProvider'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# abc-provider-anthropic | ||
|
||
Anthropic LLM provider for [abc-cli](https://github.com/alestic/abc). | ||
|
||
## Configuration | ||
|
||
In your `~/.abc.conf`: | ||
|
||
```ini | ||
[default] | ||
api_key = {ANTHROPIC_API_KEY} | ||
|
||
# Optional settings: | ||
model = claude-3-5-sonnet-20241022 | ||
temperature = 0.0 | ||
max_tokens = 1000 | ||
``` | ||
|
||
Get your Anthropic API key from the [Anthropic Console](https://console.anthropic.com/settings/keys). | ||
|
||
## License | ||
|
||
Apache 2.0 - See [LICENSE](../LICENSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
"""Anthropic LLM provider package.""" | ||
|
||
from .llm_provider import AnthropicProvider | ||
|
||
__all__ = ['AnthropicProvider'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[project] | ||
name = "abc-provider-anthropic" | ||
version = "2024.12.15" | ||
description = "Anthropic LLM provider for abc-cli" | ||
readme = "README.md" | ||
requires-python = ">=3.8" | ||
license = "Apache-2.0" | ||
authors = [ | ||
{ name = "Claude 3.5 Sonnet", email = "" }, | ||
{ name = "Eric Hammond", email = "" } | ||
] | ||
dependencies = [ | ||
"anthropic==0.40.0" | ||
] | ||
|
||
[project.entry-points."abc.llm_providers"] | ||
anthropic = "abc_provider_anthropic:AnthropicProvider" | ||
|
||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters