Documentation
¶
Index ¶
- Constants
- func CardData(task *ConvertTask) map[string]interface{}
- func NormalizeDocumentReadFormat(raw string) string
- func SupportsDocumentReadFormat(raw string) bool
- type ASRSpeechOptions
- type AudioOptions
- type Capabilities
- type ConvertOutput
- type ConvertTask
- type DocumentEngineInfo
- type DocumentOptions
- type DocumentReadResult
- type DocumentReader
- type Handler
- func (h *Handler) CancelTask(c echo.Context) error
- func (h *Handler) DownloadOutput(c echo.Context) error
- func (h *Handler) GetCapabilities(c echo.Context) error
- func (h *Handler) GetOutputLocation(c echo.Context) error
- func (h *Handler) GetTask(c echo.Context) error
- func (h *Handler) ListTasks(c echo.Context) error
- func (h *Handler) RegisterRoutes(g *echo.Group)
- type HelperRunner
- type HelperStatus
- type ImageOptions
- type OutputPreviewKind
- type PresentationOptions
- type ResolvedSource
- type Service
- func (s *Service) BuildPromptSummary(ctx context.Context, userID, conversationID string, limit int) string
- func (s *Service) CancelTask(ctx context.Context, userID, conversationID, taskID string) (*ConvertTask, error)
- func (s *Service) Capabilities(ctx context.Context) Capabilities
- func (s *Service) Close() error
- func (s *Service) GetTask(ctx context.Context, userID, conversationID, taskID string) (*ConvertTask, error)
- func (s *Service) IsManagedPath(path string) bool
- func (s *Service) ListTasks(ctx context.Context, userID, conversationID string, limit int) ([]*ConvertTask, error)
- func (s *Service) RecordAttachment(ctx context.Context, userID, conversationID, name, mimeType string, ...) (string, error)
- func (s *Service) ResolveDownload(ctx context.Context, userID, conversationID, taskID, outputID string) (*ConvertTask, *ConvertOutput, error)
- func (s *Service) Submit(ctx context.Context, userID, conversationID string, req TaskRequest) (*ConvertTask, error)
- func (s *Service) WaitForTask(ctx context.Context, userID, conversationID, taskID string, wait time.Duration) (*ConvertTask, error)
- type SpeechOptions
- type Store
- func (s *Store) CleanupExpired(cutoff time.Time) (taskIDs []string, taskRoots []string, sourcePaths []string, err error)
- func (s *Store) CreateSource(source *StoredSource) error
- func (s *Store) CreateTask(task *ConvertTask) error
- func (s *Store) GetSource(sourceID string) (*StoredSource, error)
- func (s *Store) GetTask(taskID string) (*ConvertTask, error)
- func (s *Store) ListSources(userID, conversationID string, limit int) ([]*StoredSource, error)
- func (s *Store) ListTasks(userID, conversationID string, limit int) ([]*ConvertTask, error)
- func (s *Store) MarkInterruptedTasksFailed(message string) error
- func (s *Store) UpdateTask(task *ConvertTask) error
- type StoredSource
- type TTSSpeechOptions
- type TabularSummary
- type TabularTopValue
- type TabularWorkbookSummary
- type TaskOptions
- type TaskRequest
- type TaskStatus
- type TimeSegment
- type VideoOptions
Constants ¶
const ( ActionConvert = "convert" ActionMerge = "merge" ActionSplit = "split" ActionTrim = "trim" ActionExtractAudio = "extract_audio" ActionExtractFrame = "extract_frames" ActionTTS = "tts" ActionASR = "asr" )
Variables ¶
This section is empty.
Functions ¶
func CardData ¶
func CardData(task *ConvertTask) map[string]interface{}
func NormalizeDocumentReadFormat ¶
NormalizeDocumentReadFormat normalizes office-style document extensions into the extraction families understood by the reader.
func SupportsDocumentReadFormat ¶
SupportsDocumentReadFormat reports whether the reader can attempt a readable extraction for the provided extension.
Types ¶
type ASRSpeechOptions ¶
type AudioOptions ¶
type Capabilities ¶
type Capabilities struct {
Available bool `json:"available"`
Platform string `json:"platform"`
Actions []string `json:"actions"`
Tools map[string]bool `json:"tools,omitempty"`
Helper HelperStatus `json:"helper"`
Document map[string][]string `json:"document,omitempty"`
DocumentEngines []DocumentEngineInfo `json:"document_engines,omitempty"`
Image map[string][]string `json:"image,omitempty"`
Audio map[string][]string `json:"audio,omitempty"`
Video map[string]interface{} `json:"video,omitempty"`
Speech map[string]interface{} `json:"speech,omitempty"`
Retention string `json:"retention,omitempty"`
Notes []string `json:"notes,omitempty"`
WorkingDir string `json:"working_dir,omitempty"`
}
type ConvertOutput ¶
type ConvertOutput struct {
ID string `json:"output_id"`
Name string `json:"name"`
MimeType string `json:"mime_type,omitempty"`
SizeBytes int64 `json:"size_bytes,omitempty"`
PreviewKind OutputPreviewKind `json:"preview_kind,omitempty"`
DownloadURL string `json:"download_url,omitempty"`
Ref string `json:"ref,omitempty"`
PreviewText string `json:"preview_text,omitempty"`
Path string `json:"path,omitempty"`
}
type ConvertTask ¶
type ConvertTask struct {
ID string `json:"task_id"`
ConversationID string `json:"conversation_id,omitempty"`
UserID string `json:"user_id,omitempty"`
Action string `json:"action"`
Status TaskStatus `json:"status"`
Sources []string `json:"sources,omitempty"`
TargetFormat string `json:"target_format,omitempty"`
SourceSummary string `json:"source_summary,omitempty"`
Progress float64 `json:"progress,omitempty"`
Message string `json:"message,omitempty"`
Error string `json:"error,omitempty"`
TranscriptPreview string `json:"transcript_preview,omitempty"`
Outputs []ConvertOutput `json:"outputs,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
StartedAt *time.Time `json:"started_at,omitempty"`
CompletedAt *time.Time `json:"completed_at,omitempty"`
Request *TaskRequest `json:"-"`
}
type DocumentEngineInfo ¶
type DocumentOptions ¶
type DocumentOptions struct {
Pages []int `json:"pages,omitempty"`
}
type DocumentReadResult ¶
type DocumentReadResult struct {
Format string `json:"format"`
Text string `json:"text"`
TabularSummary *TabularWorkbookSummary `json:"tabular_summary,omitempty"`
ExtractedVia string `json:"extracted_via,omitempty"`
}
DocumentReadResult is the normalized read-only extraction payload used by the workspace read tool for office-style documents.
type DocumentReader ¶
type DocumentReader struct {
// contains filtered or unexported fields
}
DocumentReader extracts readable text from local office-style documents without exposing convert tasks/output artifacts to callers.
func NewDocumentReader ¶
func NewDocumentReader() *DocumentReader
NewDocumentReader creates a default document reader backed by local parsers and detected document engines.
func (*DocumentReader) ReadDocument ¶
func (r *DocumentReader) ReadDocument(ctx context.Context, path string) (*DocumentReadResult, error)
ReadDocument extracts readable text from a local office-style document.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func (*Handler) RegisterRoutes ¶
type HelperRunner ¶
type HelperRunner struct{}
func NewHelperRunner ¶
func NewHelperRunner() *HelperRunner
func (*HelperRunner) Run ¶
func (r *HelperRunner) Run(ctx context.Context, payload map[string]interface{}) (*helperResponse, error)
func (*HelperRunner) Status ¶
func (r *HelperRunner) Status() HelperStatus
type HelperStatus ¶
type ImageOptions ¶
type OutputPreviewKind ¶
type OutputPreviewKind string
const ( PreviewFile OutputPreviewKind = "file" PreviewAudio OutputPreviewKind = "audio" PreviewVideo OutputPreviewKind = "video" PreviewImage OutputPreviewKind = "image" PreviewPDF OutputPreviewKind = "pdf" PreviewText OutputPreviewKind = "text" )
type PresentationOptions ¶
type ResolvedSource ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewServiceWithReadDB ¶
func (*Service) BuildPromptSummary ¶
func (*Service) CancelTask ¶
func (*Service) Capabilities ¶
func (s *Service) Capabilities(ctx context.Context) Capabilities
func (*Service) IsManagedPath ¶
func (*Service) RecordAttachment ¶
func (*Service) ResolveDownload ¶
func (s *Service) ResolveDownload(ctx context.Context, userID, conversationID, taskID, outputID string) (*ConvertTask, *ConvertOutput, error)
func (*Service) Submit ¶
func (s *Service) Submit(ctx context.Context, userID, conversationID string, req TaskRequest) (*ConvertTask, error)
func (*Service) WaitForTask ¶
type SpeechOptions ¶
type SpeechOptions struct {
TTS TTSSpeechOptions `json:"tts,omitempty"`
ASR ASRSpeechOptions `json:"asr,omitempty"`
}
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) CleanupExpired ¶
func (*Store) CreateSource ¶
func (s *Store) CreateSource(source *StoredSource) error
func (*Store) CreateTask ¶
func (s *Store) CreateTask(task *ConvertTask) error
func (*Store) ListSources ¶
func (s *Store) ListSources(userID, conversationID string, limit int) ([]*StoredSource, error)
func (*Store) ListTasks ¶
func (s *Store) ListTasks(userID, conversationID string, limit int) ([]*ConvertTask, error)
func (*Store) MarkInterruptedTasksFailed ¶
func (*Store) UpdateTask ¶
func (s *Store) UpdateTask(task *ConvertTask) error
type StoredSource ¶
type StoredSource struct {
ID string `json:"id"`
UserID string `json:"user_id"`
ConversationID string `json:"conversation_id"`
Name string `json:"name"`
MimeType string `json:"mime_type,omitempty"`
Path string `json:"path"`
SizeBytes int64 `json:"size_bytes,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
type TTSSpeechOptions ¶
type TabularSummary ¶
type TabularSummary struct {
Source string `json:"source,omitempty"`
RowCount int `json:"row_count"`
FormulaCount int `json:"formula_count,omitempty"`
Headers []string `json:"headers,omitempty"`
DateColumns []string `json:"date_columns,omitempty"`
ColumnKinds map[string]string `json:"column_kinds,omitempty"`
NumericTotals map[string]float64 `json:"numeric_totals,omitempty"`
GroupedTotals map[string]map[string]map[string]float64 `json:"grouped_totals,omitempty"`
TopByMetric map[string]map[string]TabularTopValue `json:"top_by_metric,omitempty"`
ChangedCells int `json:"changed_cells,omitempty"`
Highlights []string `json:"highlights,omitempty"`
}
func SummarizeDelimitedFile ¶
func SummarizeDelimitedFile(path string) (*TabularSummary, error)
type TabularTopValue ¶
type TabularWorkbookSummary ¶
type TabularWorkbookSummary struct {
SheetSummaries []TabularSummary `json:"sheet_summaries,omitempty"`
Highlights []string `json:"highlights,omitempty"`
}
type TaskOptions ¶
type TaskOptions struct {
Document DocumentOptions `json:"document,omitempty"`
Presentation PresentationOptions `json:"presentation,omitempty"`
Image ImageOptions `json:"image,omitempty"`
Audio AudioOptions `json:"audio,omitempty"`
Video VideoOptions `json:"video,omitempty"`
Speech SpeechOptions `json:"speech,omitempty"`
}
type TaskRequest ¶
type TaskRequest struct {
Action string `json:"action"`
Sources []string `json:"sources,omitempty"`
TargetFormat string `json:"target_format,omitempty"`
OutputPath string `json:"output_path,omitempty"`
Text string `json:"text,omitempty"`
TaskID string `json:"task_id,omitempty"`
WaitMS int `json:"wait_ms,omitempty"`
Options TaskOptions `json:"options,omitempty"`
}
type TaskStatus ¶
type TaskStatus string
const ( StatusPending TaskStatus = "pending" StatusProcessing TaskStatus = "processing" StatusSucceeded TaskStatus = "succeeded" StatusFailed TaskStatus = "failed" StatusCancelled TaskStatus = "cancelled" )
func (TaskStatus) IsTerminal ¶
func (s TaskStatus) IsTerminal() bool
type TimeSegment ¶
type VideoOptions ¶
type VideoOptions struct {
Codec string `json:"codec,omitempty"`
Width int `json:"width,omitempty"`
Height int `json:"height,omitempty"`
FrameRate int `json:"frame_rate,omitempty"`
BitRate int `json:"bit_rate,omitempty"`
StartMS int64 `json:"start_ms,omitempty"`
EndMS int64 `json:"end_ms,omitempty"`
FrameIntervalMS int64 `json:"frame_interval_ms,omitempty"`
Segments []TimeSegment `json:"segments,omitempty"`
}