Skip to main content

Crate ragrig_gpui

Crate ragrig_gpui 

Source
Expand description

Reusable GPUI components for Ragrig.

ragrig-gpui packages the chat, composer, transcript, attachment, session, agent-status and settings surfaces needed to build a RAG front end. The crate contains no editor: hosting applications such as Sciscraper compose these components into their own layout.

§State model

The reducers in ChatState are plain data. ChatView wraps one in an entity, keeps one TextViewState per message for incremental Markdown, and renders it with MessageScroller. Composer owns its input and emits ComposerEvents; it does not know about a controller.

§Feature flags

  • ragrig (default): enables the Ragrig controller, full settings page, and the composite RagChat surface. The worker uses a dedicated Tokio runtime thread.
  • grobid: enables GROBID/BibTeX reference ingestion through grobid-bibtex, the reference rows, and their hover copy actions. It implies ragrig.

Modules§

prelude
Common imports for hosts of ragrig-gpui.

Structs§

AgentBar
A row of pipeline components with status dots and detail popovers.
AgentComponent
One component shown in the agent bar.
AgentInfo
The active Ragrig agent, as reported after a successful build.
Attachment
One chip above the composer.
AttachmentRows
A wrapping row of Attachment chips.
CancelFlag
A cloneable, thread-safe cancellation flag.
ChatMessage
A message as stored in a ChatState.
ChatSettings
Chat-model configuration.
ChatState
The transcript reducer.
ChatView
A streamed, Markdown transcript with metadata and source chips.
Composer
A reusable chat input.
EmptyState
The empty-transcript state.
IngestProgress
A readable snapshot of a running ingestion.
LibraryDocument
One document in the vector store, for the library panel.
LibrarySnapshot
A snapshot of the vector store.
MessageId
Stable identity of one message in a ChatState.
MessageMeta
Pipeline metadata shown in a message footer.
NewMessage
Input for ChatState::push and ChatState::replace.
PendingAttachment
One context item waiting for the next question.
RagChat
A complete chat surface backed by a Ragrig controller.
RagController
Sends commands to the Ragrig worker and mirrors its state for widgets.
RagReply
Metadata returned with a finished answer.
RagSettings
Editable configuration shown by the settings page.
RagSetup
Everything needed to build one ragrig::RagAgent.
RequestId
Identity of one request (generation or ingestion) sent to the worker.
SciscraperAttach
Merge attachments and retrieved chunks into Sciscraper’s context containers.
SessionEntry
One saved conversation.
SessionInfo
One saved conversation, before the controller formats it.
SessionPicker
A dropdown of saved conversations.
SessionTurn
A conversation turn loaded from the session store.
SidePanel
A reusable left/right dock surface.
SourceRef
One retrieved source shown under an assistant message.
SyncSummary
Result of a completed ingestion.

Enums§

AgentBarEvent
What the user asked the agent bar to do.
AttachmentEvent
What the user did with an attachment chip.
AttachmentKind
How an attachment chip behaves.
AttachmentSource
Where an attached context item comes from.
ChatProvider
Chat backend offered by the settings page.
ChatRole
Who authored a message.
ChatViewEvent
What the user did inside the transcript.
ComponentKind
The role a component plays in the RAG pipeline.
ComponentStatus
Status of one agent component.
ComposerEvent
What the host should do after the composer was used.
IngestPhase
Coarse ingestion phase, used for status text and progress emphasis.
MemoryChoice
Memory strategy offered by the settings page.
MessageState
Lifecycle of one message.
PdfBackend
PDF backend offered by the settings page.
RagChatEvent
What the composite chat surface reports to its host.
RagCommand
Work sent from the UI to the Ragrig worker.
RagEvent
Events emitted by the worker and re-emitted by the controller.
SessionPickerEvent
What the user asked the picker to do.

Functions§

chat_settings
Build a complete Settings element for chat configuration.
chat_settings_page
Build the standard chat settings page.
init
Initializes the GPUI kit and Ragrig UI state.
rag_settings
Build a complete Settings element for Ragrig configuration.
rag_settings_page
Build the full Ragrig settings page.
stabilize_markdown
Closes a code fence left open at the end of a streaming answer.