Skip to content

Commit 5249d02

Browse files
chore: update LLM SDKs
1 parent 0cfd678 commit 5249d02

File tree

6 files changed

+33
-20
lines changed

6 files changed

+33
-20
lines changed

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-06
2+
3+
- chore(llma): update LLM provider SDKs to latest major versions
4+
- openai: 1.102.0 → 2.7.1
5+
- anthropic: 0.64.0 → 0.72.0
6+
- google-genai: 1.32.0 → 1.49.0
7+
- langchain-core: 0.3.75 → 1.0.3
8+
- langchain-openai: 0.3.32 → 1.0.2
9+
- langchain-anthropic: 0.3.19 → 1.0.1
10+
- langchain-community: 0.3.29 → 0.4.1
11+
- langgraph: 0.6.6 → 1.0.2
12+
13+
Drops Python 3.9 support, now requires Python 3.10+ (needed for LangChain v1.0)
14+
115
# 6.8.0 - 2025-11-03
216

317
- feat(llma): send web search calls to be used for LLM cost calculations

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
@@ -1124,9 +1124,9 @@ def test_anthropic_chain(mock_client):
11241124
)
11251125
chain = prompt | ChatAnthropic(
11261126
api_key=ANTHROPIC_API_KEY,
1127-
model="claude-3-opus-20240229",
1127+
model="claude-sonnet-4-5-20250929",
11281128
temperature=0,
1129-
max_tokens=1,
1129+
max_tokens=1024,
11301130
)
11311131
callbacks = CallbackHandler(
11321132
mock_client,
@@ -1149,12 +1149,12 @@ def test_anthropic_chain(mock_client):
11491149
assert gen_args["event"] == "$ai_generation"
11501150
assert gen_props["$ai_trace_id"] == "test-trace-id"
11511151
assert gen_props["$ai_provider"] == "anthropic"
1152-
assert gen_props["$ai_model"] == "claude-3-opus-20240229"
1152+
assert gen_props["$ai_model"] == "claude-sonnet-4-5-20250929"
11531153
assert gen_props["foo"] == "bar"
11541154

11551155
assert gen_props["$ai_model_parameters"] == {
11561156
"temperature": 0.0,
1157-
"max_tokens": 1,
1157+
"max_tokens": 1024,
11581158
"streaming": False,
11591159
}
11601160
assert gen_props["$ai_input"] == [
@@ -1170,7 +1170,7 @@ def test_anthropic_chain(mock_client):
11701170
<= approximate_latency
11711171
)
11721172
assert gen_props["$ai_input_tokens"] == 17
1173-
assert gen_props["$ai_output_tokens"] == 1
1173+
assert gen_props["$ai_output_tokens"] == 4
11741174

11751175
assert trace_args["event"] == "$ai_trace"
11761176
assert trace_props["$ai_input_state"] == {}
@@ -1187,9 +1187,9 @@ async def test_async_anthropic_streaming(mock_client):
11871187
)
11881188
chain = prompt | ChatAnthropic(
11891189
api_key=ANTHROPIC_API_KEY,
1190-
model="claude-3-opus-20240229",
1190+
model="claude-sonnet-4-5-20250929",
11911191
temperature=0,
1192-
max_tokens=1,
1192+
max_tokens=1024,
11931193
streaming=True,
11941194
stream_usage=True,
11951195
)

posthog/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = "6.8.0"
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",

0 commit comments

Comments
 (0)