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 widget: it exports the editor roundtrip contract (editor) so hosting applications such as Scico can plug in their own editor component.

§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.

Re-exports§

pub use editor::*;

Modules§

editor
The editor roundtrip contract.
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.
ChatIdentity
How the assistant signs its messages.
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.
ComponentToggle
A switch shown in a component’s status popover.
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.
PromptActions
Host actions for the system-prompt file row.
RagChanges
The editable fields that differ from the applied configuration.
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.
ScicoAttach
Merge attachments and retrieved chunks into Scico’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.
SettingRow
A titled setting row whose title marks unsaved changes.
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.
ChatIcon
An icon the host can plug into crate::EmptyState or crate::ChatIdentity.
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.
GrobidSource
Where the GROBID server comes from.
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.
RagField
One editable RAG setting.
RagSection
A group of settings shown on one page.
SessionPickerEvent
What the user asked the picker to do.

Constants§

DEFAULT_GROBID_IMAGE
The default managed GROBID image: all CRF and Deep Learning models.
DEFAULT_GROBID_URL
The GROBID URL used when no server URL has been configured.

Functions§

chat_settings
Build a complete Settings element for chat configuration.
chat_settings_page
Build the standard chat settings page.
control
Box a control closure.
dirty_color
The bold violet that marks unsaved settings.
dirty_header
The style refinement that marks a page header as unsaved.
dropdown_control
A dropdown control built from (value, label) pairs.
init
Initializes the GPUI kit and Ragrig UI state.
no_changes
A Changes closure for hosts that do not track pending edits.
number_control
A numeric control that commits on Enter or blur.
path_control
A path input with a Browse… button, for use inside a SettingRow.
path_setting
A path field with a Browse… button.
rag_model_page
The model, retrieval, parsing, and memory groups.
rag_reference_processing_group
The reference-processing rows for a host that manages the GROBID server on its own External services page.
rag_references_group
The reference-ingestion group for a host’s library page.
rag_settings
Build a complete Settings element for Ragrig configuration.
rag_settings_page
Build the complete Ragrig settings page.
stabilize_markdown
Closes a code fence left open at the end of a streaming answer.
switch_control
A switch control.
text_control
A one-line text control.
token_control
A power-of-two token slider, for use inside a SettingRow.
token_slider
A slider over powers of two.

Type Aliases§

Changes
Reports which settings differ from the configuration applied to the worker.
Control
A control rendered beside a SettingRow title.
ExportPrompt
Writes the host’s built-in prompt into the workspace and opens it.
OpenPrompt
Opens the effective prompt in the host editor.