Skip to main content

Overview

The Pulse Playground is designed for building and testing your extraction pipeline visually. Once you’re happy with the results, the Show Code feature generates ready-to-run SDK code that reproduces your exact configuration — making the transition from Playground to production seamless.

The Show Code Feature

1
Configure your pipeline
2
Set up your extraction settings, split topics, and/or schema in the Playground as you normally would. Run it on a sample document to verify the results.
3
Click “Show Code”
4
Click the </> Show Code button in the pipeline configuration panel. A modal opens with generated code matching your exact configuration.
5
Select your language
6
Choose from Python, TypeScript, or curl using the language tabs at the top of the modal.
7
Copy and integrate
8
Click Copy to copy the code to your clipboard. The code is ready to run — just replace YOUR_API_KEY and the file path with your actual values.

What Gets Included

The generated code reflects your exact Playground configuration:
SettingIncluded?
Page range✅ If set
Figure extraction✅ If enabled
Figure descriptions✅ If enabled
Show images✅ If enabled
Return HTML✅ If enabled
Effort mode✅ If enabled
Chunking settings✅ If configured
Chunk size✅ If set
Split topics✅ If split step added
Schema (single mode)✅ If schema step added
Per-topic schemas (split mode)✅ If split + schema configured
Saved preset IDs✅ Uses config IDs when presets are loaded

Generated Code Examples

Extract Only

from pulse_python_sdk import Pulse

client = Pulse(api_key="YOUR_API_KEY")

result = client.extract(
    file=open("your_document.pdf", "rb"),
    extract_figure=True,
    return_html=False,
    storage={"enabled": True}
)

print(result.markdown)
print(f"Extraction ID: {result.extraction_id}")

Extract → Split → Schema

from pulse_python_sdk import Pulse

client = Pulse(api_key="YOUR_API_KEY")

# Extract
result = client.extract(
    file=open("your_document.pdf", "rb"),
    extract_figure=True,
    storage={"enabled": True}
)
extraction_id = result.extraction_id

# Split
split_result = client.split.document(
    extraction_id=extraction_id,
    split_config={
        "topics": [
            {"name": "Financials", "description": "Revenue and expense data"},
            {"name": "Leadership", "description": "Executive team information"}
        ]
    }
)
split_id = split_result.split_id

# Schema per topic
schema_result = client.schema.extract_schema(
    split_id=split_id,
    split_schema_config={
        "Financials": {
            "schema": {"type": "object", "properties": {"revenue": {"type": "number"}}},
            "schema_prompt": "Extract financial metrics"
        },
        "Leadership": {
            "schema": {"type": "object", "properties": {"ceo": {"type": "string"}}},
            "schema_prompt": "Extract leadership info"
        }
    }
)

print(schema_result.results)

Using Presets in Production

If your pipeline uses a saved preset (rather than inline configuration), the generated code references the preset’s config ID:
# Show Code output when using a saved preset
result = client.extract(
    file=open("your_document.pdf", "rb"),
    extraction_config_id="abc123-saved-preset-id",
    storage={"enabled": True}
)
This is the recommended approach for production because:
  • Centralized config — update the preset once, all future runs pick up the change
  • Team consistency — everyone references the same validated configuration
  • Cleaner code — no need to inline large schemas in every request
If you’ve edited a preset’s settings in the current session without saving, the generated code uses the edited inline settings rather than the preset ID — ensuring the code matches what you see in the Playground.
See Step Preset Library for the full guide on saving and using presets.

Production Best Practices

Always use async_=True (Python) or async: true (TypeScript/curl) in production. This returns immediately with a job_id that you poll, preventing request timeouts on large documents.See Async Processing for the polling pattern.
Pass storage={"enabled": True} so Pulse saves the extraction result. This lets you run /split and /schema on the same extraction later without re-processing.
Instead of polling, register a webhook URL and Pulse will POST the result to you when processing completes.See Webhooks for setup.
The API returns structured error codes. Always check for error responses and implement retry logic for transient failures.See Error Handling for the full error code reference.
If you’re running the same pipeline across many documents, save your settings as presets and use the config IDs. This makes your API calls shorter and your configuration auditable.