The repository
A start folder and the finish.
Open the kitembed in conversations-room-starter; the app before it: embed/start
Build with Conversations · Recipe
Practice inside the product you already have.
Where to run it. Open your own product's repository in your coding assistant (to try it on our sample, a copy of the embed/start folder of conversations-room-starter), with your key in FOREVERLEARNING_API_KEY, the API host in FOREVERLEARNING_BASE_URL and your assignment in FOREVERLEARNING_ASSIGNMENT_ID, in the environment it runs commands in. Then paste the prompt.
Goal: a practice room from the Conversations API inside my existing product, in the product's own look, with the rest of the product unchanged.
Read first: https://developers.foreverlearning.ai/docs/conversation-practice/ (the Conversations API integration guide), and the OpenAPI contract and the TypeScript example linked there. Use only what they describe.
Start from: this repository. Find the place in the product where a user should practice a conversation (in the sample, Team Desk's "Practice the conversation" panel, which says "Practice is coming soon.").
Build:
1. One server-side module with two routes on the product's own server: one starts a practice for the current user (read the catalog, prepare a session in the ready-made room titled "Direct Feedback To A Report" with the first persona the room recommends, and request its opening, once per session); one sends the user's message as a turn on that session. Only this module calls the Conversations API, and only it reads the key.
2. Connect the module to the existing server with the smallest change you can.
3. In that place in the product, show the conversation from each saved conversation_turn event: each entry of the turn's cast (its display_name and text) under that name, the Coach's note (the turn's coach.text) apart from the characters' lines (show nothing when coach is null or empty), and the safety status (level and response action) and the receipt (request id, turns billed, charge) with each reply. Use the product's own colors, type and components.
4. Beside each character's line, show a face for that character from the saved turn's characters (match each to its line by speaker_id, and use its expression_group): a face drawn in code, in the product's look, for each of the five expression_group moods, and a neutral face when it is empty. Keep all the face artwork in one clearly named file, with one entry per mood and a comment that says how to put in your own images instead of the drawn ones.
5. Treat a turn as complete only when its done event arrives with the same request id and session id as its metadata event. Then append its receipt as one JSON line to receipts.jsonl on the server: request id, session id, user id, operation, safety level, units, the amount in micro-dollars and the settlement.
Rules:
- Keep the API key on the server, in the FOREVERLEARNING_API_KEY environment variable. Read the API host from FOREVERLEARNING_BASE_URL, and send FOREVERLEARNING_ASSIGNMENT_ID as X-Assignment-Id. Never send the key to the browser, print it or write it into a file. Add the three to the product's .env.example without values.
- Use the product's own opaque user id as X-User-Id, never a name or an email. If the product has no sign-in (the sample has none), keep a pseudonymous id in a cookie.
- Give every POST its own new Idempotency-Key, a UUID. If a turn's outcome is uncertain, look it up with GET /v1/requests/<request id>; never send it again under a new key while its outcome is uncertain.
- If a turn fails (an error event arrives before done), it was not charged and it is final: show a short message in the product's own words and let the user send a message again. Never show raw error text or JSON.
- Show the characters' words exactly as returned. Don't change anything else in the product.
- The faces are the characters' simulated responses in this practice, never a reading of the user. Give each face its mood in words as its accessible label only, never as a caption on the page: the user reads the face.
- The opening and each message are billable text turns, at 3¢ per text turn. Test with the opening and two messages, no more, as one user. Don't end the session.
- Ending is optional: opening the learner's next session closes the open one with one billable closeout (3 cents), the same as calling end yourself. Call end when you want the debrief right away. Do not call end just to start another practice.
- Stop only the processes you started; never stop processes by name.
Done when:
- you ran `npm start`, opened the practice in the product, the room opened there, you answered, and a character replied by name
- a face beside each character's line, and the Coach's note, the safety status and the receipt with the reply; the rest of the product looks and works as before
- receipts.jsonl has one line for each confirmed turnPaste into your coding assistant.
How to check it. Start your app and open its practice panel. The room opens; answer the character. You should see:
The full check is in CHECK.md. To compare your result, the finished checkpoint is the embed folder of conversations-room-starter.
The replies below are quoted word for word from one of our test runs of this kit, an app built from its prompt. Every reply is written fresh, so yours will use different words.
Start your app (on the sample, npm start in your copy of embed/start) and open the practice. On the sample, open http://localhost:3000 and press Practice with Jon.
The rest of the page is as it was: on the sample, Team Desk's header and "Your one-to-ones" are unchanged. The practice panel now holds the room:
Safety: clear · action: none) and the receipt (1 text turn · $0.03 and the request id). Showing a shortened request id is fine if the full id is on the reply too, for example on hover.All of it in your product's own colors and type.
Jon: You said fifteen minutes. What’s this about?
Coach
What happened: Jon opened by asking for the purpose of the meeting and kept his wording brief.
Why it matters: Naming the purpose clearly can make the feedback specific without turning it into a general judgment.
Next move: You could start with the Halvorsen handoff, the client impact, and the change you need to see.
You: I wanted to talk about the last two reports. They came in after the deadline, and I'd like to understand what's getting in the way.
Jon: The reports weren't late from my end. The Brightline handoff had missing retention terms, and Halvorsen was ready for QA. QA was supposed to catch the schema issue.
Coach
What happened: You named the two delayed reports and asked what was getting in the way; Jon pushed back on the idea that the delays were his responsibility.
Why it matters: He is pointing to specific handoff and QA responsibilities, so the conversation can stay anchored in what each person owned.
Next move: You could ask him to walk through his readiness check for each report, starting with the Halvorsen handoff.
Beside each character's line, a face drawn in code that follows their mood on that turn: one of five moods, or the neutral face when no expression is reported. The faces are the characters' simulated responses, never a reading of you.
Your own artwork. All the face artwork is in one place: in the finished checkpoint, the block marked YOUR OWN ARTWORK GOES HERE in public/faces.js. Put your images in public/faces/ and write each one's address there, one per mood (and if you like, per expression or per character). Any mood you leave empty keeps the drawn face.
The key. The page calls only your own server's practice routes, never the Conversations API, and no page or script contains the key. On the server, receipts.jsonl gains one line for each confirmed turn.
A start folder and the finish.
Open the kitembed in conversations-room-starter; the app before it: embed/start
One click to start.
DownloadEvery call, by hand.
Read the integration guidePractice before it counts.
Read the integration guide