goals

Stream Goal Turn

Changed on

Run one turn and stream it: reply deltas first, document last.

Written or spoken, it is the same turn against the same conversation, so it is one endpoint taking one of the two: a message, or an audio note that gets transcribed into one. Both at once is a request the page could not have meant, so it is refused rather than silently resolved.

delivery names how the REPLY reaches the athlete — voice only when a live voice front will speak it (a spoken conversation's delegated turns). A voice-note upload is still a text turn: its reply lands on the screen.

athlete_said is repeated once per line the athlete actually said, and it is what a spoken turn has to send (#2461). message is the prompt, and on the typed page the prompt and the athlete's message are the same string — which is why the store read the athlete out of the prompt for a year and was right. A spoken turn breaks that: its message is a window with both speakers labeled in it, so the athlete's own words have to arrive as their own field or they are gone. The typed page sends nothing here and nothing changes for it (:func:_athlete_said).

It is refused beside an audio note for the same reason a note is refused beside a message: the note is the athlete's words, so a caller sending both is claiming words the audio can contradict. Storing the claim over the transcript would put sentences into the athlete's mouth that the coach never heard, which is the defect this field exists to close.

Either credential runs the same turn (#2635). A page presents the three browser signals; the app presents the Firebase bearer it already sends, and the conversation it reaches is the install's own. What the bearer adds is what happens when a turn settles: the goal lands in an account, minting one if the athlete has none.

Neither a message nor a note is the coach's opening (#3111), on a typed conversation: the coach speaks first, before the athlete has written a word. Only text delivery, and only with no athlete_said, because a spoken conversation opens on the voice front's own greeting and a request claiming the athlete said something has a turn to run. Written once and replayed after (:func:~cheshire.goals.turn.run_goal_turn), and charged like a turn, because the first one is a model call.

post/goals/turn/stream

Request

  • Base URL
    https://api.imperfect.co (the document declares no server; this is the origin it was published from)
  • URL
    https://api.imperfect.co/goals/turn/stream
  • Auth
    HTTP bearer

Headers

x-device-timezonestring nullable
x-device-hintstring nullable
x-client-platformstring nullable

Request body multipart/form-data

messagestring nullable
audiostring binary nullable
localestring nullable
units'metric' | 'imperial' nullable
delivery'text' | 'voice' nullable
athlete_saidstring[] nullable
arrivalstring nullable
racestring nullable

Response

Successful Response

unknown required

Changes