You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32-7Lines changed: 32 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -103,10 +103,33 @@ export default agents;
103
103
104
104
This is a more complex, representative implementation that illustrates a customer service flow, with the following features:
105
105
- 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.
107
107
- 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.
108
108
- To test this flow, say that you'd like to return your snowboard and go through the necessary prompts!
109
109
110
+
Configuration in [src/app/agentConfigs/customerServiceRetail/index.ts](src/app/agentConfigs/customerServiceRetail/index.ts).
This diagram illustrates a more advanced interaction flow defined in `src/app/agentConfigs/customerServiceRetail/`.
@@ -166,23 +189,25 @@ sequenceDiagram
166
189
167
190
</details>
168
191
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).
171
196
- 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)
172
197
173
-
# Output Guardrails
198
+
##Output Guardrails
174
199
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`.
175
200
176
-
# Navigating the UI
201
+
##Navigating the UI
177
202
- You can select agent scenarios in the Scenario dropdown, and automatically switch to a specific agent with the Agent dropdown.
178
203
- The conversation transcript is on the left, including tool calls, tool call responses, and agent changes. Click to expand non-message elements.
179
204
- The event log is on the right, showing both client and server events. Click to see the full payload.
180
205
- On the bottom, you can disconnect, toggle between automated voice-activity detection or PTT, turn off audio playback, and toggle logs.
181
206
182
-
# Pull Requests
207
+
##Pull Requests
183
208
184
209
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.
0 commit comments