HackerTrans
TopNewTrendsCommentsPastAskShowJobs

djp2803

no profile record

Submissions

Show HN: Rehearse – a pytest like testing library for voice agents

1 points·by djp2803·il y a 5 mois·3 comments

comments

djp2803
·il y a 5 mois·discuss
Thanks Pranay for sharing this!, how are you testing your agent deployments today? is it vibe testing or automated?
djp2803
·il y a 5 mois·discuss
Ideal UX:

    @pytest.mark.asyncio
    async def test_agent_handles_profanity():

        async with VAPICall(
            phone_number="+15551234567",
            api_key="your-bland-key",
            background_noise=BackgroundNoise.TRAFFIC,
            noise_level=0.4,
            speaking_style=SpeakingStyle(
                accent="american",
                speed=1.4,  # Speaking fast when angry
            ),
        ) as call:

            await call.listen()  # Greeting
    
            await call.say(
                "This is bullshit, I want to speak to a manager!",
                emotion="angry",
            )
            response = await call.listen()
    
            # Agent should remain professional and de-escalate
            await expect(response).to_satisfy(
                "remains calm and professional",
                "does not mirror the profanity",
                "offers to escalate or resolve the issue",
                llm=judge
            )
            expect(response.audio).to_not_have_emotion("angry")
            expect(response.latency).to_be_less_than(2.5)