Skip to content
Merged
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
1 change: 1 addition & 0 deletions tests/test_anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def test_anthropic_generate_content(
# Verify the internal SDK method was called with the correct model and prompt
mock_instance.messages.create.assert_called_once_with(
model="claude-3-7-sonnet-20250219",
max_tokens=AnthropicClient.DEFAULT_MAX_TOKENS,
messages=[{"role": "user", "content": "Test prompt"}],
system="Test instruction",
temperature=0.7,
Expand Down
3 changes: 3 additions & 0 deletions wptgen/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ def prompt_exceeds_input_token_limit(
class AnthropicClient(LLMClient):
"""Client for interacting with Anthropic's API."""

DEFAULT_MAX_TOKENS = 8192

def __init__(
self,
api_key: str,
Expand Down Expand Up @@ -378,6 +380,7 @@ def generate_content(
target_model = model or self.model
kwargs: dict[str, Any] = {
"model": target_model,
"max_tokens": self.DEFAULT_MAX_TOKENS,
"messages": [{"role": "user", "content": prompt}],
}

Expand Down
Loading