code-dot-org icon indicating copy to clipboard operation
code-dot-org copied to clipboard

Gen AI: more robust chat logging

Open bencodeorg opened this issue 1 year ago • 0 comments

In service of simplifying our chat logging, a couple of related changes.

Break up chat history in UI into three pieces:

  • chatMessagesPast: past messages that are from a previous "session" and are only now needed from a UI perspective (ie, to show students what they did before). Added to when chatMessagesCurrent is wiped (see below).
  • chatMessagesCurrent: current set of messages that we're sending to the model. Append to this when we get a response from the model, and wipe and move existing messages to chatMessagesPast when a new session is created (eg, by a change in system prompt)
  • chatMessagePending: the message a user has input and is awaiting response from the server. Wiped once we receive a response from the server.

Standardizes response from Rails in all cases to be a list of messages that should be appended to the chat history in the UI.

Links

  • slides with a bit of graphical description: link

bencodeorg avatar May 16 '24 00:05 bencodeorg