Skip to content
d.nikolaev
All projects
FlagshipProductUnder NDA

GPT assistant chat

Streamed answers, step-and-condition templates, conversation branching, file uploads

Role
Frontend engineer: template logic, streaming, files, SSO
Period
Apr 2024 — Jul 2026
Team
4 people
Company
LazurM

Details and code are covered by an agreement: I describe the problems and solutions without exposing internals.

Anonymised GPT assistant chat marked NDA

An assistant for staff and students: a free-form chat plus a template mode where the prompt is assembled step by step. It answers as a stream, remembers conversation branches, accepts files and works under the platform’s single sign-on.

What I did

  • Streamed model answers: reading the stream via ReadableStream and rendering token by token without waiting for the full response
  • Prompt templates as a scenario: steps, blocks, loops and transition conditions instead of one large input field
  • Interactive template outline: step-by-step navigation through the scenario with the ability to go back
  • Conversation branching: regenerating an answer creates a branch instead of overwriting the previous one
  • File uploads attached to a message and accounted for in the request context
  • Single sign-on with correct handling of a token that expires mid-stream
  • Markdown rendering with code highlighting, conversation export, dark and light themes

Context

The product

The assistant is embedded into the platform ecosystem: the user signs in once and works either in a regular chat or in template mode — pre-built scenarios for typical tasks.

A template differs from a plain prompt in that it guides the user: it asks questions step by step, can repeat blocks and choose the next step based on a condition.

Problem

The problem

A model answer takes a long time. Waiting for the whole thing is unacceptable: without streaming the interface looks frozen and the user cannot tell whether the request is working.

Templates require their own data model: steps, blocks, loops and transition conditions must be stored and presented so that the user understands where they are in the scenario.

Authentication is a separate subtlety. The token can expire while the stream is already open, and that must be handled without losing the context the user has entered.

Solution

The solution

The answer appears as it is generated, templates walk through the steps, and earlier answer variants are kept. Files attach to a message, and sign-in is shared with the platform.

Outcome

The outcome

The assistant became a working tool inside the platform: templates cover recurring tasks, streaming removed the feeling of a frozen interface, and history branching allows calm experimentation with wording.

Technically this is the most interesting product project for me: it required working with streams rather than the usual request-response pattern, and designing an interface for a non-linear conversation history.

Interface

Anonymised GPT assistant chat marked NDA

Related projects