docling

package
v0.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AsyncDoclingResponse

type AsyncDoclingResponse struct {
	TaskID       string `json:"task_id"`
	TaskStatus   string `json:"task_status"`
	TaskPosition int    `json:"task_position,omitempty"`
}

type Client

type Client struct {
	ClientConfig *ClientConfig `json:"client_config"`
}

func NewClientFromURL

func NewClientFromURL(clientConfig *ClientConfig) *Client

func (*Client) ConvertFile

func (c *Client) ConvertFile(
	ctx context.Context, fileURL string, doclingConfig DoclingConfig,
) (*AsyncDoclingResponse, error)

func (*Client) GetConvertedFile

func (c *Client) GetConvertedFile(ctx context.Context, taskID string) (TaskStatus, *DoclingResponse, error)

type ClientConfig

type ClientConfig struct {
	URL                   string
	Key                   string
	MaxConcurrentRequests int64
	// contains filtered or unexported fields
}

type DoclingConfig

type DoclingConfig struct {
	FromFormats     []string `json:"from_formats"`
	ToFormats       []string `json:"to_formats"`
	ImageExportMode string   `json:"image_export_mode"`
	DoOCR           bool     `json:"do_ocr"`
	ForceOCR        bool     `json:"force_ocr"`
	OCREngine       string   `json:"ocr_engine"`
	OCRLang         []string `json:"ocr_lang"`
	PDFBackend      string   `json:"pdf_backend"`
	TableMode       string   `json:"table_mode"`
	AbortOnError    bool     `json:"abort_on_error"`
}

+kubebuilder:object:generate=true

func (*DoclingConfig) DeepCopy

func (in *DoclingConfig) DeepCopy() *DoclingConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DoclingConfig.

func (*DoclingConfig) DeepCopyInto

func (in *DoclingConfig) DeepCopyInto(out *DoclingConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DoclingRequestPayload

type DoclingRequestPayload struct {
	Options *DoclingConfig  `json:"options"`
	Sources []DoclingSource `json:"sources"`
}

type DoclingResponse

type DoclingResponse struct {
	Document       DoclingResponseDocument `json:"document"`
	Status         TaskStatus              `json:"status"`
	ProcessingTime float64                 `json:"processing_time"`
	Errors         []string                `json:"errors"`
}

type DoclingResponseDocument

type DoclingResponseDocument struct {
	FileName       string `json:"filename"`
	MDContent      string `json:"md_content"`
	HTMLContent    string `json:"html_content"`
	TextContent    string `json:"text_content"`
	DocTagsContent string `json:"doctags_content"`
}

type DoclingSource

type DoclingSource struct {
	URL     string            `json:"url"`
	Kind    string            `json:"kind"`
	Headers map[string]string `json:"headers,omitempty"`
}

type TaskStatus

type TaskStatus string
const (
	TaskStatusPending TaskStatus = "pending" // this is returned by /v1/status/poll and /v1/result endpoint
	TaskStatusStarted TaskStatus = "started" // this is returned by /v1/status/poll and /v1/result endpoint
	TaskStatusSuccess TaskStatus = "success" // this is returned by /v1/status/poll and /v1/result endpoint
	TaskStatusFailure TaskStatus = "failure" // this is returned by /v1/status/poll and /v1/result endpoint

	TaskStatusPartialSuccess TaskStatus = "partial_success" // this is only returned by /v1/result endpoint
	TaskStatusSkipped        TaskStatus = "skipped"         // this is only returned by /v1/result endpoint

	SemaphoreAcquireError = "failed to acquire docling semaphore"
	SemaphorePanicError   = "semaphore: released more than held"
)

type TaskStatusResponse

type TaskStatusResponse struct {
	TaskID       string     `json:"task_id"`
	TaskStatus   TaskStatus `json:"task_status"`
	TaskPosition int        `json:"task_position"`
	ErrorMessage string     `json:"error_message,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL