SLNG_API_KEY, SLNG_WORLD_PART (your SLNG project’s region, like eu-north) and OPENAI_API_KEY.
The agent
Run it
Install the plugins your framework needs next to the library:console talks to your microphone. Use dev in its place to connect to a LiveKit server. For Pipecat, open http://localhost:7860 and talk.
Try it
Say “My number is six one two, three four five.” That is not a full number. The save is refused, and the agent asks for the number again. Then give a full number with its country code. The agent keeps it.What the code does
Stateis a Pydantic model. It holds what the call remembers.Phoneis a value type from the library. It checks the number and stores it in E.164.CallState(State)keeps one live copy of that model for the call.AgentSpecdescribes the agent: its prompt, and heresave_values=True. It reads the same on both frameworks.save_values=Truegives the model asave_valuestool. Each save is checked againstState. A wrong value comes back to the model with a reason it can act on.- On LiveKit,
UnmuteAgentruns the spec as a normal LiveKitAgent. On Pipecat,UnmuteFlowsruns it in your pipeline. Each takes the call’s state beside the spec. - Speech to text, the model, text to speech and turn detection stay framework plugins. SLNG’s plugins carry Soniox and Fish Audio.
VOICEis a Fish Audio voice id. On LiveKit,stt.attach_to_session(session)lets speech to text close each caller turn as soon as the caller stops. See SLNG.
Where to go next
Pick one path.Build a salon agent
Grow this agent one piece per page: a greeting, a tool, task steps, a handoff and traces.
Add one piece to your agent
Keep your own LiveKit or Pipecat agent, and add only the parts you need.