Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion PLUGIN_DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ build-backend = "hatchling.build"

[project]
name = "abc-provider-NAME"
version = "2025.09.04" # Match abc-cli version format
version = "2026.07.15" # Match abc-cli version format
description = "NAME LLM provider for abc-cli"
readme = "README.md"
requires-python = ">=3.8"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,4 +328,4 @@ Prompt crafting by Eric Hammond

## Version

Current version: 2025.09.04
Current version: 2026.07.15
2 changes: 1 addition & 1 deletion abc_cli/abc_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# Entry point group for LLM providers
PROVIDER_ENTRY_POINT = 'abc.llm_providers'

VERSION: str = "abc (AI Bash Command) version 2026.04.12"
VERSION: str = "abc (AI Bash Command) version 2026.07.15"
PROGRAM_NAME: str = "abc"

# Config file
Expand Down
30 changes: 18 additions & 12 deletions abc_provider_anthropic/abc_provider_anthropic/llm_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

from abc_cli import LLMProvider

DEFAULT_MODEL = 'claude-opus-4-5'
DEFAULT_TEMPERATURE = 0.0
DEFAULT_MODEL = 'claude-opus-4-8'
DEFAULT_MAX_TOKENS = 1000

class AnthropicProvider(LLMProvider):
Expand All @@ -23,7 +22,12 @@ def __init__(self, config: Dict[str, str]):

self.api_key = config['api_key']
self.model = config.get('model', DEFAULT_MODEL)
self.temperature = float(config.get('temperature', DEFAULT_TEMPERATURE))
# Newer Claude models (Opus 4.7+, Sonnet 5, Fable 5) reject the
# `temperature` parameter. Only send it when the user explicitly
# configures one; otherwise omit it entirely.
self.temperature = (
float(config['temperature']) if 'temperature' in config else None
)
self.max_tokens = int(config.get('max_tokens', DEFAULT_MAX_TOKENS))
self.client = anthropic.Anthropic(api_key=self.api_key)

Expand All @@ -34,12 +38,11 @@ def generate_command(
system_prompt: str,
) -> str:
"""Generate command using Anthropic Claude."""
message = self.client.messages.create(
model=self.model,
max_tokens=self.max_tokens,
temperature=self.temperature,
system=system_prompt,
messages=[
request_params = {
"model": self.model,
"max_tokens": self.max_tokens,
"system": system_prompt,
"messages": [
{
"role": "user",
"content": [
Expand All @@ -50,7 +53,11 @@ def generate_command(
]
}
]
)
}
if self.temperature is not None:
request_params["temperature"] = self.temperature

message = self.client.messages.create(**request_params)
return message.content[0].text.strip()

def get_config_schema(self) -> Dict:
Expand All @@ -74,8 +81,7 @@ def get_config_schema(self) -> Dict:
},
"temperature": {
"type": "string",
"description": "Sampling temperature",
"default": DEFAULT_TEMPERATURE
"description": "Sampling temperature (omitted unless set; unsupported by newer Claude models)"
},
"max_tokens": {
"type": "string",
Expand Down
2 changes: 1 addition & 1 deletion abc_provider_anthropic/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "abc-provider-anthropic"
version = "2026.04.12"
version = "2026.07.15"
description = "Anthropic LLM provider for abc-cli"
readme = "README.md"
requires-python = ">=3.8"
Expand Down
23 changes: 22 additions & 1 deletion abc_provider_anthropic/tests/test_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_init_minimal_config():
provider = AnthropicProvider(MOCK_CONFIG)
assert provider.api_key == MOCK_API_KEY
assert provider.model == DEFAULT_MODEL
assert provider.temperature == 0.0
assert provider.temperature is None
assert provider.max_tokens == 1000

def test_init_full_config():
Expand Down Expand Up @@ -96,6 +96,27 @@ def test_generate_command(mock_anthropic):
assert call_kwargs["system"] == "You are a CLI assistant"
assert len(call_kwargs["messages"]) == 1
assert "list files" in call_kwargs["messages"][0]["content"][0]["text"]
# Temperature must be omitted by default — newer Claude models reject it
assert "temperature" not in call_kwargs

@patch('anthropic.Anthropic')
def test_generate_command_with_temperature(mock_anthropic):
"""Test temperature is sent only when explicitly configured."""
mock_message = Mock()
mock_message.content = [Mock(text="ls -l\n##DANGERLEVEL=0## Safe command")]
mock_client = Mock()
mock_client.messages.create.return_value = mock_message
mock_anthropic.return_value = mock_client

provider = AnthropicProvider(MOCK_CONFIG_FULL)
provider.generate_command(
description="list files",
context={"shell": "bash"},
system_prompt="You are a CLI assistant"
)

call_kwargs = mock_client.messages.create.call_args.kwargs
assert call_kwargs["temperature"] == 0.5

@patch('anthropic.Anthropic')
def test_generate_command_api_error(mock_anthropic):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

from .llm_provider import AWSBedrockProvider, PROVIDER_NAME

__version__ = "2026.04.12"
__version__ = "2026.07.15"
2 changes: 1 addition & 1 deletion abc_provider_aws_bedrock/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "abc-provider-aws-bedrock"
version = "2026.04.12" # Match current abc-cli version
version = "2026.07.15" # Match current abc-cli version
description = "AWS Bedrock LLM provider plugin for abc-cli"
readme = "README.md"
requires-python = ">=3.8"
Expand Down
2 changes: 1 addition & 1 deletion abc_provider_openai/abc_provider_openai/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
from .llm_provider import OpenAIProvider

__all__ = ["OpenAIProvider"]
__version__ = "2026.04.12"
__version__ = "2026.07.15"
2 changes: 1 addition & 1 deletion abc_provider_openai/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "abc-provider-openai"
version = "2026.04.12"
version = "2026.07.15"
description = "OpenAI LLM provider for abc-cli"
readme = "README.md"
requires-python = ">=3.8"
Expand Down
6 changes: 3 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# Build the core abc-cli package
abc-cli = python.pkgs.buildPythonApplication rec {
pname = "abc-cli";
version = "2025.09.04";
version = "2026.07.15";
format = "pyproject";

src = ./.;
Expand Down Expand Up @@ -55,7 +55,7 @@
# Build provider packages
abc-provider-anthropic = python.pkgs.buildPythonPackage rec {
pname = "abc-provider-anthropic";
version = "2025.09.04";
version = "2026.07.15";
format = "pyproject";

src = ./abc_provider_anthropic;
Expand All @@ -74,7 +74,7 @@

abc-provider-aws-bedrock = python.pkgs.buildPythonPackage rec {
pname = "abc-provider-aws-bedrock";
version = "2025.09.04";
version = "2026.07.15";
format = "pyproject";

src = ./abc_provider_aws_bedrock;
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "abc-cli"
version = "2026.04.12"
version = "2026.07.15"
description = "AI bash/zsh/tcsh Command"
readme = "README.md"
requires-python = ">=3.8"
Expand Down