Documentation
¶
Overview ¶
Package chat implements the narrow DataTug Chat proof of concept: an ADK agent may invoke one DTQL tool, and DataTug executes that tool into a structured secureread.Result.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatSchemaContext ¶
func FormatSchemaContext(schema *api.CatalogSchema) string
FormatSchemaContext converts DataTug's stored schema into a compact prompt fragment. It is deterministic so model and snapshot tests stay stable.
func FormatValue ¶
FormatValue applies basic terminal-safe value formatting.
Types ¶
type ADKConversation ¶
type ADKConversation struct {
// contains filtered or unexported fields
}
ADKConversation is a persistent in-memory ADK session with one DataTug tool.
func NewADKConversation ¶
func NewADKConversation(llm model.LLM, executor DTQLExecutor, sourceURL, schemaContext string, options ...Option) (*ADKConversation, error)
NewADKConversation builds the constrained chat agent. schemaContext is a compact description derived from DataTug's stored dbmodel.
type Conversation ¶
Conversation is the UI-facing chat seam and is trivial to fake in tests.
type DTQLExecutor ¶
type DTQLExecutor interface {
RunDTQL(context.Context, string, []byte, map[string]any) (secureread.Result, error)
}
DTQLExecutor is the existing DataTug query boundary used by Chat.
type GridColumn ¶
GridColumn is the UI-ready description of a structured result column.
type GridModel ¶
type GridModel struct {
Columns []GridColumn
Rows [][]string
// contains filtered or unexported fields
}
GridModel is the terminal-grid boundary. Values are formatted only here, after query execution has produced a structured secureread.Result.
func NewGridModel ¶
func NewGridModel(result secureread.Result) GridModel
NewGridModel converts a structured query result into display cells while preserving explicit result-column order.
type Option ¶
type Option func(*conversationConfig) error
Option configures the constrained ADK conversation.
func WithThinkingLevel ¶
WithThinkingLevel maps the CLI's provider-neutral effort onto ADK's portable thinking budget. pi-go also receives the original level so providers with their own effort controls can apply it directly.
type QueryResult ¶
type QueryResult struct {
DTQL string
Result secureread.Result
Err error
}
QueryResult records one structured tool execution for the UI.
type Turn ¶
type Turn struct {
Text string
Queries []QueryResult
}
Turn is one completed agent turn. Text is model prose; Queries remain structured and are never reconstructed from Text.
type UI ¶
type UI struct {
// contains filtered or unexported fields
}
UI is the Bubble Tea chat model: a scrollable history viewport, inline Bubbles table components, and a fixed bottom input.
func NewUI ¶
func NewUI(ctx context.Context, conversation Conversation, modelName string) *UI
NewUI creates the terminal chat model without starting a real terminal.