Skip to content

Commit 8ee950b

Browse files
committed
Update Readme
1 parent 60f4eff commit 8ee950b

File tree

1 file changed

+32
-7
lines changed

1 file changed

+32
-7
lines changed

README.md

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,33 @@ export default agents;
103103

104104
This is a more complex, representative implementation that illustrates a customer service flow, with the following features:
105105
- A more complex agent graph with agents for user authentication, returns, sales, and a placeholder human agent for escalations.
106-
- An escalation by the [returns](src/app/agentConfigs/customerServiceRetail/returns.ts) agent to `o4-mini` to validate and initiate a return, as an example high-stakes decision, using a similar pattern to the above.
106+
- An escalation by the [returns](https://github.com/openai/openai-realtime-agents/blob/60f4effc50a539b19b2f1fa4c38846086b58c295/src/app/agentConfigs/customerServiceRetail/returns.ts#L233) agent to `o4-mini` to validate and initiate a return, as an example high-stakes decision, using a similar pattern to the above.
107107
- Prompting models to follow a state machine, for example to accurately collect things like names and phone numbers with confirmation character by character to authenticate a user.
108108
- To test this flow, say that you'd like to return your snowboard and go through the necessary prompts!
109109

110+
Configuration in [src/app/agentConfigs/customerServiceRetail/index.ts](src/app/agentConfigs/customerServiceRetail/index.ts).
111+
```javascript
112+
import authentication from "./authentication";
113+
import returns from "./returns";
114+
import sales from "./sales";
115+
import simulatedHuman from "./simulatedHuman";
116+
import { injectTransferTools } from "../utils";
117+
118+
authentication.downstreamAgents = [returns, sales, simulatedHuman];
119+
returns.downstreamAgents = [authentication, sales, simulatedHuman];
120+
sales.downstreamAgents = [authentication, returns, simulatedHuman];
121+
simulatedHuman.downstreamAgents = [authentication, returns, sales];
122+
123+
const agents = injectTransferTools([
124+
authentication,
125+
returns,
126+
sales,
127+
simulatedHuman,
128+
]);
129+
130+
export default agents;
131+
```
132+
110133
## Schematic
111134

112135
This diagram illustrates a more advanced interaction flow defined in `src/app/agentConfigs/customerServiceRetail/`.
@@ -166,23 +189,25 @@ sequenceDiagram
166189

167190
</details>
168191

169-
# Next Steps
170-
- You can copy these to make your own multi-agent voice app! Once you make a new agent set config, add it to `src/app/agentConfigs/index.ts` and you should be able to select it in the UI in the "Scenario" dropdown menu.
192+
# Other Info
193+
## Next Steps
194+
- You can copy these templates to make your own multi-agent voice app! Once you make a new agent set config, add it to `src/app/agentConfigs/index.ts` and you should be able to select it in the UI in the "Scenario" dropdown menu.
195+
- Each agentConfig can define instructions, tools, and toolLogic. By default all tool calls simply return `True`, unless you define the toolLogic, which will run your specific tool logic and return an object to the conversation (e.g. for retrieved RAG context).
171196
- If you want help creating your own prompt using the conventions shown in customerServiceRetail, including defining a state machine, we've included a metaprompt [here](src/app/agentConfigs/voiceAgentMetaprompt.txt), or you can use our [Voice Agent Metaprompter GPT](https://chatgpt.com/g/g-678865c9fb5c81918fa28699735dd08e-voice-agent-metaprompt-gpt)
172197

173-
# Output Guardrails
198+
## Output Guardrails
174199
Assistant messages are checked for safety and compliance using a guardrail function before being finalized in the transcript. This is implemented in [`src/app/hooks/useHandleServerEvent.ts`](src/app/hooks/useHandleServerEvent.ts) as the `processGuardrail` function, which is invoked on each assistant message (after every 5 incremental words received) to run a moderation/classification check. You can review or customize this logic by editing the `processGuardrail` function definition and its invocation inside `useHandleServerEvent`.
175200

176-
# Navigating the UI
201+
## Navigating the UI
177202
- You can select agent scenarios in the Scenario dropdown, and automatically switch to a specific agent with the Agent dropdown.
178203
- The conversation transcript is on the left, including tool calls, tool call responses, and agent changes. Click to expand non-message elements.
179204
- The event log is on the right, showing both client and server events. Click to see the full payload.
180205
- On the bottom, you can disconnect, toggle between automated voice-activity detection or PTT, turn off audio playback, and toggle logs.
181206

182-
# Pull Requests
207+
## Pull Requests
183208

184209
Feel free to open an issue or pull request and we'll do our best to review it. The spirit of this repo is to demonstrate the core logic for new agentic flows; PRs that go beyond this core scope will likely not be merged.
185210

186-
## Core Contributors
211+
# Core Contributors
187212
- Noah MacCallum - [noahmacca](https://x.com/noahmacca)
188213
- Ilan Bigio - [ibigio](https://github.com/ibigio)

0 commit comments

Comments
 (0)