Skip to content

Commit 4820336

Browse files
chore(llma): update SDKs (#367)
1 parent 805c308 commit 4820336

File tree

10 files changed

+38
-25
lines changed

10 files changed

+38
-25
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
runs-on: ubuntu-latest
5050
strategy:
5151
matrix:
52-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
52+
python-version: ['3.10', '3.11', '3.12', '3.13']
5353

5454
steps:
5555
- uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# 7.0.0 - 2025-11-11
2+
3+
NB Python 3.9 is no longer supported
4+
5+
- chore(llma): update LLM provider SDKs to latest major versions
6+
- openai: 1.102.0 → 2.7.1
7+
- anthropic: 0.64.0 → 0.72.0
8+
- google-genai: 1.32.0 → 1.49.0
9+
- langchain-core: 0.3.75 → 1.0.3
10+
- langchain-openai: 0.3.32 → 1.0.2
11+
- langchain-anthropic: 0.3.19 → 1.0.1
12+
- langchain-community: 0.3.29 → 0.4.1
13+
- langgraph: 0.6.6 → 1.0.2
14+
115
# 6.9.3 - 2025-11-10
216

317
- feat(ph-ai): PostHog properties dict in GenerationMetadata

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ We recommend using [uv](https://docs.astral.sh/uv/). It's super fast.
3030
## PostHog recommends `uv` so...
3131

3232
```bash
33-
uv python install 3.9.19
34-
uv python pin 3.9.19
33+
uv python install 3.12
34+
uv python pin 3.12
3535
uv venv
3636
source env/bin/activate
3737
uv sync --extra dev --extra test

posthog/ai/langchain/callbacks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
try:
2-
import langchain # noqa: F401
2+
import langchain_core # noqa: F401
33
except ImportError:
44
raise ModuleNotFoundError(
5-
"Please install LangChain to use this feature: 'pip install langchain'"
5+
"Please install LangChain to use this feature: 'pip install langchain-core'"
66
)
77

88
import json
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import pytest
22

3-
pytest.importorskip("langchain")
3+
pytest.importorskip("langchain_core")
44
pytest.importorskip("langchain_community")
55
pytest.importorskip("langgraph")

posthog/test/ai/langchain/test_callbacks.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,9 +1125,9 @@ def test_anthropic_chain(mock_client):
11251125
)
11261126
chain = prompt | ChatAnthropic(
11271127
api_key=ANTHROPIC_API_KEY,
1128-
model="claude-3-opus-20240229",
1128+
model="claude-sonnet-4-5-20250929",
11291129
temperature=0,
1130-
max_tokens=1,
1130+
max_tokens=1024,
11311131
)
11321132
callbacks = CallbackHandler(
11331133
mock_client,
@@ -1150,12 +1150,12 @@ def test_anthropic_chain(mock_client):
11501150
assert gen_args["event"] == "$ai_generation"
11511151
assert gen_props["$ai_trace_id"] == "test-trace-id"
11521152
assert gen_props["$ai_provider"] == "anthropic"
1153-
assert gen_props["$ai_model"] == "claude-3-opus-20240229"
1153+
assert gen_props["$ai_model"] == "claude-sonnet-4-5-20250929"
11541154
assert gen_props["foo"] == "bar"
11551155

11561156
assert gen_props["$ai_model_parameters"] == {
11571157
"temperature": 0.0,
1158-
"max_tokens": 1,
1158+
"max_tokens": 1024,
11591159
"streaming": False,
11601160
}
11611161
assert gen_props["$ai_input"] == [
@@ -1171,7 +1171,7 @@ def test_anthropic_chain(mock_client):
11711171
<= approximate_latency
11721172
)
11731173
assert gen_props["$ai_input_tokens"] == 17
1174-
assert gen_props["$ai_output_tokens"] == 1
1174+
assert gen_props["$ai_output_tokens"] == 4
11751175

11761176
assert trace_args["event"] == "$ai_trace"
11771177
assert trace_props["$ai_input_state"] == {}
@@ -1188,9 +1188,9 @@ async def test_async_anthropic_streaming(mock_client):
11881188
)
11891189
chain = prompt | ChatAnthropic(
11901190
api_key=ANTHROPIC_API_KEY,
1191-
model="claude-3-opus-20240229",
1191+
model="claude-sonnet-4-5-20250929",
11921192
temperature=0,
1193-
max_tokens=1,
1193+
max_tokens=1024,
11941194
streaming=True,
11951195
stream_usage=True,
11961196
)

posthog/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = "6.9.3"
1+
VERSION = "7.0.0"
22

33
if __name__ == "__main__":
44
print(VERSION, end="") # noqa: T201

pyproject.toml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@ authors = [{ name = "PostHog", email = "[email protected]" }]
1010
maintainers = [{ name = "PostHog", email = "[email protected]" }]
1111
license = { text = "MIT" }
1212
readme = "README.md"
13-
requires-python = ">=3.9"
13+
requires-python = ">=3.10"
1414
classifiers = [
1515
"Development Status :: 5 - Production/Stable",
1616
"Intended Audience :: Developers",
1717
"Operating System :: OS Independent",
1818
"License :: OSI Approved :: MIT License",
1919
"Programming Language :: Python",
20-
"Programming Language :: Python :: 3.9",
2120
"Programming Language :: Python :: 3.10",
2221
"Programming Language :: Python :: 3.11",
2322
"Programming Language :: Python :: 3.12",
@@ -66,13 +65,13 @@ test = [
6665
"pytest-timeout",
6766
"pytest-asyncio",
6867
"django",
69-
"openai",
70-
"anthropic",
71-
"langgraph>=0.4.8",
72-
"langchain-core>=0.3.65",
73-
"langchain-community>=0.3.25",
74-
"langchain-openai>=0.3.22",
75-
"langchain-anthropic>=0.3.15",
68+
"openai>=2.0",
69+
"anthropic>=0.72",
70+
"langgraph>=1.0",
71+
"langchain-core>=1.0",
72+
"langchain-community>=0.4",
73+
"langchain-openai>=1.0",
74+
"langchain-anthropic>=1.0",
7675
"google-genai",
7776
"pydantic",
7877
"parameterized>=0.8.1",

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
PostHog is developer-friendly, self-hosted product analytics.
1515
posthog-python is the python package.
1616
17-
This package requires Python 3.9 or higher.
17+
This package requires Python 3.10 or higher.
1818
"""
1919

2020
# Minimal setup.py for backward compatibility

setup_analytics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
PostHog is developer-friendly, self-hosted product analytics.
4848
posthog-python is the python package.
4949
50-
This package requires Python 3.9 or higher.
50+
This package requires Python 3.10 or higher.
5151
"""
5252

5353
# Minimal setup.py for backward compatibility

0 commit comments

Comments
 (0)