Skip to content

Commit cc58097

Browse files
committed
fixing outline tests
1 parent 2b71cb3 commit cc58097

File tree

1 file changed

+21
-37
lines changed

1 file changed

+21
-37
lines changed

tests/models/test_outlines.py

Lines changed: 21 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -324,11 +324,9 @@ async def test_request_async(llamacpp_model: OutlinesModel) -> None:
324324
)
325325
],
326326
instructions='Answer in one word.',
327+
run_id=IsStr(),
327328
),
328-
ModelResponse(
329-
parts=[TextPart(content=IsStr())],
330-
timestamp=IsDatetime(),
331-
),
329+
ModelResponse(parts=[TextPart(content=IsStr())], timestamp=IsDatetime(), run_id=IsStr()),
332330
]
333331
)
334332
result = await agent.run('What is the capital of Germany?', message_history=result.all_messages())
@@ -342,11 +340,9 @@ async def test_request_async(llamacpp_model: OutlinesModel) -> None:
342340
)
343341
],
344342
instructions='Answer in one word.',
343+
run_id=IsStr(),
345344
),
346-
ModelResponse(
347-
parts=[TextPart(content=IsStr())],
348-
timestamp=IsDatetime(),
349-
),
345+
ModelResponse(parts=[TextPart(content=IsStr())], timestamp=IsDatetime(), run_id=IsStr()),
350346
ModelRequest(
351347
parts=[
352348
UserPromptPart(
@@ -355,11 +351,9 @@ async def test_request_async(llamacpp_model: OutlinesModel) -> None:
355351
)
356352
],
357353
instructions='Answer in one word.',
354+
run_id=IsStr(),
358355
),
359-
ModelResponse(
360-
parts=[TextPart(content=IsStr())],
361-
timestamp=IsDatetime(),
362-
),
356+
ModelResponse(parts=[TextPart(content=IsStr())], timestamp=IsDatetime(), run_id=IsStr()),
363357
]
364358
)
365359

@@ -376,12 +370,10 @@ def test_request_sync(llamacpp_model: OutlinesModel) -> None:
376370
content='What is the capital of France?',
377371
timestamp=IsDatetime(),
378372
)
379-
]
380-
),
381-
ModelResponse(
382-
parts=[TextPart(content=IsStr())],
383-
timestamp=IsDatetime(),
373+
],
374+
run_id=IsStr(),
384375
),
376+
ModelResponse(parts=[TextPart(content=IsStr())], timestamp=IsDatetime(), run_id=IsStr()),
385377
]
386378
)
387379

@@ -408,12 +400,10 @@ async def test_request_async_model(mock_async_model: OutlinesModel) -> None:
408400
content='What is the capital of France?',
409401
timestamp=IsDatetime(),
410402
)
411-
]
412-
),
413-
ModelResponse(
414-
parts=[TextPart(content=IsStr())],
415-
timestamp=IsDatetime(),
403+
],
404+
run_id=IsStr(),
416405
),
406+
ModelResponse(parts=[TextPart(content=IsStr())], timestamp=IsDatetime(), run_id=IsStr()),
417407
]
418408
)
419409

@@ -445,12 +435,10 @@ def test_request_image_binary(transformers_multimodal_model: OutlinesModel, bina
445435
],
446436
timestamp=IsDatetime(),
447437
)
448-
]
449-
),
450-
ModelResponse(
451-
parts=[TextPart(content=IsStr())],
452-
timestamp=IsDatetime(),
438+
],
439+
run_id=IsStr(),
453440
),
441+
ModelResponse(parts=[TextPart(content=IsStr())], timestamp=IsDatetime(), run_id=IsStr()),
454442
]
455443
)
456444

@@ -478,12 +466,10 @@ def test_request_image_url(transformers_multimodal_model: OutlinesModel) -> None
478466
],
479467
timestamp=IsDatetime(),
480468
)
481-
]
482-
),
483-
ModelResponse(
484-
parts=[TextPart(content=IsStr())],
485-
timestamp=IsDatetime(),
469+
],
470+
run_id=IsStr(),
486471
),
472+
ModelResponse(parts=[TextPart(content=IsStr())], timestamp=IsDatetime(), run_id=IsStr()),
487473
]
488474
)
489475

@@ -536,12 +522,10 @@ class Box(BaseModel):
536522
content='Give me the dimensions of a box',
537523
timestamp=IsDatetime(),
538524
)
539-
]
540-
),
541-
ModelResponse(
542-
parts=[TextPart(content=IsStr())],
543-
timestamp=IsDatetime(),
525+
],
526+
run_id=IsStr(),
544527
),
528+
ModelResponse(parts=[TextPart(content=IsStr())], timestamp=IsDatetime(), run_id=IsStr()),
545529
]
546530
)
547531

0 commit comments

Comments
 (0)