Refactor token tracking: Remove token_cost_process parameter for cleaner code

This commit is contained in:
Brandon Hancock
2025-02-28 12:17:14 -05:00
parent ef48cbe971
commit 75d8e086a4
3 changed files with 21 additions and 9 deletions

View File

@@ -133,8 +133,14 @@ class TestTokenTracking:
Integration test for token tracking with LangChainAgentAdapter.
This test requires an OpenAI API key.
"""
# Skip if LangGraph is not installed
try:
from langgraph.prebuilt import ToolNode
except ImportError:
pytest.skip("LangGraph is not installed. Install it with: uv add langgraph")
# Initialize a ChatOpenAI model
llm = ChatOpenAI(model="gpt-3.5-turbo")
llm = ChatOpenAI(model="gpt-4o")
# Create a LangChainAgentAdapter with the direct LLM
agent = LangChainAgentAdapter(