3434
3535# %%
3636import base64
37- import dataclasses as _dc
37+ import dataclasses
3838import os
3939import tempfile
4040from contextlib import contextmanager
4747from pydantic import BaseModel , Field
4848
4949import kaggle_benchmarks as kbench
50- from kaggle_benchmarks import actors as _actors
51- from kaggle_benchmarks .chats import ChatRoom as _ChatRoom
52- from kaggle_benchmarks .content_types import audios , images , videos
50+ from kaggle_benchmarks .actors import Actor
51+ from kaggle_benchmarks .chats import ChatRoom
52+ from kaggle_benchmarks .content_types import (
53+ audios ,
54+ images ,
55+ videos ,
56+ )
5357
5458# Models to be tested as the primary subject.
5559TEST_LLM_NAMES = {
@@ -308,13 +312,13 @@ def test_extract_pydantic(llm):
308312# --- Test Case: Structured Output (composite pydantic Extraction) ---
309313
310314
311- class Actor (BaseModel ):
315+ class FriendsActor (BaseModel ):
312316 actor_name : str
313317 role_name : str
314318
315319
316320class Casting (BaseModel ):
317- actors : list [Actor ]
321+ actors : list [FriendsActor ]
318322
319323
320324# Known failures (genai): gpt-5.5 — MP sends empty json_schema.name.
@@ -1070,7 +1074,7 @@ def test_tool_with_schema_output(llm):
10701074@kbench .task ()
10711075def test_chatroom_add_participant (llm ):
10721076 """Tests that the same LLM added twice yields independent participants."""
1073- room = _ChatRoom (
1077+ room = ChatRoom (
10741078 system_prompt = "A quick Q&A between two experts." ,
10751079 name = "Host" ,
10761080 )
@@ -1132,7 +1136,7 @@ def test_chatroom_add_participant(llm):
11321136# within a ChatRoom context, combining multi-participant rooms with schema.
11331137
11341138
1135- @_dc .dataclass (frozen = True )
1139+ @dataclasses .dataclass (frozen = True )
11361140class _CityFact :
11371141 """A structured fact about a city."""
11381142
@@ -1145,12 +1149,12 @@ class _CityFact:
11451149@kbench .task ()
11461150def test_chatroom_talk_structured_output (llm ):
11471151 """Tests that reply(schema=) works inside a ChatRoom."""
1148- room = _ChatRoom (
1152+ room = ChatRoom (
11491153 system_prompt = "A geography quiz game." ,
11501154 name = "QuizMaster" ,
11511155 )
11521156
1153- host = _actors . Actor (name = "QuizMaster" , role = "user" , avatar = "🎯" )
1157+ host = Actor (name = "QuizMaster" , role = "user" , avatar = "🎯" )
11541158 room .add_participant (host )
11551159 player = room .add_participant (
11561160 llm ,
@@ -1190,7 +1194,7 @@ def test_chatroom_talk_structured_output(llm):
11901194@kbench .task ()
11911195def test_chatroom_multi_turn (llm ):
11921196 """Tests multi-turn conversation: 2 rounds of moderator prompt → LLM reply."""
1193- room = _ChatRoom (
1197+ room = ChatRoom (
11941198 system_prompt = "A two-round trivia game." ,
11951199 name = "Trivia" ,
11961200 )
@@ -1241,7 +1245,7 @@ def test_chatroom_multi_turn(llm):
12411245@kbench .task ()
12421246def test_chatroom_private_channel (llm ):
12431247 """Tests that private_channel messages are invisible to non-members."""
1244- room = _ChatRoom (
1248+ room = ChatRoom (
12451249 system_prompt = "A team coordination exercise with a secret planning phase." ,
12461250 name = "Coordinator" ,
12471251 )
@@ -1303,9 +1307,9 @@ def test_chatroom_private_channel(llm):
13031307@kbench .task ()
13041308def test_chatroom_actor_talk (llm ):
13051309 """Tests that a non-LLM Actor can post messages that LLMs respond to."""
1306- game = _actors . Actor (name = "GameEngine" , role = "user" , avatar = "🎮" )
1310+ game = Actor (name = "GameEngine" , role = "user" , avatar = "🎮" )
13071311
1308- room = _ChatRoom (
1312+ room = ChatRoom (
13091313 system_prompt = "A simple number guessing game. The GameEngine posts a number, the Player guesses." ,
13101314 name = "GameEngine" ,
13111315 )
0 commit comments