gac 0.17.7__tar.gz → 0.18.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of gac might be problematic. Click here for more details.

@@ -97,7 +97,6 @@ venv.bak/
97
97
 
98
98
  # Package management
99
99
  poetry.toml
100
- uv.lock
101
100
 
102
101
  # =========================
103
102
  # Python tools and linters
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gac
3
- Version: 0.17.7
3
+ Version: 0.18.0
4
4
  Summary: AI-powered Git commit message generator with multi-provider support
5
5
  Project-URL: Homepage, https://github.com/cellwebb/gac
6
6
  Project-URL: Documentation, https://github.com/cellwebb/gac#readme
@@ -1,3 +1,3 @@
1
1
  """Version information for gac package."""
2
2
 
3
- __version__ = "0.17.7"
3
+ __version__ = "0.18.0"
@@ -30,13 +30,11 @@ def count_tokens(content: str | list[dict[str, str]] | dict[str, Any], model: st
30
30
 
31
31
  try:
32
32
  client = anthropic.Anthropic()
33
- # Extract the actual model name after the provider prefix
33
+
34
+ # Use the messages.count_tokens API for accurate counting
34
35
  model_name = model.split(":", 1)[1] if ":" in model else "claude-3-5-haiku-latest"
36
+ response = client.messages.count_tokens(model=model_name, messages=[{"role": "user", "content": text}])
35
37
 
36
- # Use the beta messages.count_tokens API for accurate counting
37
- response = client.messages.count_tokens(
38
- model=model_name, messages=[{"role": "user", "content": text}], betas=["token-counting-2024-11-01"]
39
- )
40
38
  return response.input_tokens
41
39
  except Exception:
42
40
  # Fallback to simple estimation for Anthropic models
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes