Installation
Install the screen template by running the following command:screens/document-splitting-screen.tsx.
Usage
Required Props
Example
workflow.py
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
A screen template for splitting a document into multiple pages
npx shadcn add https://registry.samplehc.com/r/document-splitting.json
screens/document-splitting-screen.tsx.
| Name | Type | Description |
|---|---|---|
resultId | string | The async result ID returned from a split document API call |
from workflows_py.workflow import ScreenStep, Step, Workflow
from client_manager import SampleHealthcareClient
workflow = Workflow(...)
def split_document(ctx):
client = SampleHealthcareClient()
response = client.v2.documents.split(
document=ctx.get_step_result("document-upload")["document"],
)
return response.async_result_id
workflow.then(
# See: Document Upload Screen template
ScreenStep(
"document-upload",
screen_path="./screens/document-upload-screen.tsx",
)
).then(
Step(
"split-document",
split_document,
)
)
.then(
ScreenStep(
"document-splitting",
screen_path="./screens/document-splitting-screen.tsx",
get_props=lambda ctx: {"resultId": ctx.get_step_result("split-document")},
)
)
| Name | Type | Description |
|---|---|---|
documents | array | Array of document objects created from the splits |
documents[].id | string | Unique identifier for the created document |
documents[].fileName | string | Name of the created document file |
documents[].startPageInclusive | number | First page of the document (inclusive) |
documents[].endPageInclusive | number | Last page of the document (inclusive) |