77pytest .importorskip ("langchain_openai" )
88
99import respx
10+ from assets import ASSETS
1011from conftest import BASIC , STREAM_CHUNKS , _chunk , completion , last_body , mock_json , mock_sse
1112
1213from interfaze import InterfazeError
@@ -99,13 +100,13 @@ def test_video_block_converted_to_file_part():
99100 message = HumanMessage (
100101 content = [
101102 {"type" : "text" , "text" : "what happens in this clip?" },
102- {"type" : "video" , "url" : "https://example.com/clip.mp4" },
103+ {"type" : "video" , "url" : ASSETS [ "video" ] },
103104 ]
104105 )
105106 model .invoke ([message ]) # must not raise
106107 body = last_body (route )
107108 content = body ["messages" ][- 1 ]["content" ]
108- assert {"type" : "file" , "file" : {"file_data" : "https://example.com/clip.mp4" }} in content
109+ assert {"type" : "file" , "file" : {"file_data" : ASSETS [ "video" ] }} in content
109110
110111
111112@respx .mock
@@ -126,7 +127,7 @@ def test_streaming_strips_inline_tags_and_carries_precontext():
126127 mock_sse (STREAM_CHUNKS )
127128 model = ChatInterfaze (api_key = "t" )
128129 chunks = list (model .stream ([HumanMessage ("x" )]))
129- text = "" .join (c .content for c in chunks )
130+ text = "" .join (c .content for c in chunks ) # ty:ignore[no-matching-overload]
130131 assert "<precontext>" not in text
131132 assert text == "Total is $12.34"
132133 precontext_chunks = [c for c in chunks if c .additional_kwargs .get ("precontext" )]
@@ -148,7 +149,7 @@ def test_streaming_recovers_reasoning_split_across_chunks():
148149 mock_sse (THINK_SPLIT )
149150 model = ChatInterfaze (api_key = "t" )
150151 chunks = list (model .stream ([HumanMessage ("x" )]))
151- text = "" .join (c .content for c in chunks )
152+ text = "" .join (c .content for c in chunks ) # ty:ignore[no-matching-overload]
152153 assert "<think>" not in text and text == "The sky is blue."
153154 reasoning = [c for c in chunks if c .additional_kwargs .get ("reasoning" )]
154155 assert reasoning and reasoning [0 ].additional_kwargs ["reasoning" ] == "Rayleigh scattering."
0 commit comments