Install
openclaw skills install @psyb0t/go-unstructuredUnofficial Go clients for the Unstructured Platform and Partition APIs, generated with oapi-codegen. Package unstructured covers sources, destinations, workflows, jobs, templates, notifications and usage; subpackage partition handles multipart document extraction. Use when Go code needs Unstructured API calls or already imports github.com/psyb0t/go-unstructured.
openclaw skills install @psyb0t/go-unstructuredUnofficial typed Go clients for Unstructured. Use package unstructured at the module root for Platform operations and subpackage partition for document partitioning.
Read references/setup.md for installation, base URLs, operation names, upload handling and pagination.
UNSTRUCTURED_API_KEY and set unstructured-api-key in a request editor. Never hardcode, commit or log it.https://platform.unstructuredapp.io for Platform and https://api.unstructuredapp.io for Partition. Upload requests send the selected document's contents to Unstructured.github.com/psyb0t/go-unstructured or its partition subpackage.AGENTS.md for generation instructions.The usage notes below cover a few calls. Every operation in each spec has a generated method, and the spec's descriptions are on them as Go doc comments. Look names and fields up instead of guessing. After go get github.com/psyb0t/go-unstructured, from inside your module:
go doc github.com/psyb0t/go-unstructured ClientWithResponsesInterface # every Platform endpoint method
go doc github.com/psyb0t/go-unstructured ListSourcesParams # one method, params type or model
go doc -all github.com/psyb0t/go-unstructured # the whole Platform package
go doc github.com/psyb0t/go-unstructured/partition ClientWithResponsesInterface # the Partition endpoint method
go doc github.com/psyb0t/go-unstructured/partition PartitionParameters # Partition multipart form fields
The same documentation is at https://pkg.go.dev/github.com/psyb0t/go-unstructured.
Method names come from the spec's operation IDs. <OperationId>WithResponse takes the context, then the path parameters in order, then *<OperationId>Params when the operation has query or header parameters, then the request body when it has one. The JSON200 field (or JSON201 and so on, per declared status) holds the decoded body; it is nil for any other status. Operations with multipart bodies (PartitionWithBodyWithResponse, CreateJobWithBodyWithResponse, RunWorkflowWithBodyWithResponse) have only the WithBody variant, which takes a content type and an io.Reader in place of the typed body.
Construct unstructured.NewClientWithResponses with the Platform base URL and unstructured.WithRequestEditorFn. The editor sets req.Header.Set("unstructured-api-key", os.Getenv("UNSTRUCTURED_API_KEY")). Then call ListSourcesWithResponse(ctx, &unstructured.ListSourcesParams{}) to list sources. The complete compiling example is in the root example_test.go and README.
For Partition, construct partition.NewClientWithResponses with the Partition base URL and partition.WithRequestEditorFn using the same header. Call PartitionWithBodyWithResponse with a multipart body. See the setup reference before writing an upload.
Check both the returned error and the response status. Errors cover request, transport and decoding failures. API error statuses can return a nil Go error and a nil JSON200. Inspect StatusCode(), Body and any matching decoded error field. Check optional pointers before dereferencing them.
Number fields use float64. Both packages expose methods generated from the entire respective spec. Finish by compiling the calling code and testing it against a local HTTP server, without calling the provider during tests.