I started from the restaurant example here, where the `agents` are included in the userdata. Same for the medical office triage here. This all worked fine for many months, but today I wanted to have another LLM for one of the agents.
The session works just fine, but for tests, I have something like this
async def test_greeter_...(
base_userdata,
setup...,
) -> None:
and
@pytest.fixture
def base_userdata(mock_dtmf_handler, mock_room, backend_client) -> UserData:
...
return UserData(
room=mock_room,
dtmf_handler=mock_dtmf_handler,
...
agents=get_agents(),
)
When running the tests, pytest complains about not being able to pickle the agent if it includes a custom LLM, which makes sense.
Questions:
- What’s the best practice for having agents globally available?
- If they should be in userdata, how to make the agent still pickable and avoid problems when running tests
Thanks!