Skip to content

Commit 3baccfe

Browse files
committed
fix: missing field
1 parent 434a756 commit 3baccfe

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

posthog/test/ai/langchain/test_callbacks.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1565,6 +1565,7 @@ def test_anthropic_cache_write_and_read_tokens(mock_client):
15651565
usage_metadata={
15661566
"input_tokens": 200,
15671567
"output_tokens": 30,
1568+
"total_tokens": 1030,
15681569
"cache_read_input_tokens": 800, # Anthropic cache read
15691570
},
15701571
)
@@ -1711,7 +1712,9 @@ def test_combined_reasoning_and_cache_tokens(mock_client):
17111712

17121713
@pytest.mark.skipif(not OPENAI_API_KEY, reason="OPENAI_API_KEY is not set")
17131714
def test_openai_reasoning_tokens(mock_client):
1714-
model = ChatOpenAI(api_key=OPENAI_API_KEY, model="o4-mini", max_tokens=10)
1715+
model = ChatOpenAI(
1716+
api_key=OPENAI_API_KEY, model="o4-mini", max_completion_tokens=10
1717+
)
17151718
cb = CallbackHandler(
17161719
mock_client, trace_id="test-trace-id", distinct_id="test-distinct-id"
17171720
)

0 commit comments

Comments
 (0)