File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
posthog/test/ai/langchain Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1+ import asyncio
12import logging
23import math
34import os
45import time
56import uuid
6- import asyncio
77from typing import List , Optional , TypedDict , Union
88from unittest .mock import patch
99
1313from langchain_community .llms .fake import FakeListLLM , FakeStreamingListLLM
1414from langchain_core .messages import AIMessage , HumanMessage
1515from langchain_core .prompts import ChatPromptTemplate
16- from langchain_core .runnables import RunnableLambda , RunnableParallel
16+ from langchain_core .runnables import RunnableLambda
1717from langchain_openai .chat_models import ChatOpenAI
1818from langgraph .graph .state import END , START , StateGraph
1919
@@ -1019,8 +1019,8 @@ async def sleep(x): # -> Any:
10191019 )
10201020 approximate_latency = math .floor (time .time () - start_time )
10211021 assert mock_client .capture .call_count == 3
1022+
10221023 first_call , second_call , third_call = mock_client .capture .call_args_list
1023- print (approximate_latency , third_call [1 ]["properties" ]["$ai_latency" ])
10241024 assert first_call [1 ]["event" ] == "$ai_generation"
10251025 assert second_call [1 ]["event" ] == "$ai_trace"
10261026 assert second_call [1 ]["properties" ]["$ai_trace_name" ] == "RunnableSequence"
You can’t perform that action at this time.
0 commit comments