* extract-basic: migrate workflow to llama-cloud v2 SDK
Switch extract-basic to llama-cloud>=2.3.0 and the v2 extract API:
configuration_id replaces extraction_agent_id, ExtractConfig mirrors
ExtractConfiguration (tier/extraction_target/etc), and process_file now
uses client.extract.create + wait_for_completion + get with
expand=["extract_metadata"] and ExtractedData.from_extract_job.
metadata_workflow resolves schemas via client.configurations.retrieve
gated on ExtractV2Parameters.
* extract-basic: update fake server and tests for llama-cloud v2
Rewrite FakeLlamaCloudServer.extract for v2 routes (POST/GET
/api/v2/extract, schema validate/generate, /api/v1/beta/configurations
CRUD) and update split to read categories from the nested
configuration payload. Rewrite test_extract and test_split to the v2
SDK shapes (client.extract.run with inline configuration and
configuration_id; split with configuration={'categories': [...]}).
* extract-basic: split configurations namespace out of extract fake
Move /api/v1/beta/configurations CRUD handlers and StoredConfiguration
state into their own FakeConfigurationsNamespace. FakeExtractNamespace
now takes a FakeConfigurationsNamespace and delegates configuration_id
lookups to it. Server wires both namespaces independently.
- Enable contentHash option in WorkflowTrigger to compute SHA-256 hash of file contents before upload
- Pass file_hash from UI to backend workflow for deduplication
- Remove file download from backend start_extraction step - no longer needed since hash comes from UI
- Fall back to external_file_id from file metadata when file_hash is not provided
- Remove unused imports (hashlib, tempfile, os, httpx, Path) and file_path from state
This improves efficiency by avoiding redundant file downloads just to compute the content hash.
https://claude.ai/code/session_01EX9SjB2rHLqBYLRvYVoSKy
Co-authored-by: Claude <noreply@anthropic.com>
* feat(extract-basic): update UI to @llamaindex/ui 4.x
Update the extract-basic template UI to use the latest @llamaindex/ui
version (4.1.2) with the following changes:
- Update dependencies to latest versions (@llamaindex/ui ~4.1.2,
@llamaindex/workflows-client ^1.8.3, react-router-dom ^7.8.0, etc.)
- Migrate API client from createCloudAgentClient/cloudApiClient to
configureCloudClient/getCloudClient/createAgentDataConfig
- Update TypedAgentData to AgentDataItem
- Update Button component to use label/startIcon props instead of children
- Update imports to use types from @llamaindex/ui instead of llama-cloud-services
https://claude.ai/code/session_01Y5nbgonCDBWGEtEzN3Ua6f
* fix(extract-basic): update @llamaindex/ui to ^4.1.3
Update @llamaindex/ui from ~4.1.2 to ^4.1.3 minimum version.
Version 4.1.3 includes project ID support via ApiProvider.
https://claude.ai/code/session_01Y5nbgonCDBWGEtEzN3Ua6f
* fix(extract-basic): configure cloud client with project ID
Add projectId option to configureCloudClient() to include Project-Id
header in all cloud API requests. This properly scopes requests to
the agent's project when authenticating with a user cookie.
https://claude.ai/code/session_01Y5nbgonCDBWGEtEzN3Ua6f
---------
Co-authored-by: Claude <noreply@anthropic.com>
* Add parse configuration to coding agent templates and extract-basic
Add ParseConfig and ParseSettings models to support LlamaParse configuration
through config.json. This allows configuring parse tier (fast/agentic),
version, max_pages, and target_pages via ResourceConfig annotations.
- Add ParseConfig and ParseSettings Pydantic models to config.py
- Add parse section to extract-basic configs/config.json
- Update AGENTS.extraction.md with parse configuration documentation
https://claude.ai/code/session_01HCw4cnMMFpKYgRA9m2ryC6
* Remove target_pages from parse config, add lang setting
target_pages is job-specific (varies per file) and doesn't belong in
global configuration. Added lang setting for document language hints.
https://claude.ai/code/session_01HCw4cnMMFpKYgRA9m2ryC6
* Remove lang from parse config
Language detection is handled automatically by LlamaParse, so there's
no need to expose it as a required configuration option.
https://claude.ai/code/session_01HCw4cnMMFpKYgRA9m2ryC6
* Add lang as optional parse setting
https://claude.ai/code/session_01HCw4cnMMFpKYgRA9m2ryC6
* chore: auto-fix Lint issues (#212)
Co-authored-by: adrianlyjak <2024018+adrianlyjak@users.noreply.github.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: llama-org-ci-bot[bot] <231146559+llama-org-ci-bot[bot]@users.noreply.github.com>
Co-authored-by: adrianlyjak <2024018+adrianlyjak@users.noreply.github.com>
* fix: handle nullable union types in _generate_value()
JSON Schema represents nullable fields as type arrays (e.g.,
["number", "null"]). The code compared these arrays against strings,
causing all nullable fields to fall through to the text blob default,
producing invalid data that always failed Pydantic validation.
Extract the first concrete (non-null) type from the array so the
correct generator branch is used.
https://claude.ai/code/session_01NMzCmbJGa6WNS6ceb1aXT7
* test: add unit tests for _generate_value schema handling
Cover nullable union types (["number", "null"]), all basic types,
string formats (date-time, email, uri), composite schemas (object,
array, oneOf, anyOf), and edge cases (depth limit, empty enum,
unknown mapping). 35 tests total.
https://claude.ai/code/session_01NMzCmbJGa6WNS6ceb1aXT7
* test: rewrite deterministic tests as flat parametrized functions
Replace class-based tests with idiomatic pytest: parametrized cases
for basic/nullable types and numeric bounds, a kitchen-sink
integration test, and minimal standalone tests for edge cases.
https://claude.ai/code/session_01NMzCmbJGa6WNS6ceb1aXT7
---------
Co-authored-by: Claude <noreply@anthropic.com>
* feat: add LLAMA_DEPLOY_SERVER_PORT HMR clientPort to template vite configs
Set hmr.clientPort to LLAMA_DEPLOY_SERVER_PORT when defined, enabling
Vite HMR websocket connections to work through the server proxy.
https://claude.ai/code/session_01Hq5ZQxquwtyJVJ2qw48bbt
* feat: add LLAMA_DEPLOY_SERVER_PORT HMR support to template vite configs
Add hmr.port and hmr.clientPort to all template vite configs so that
Vite HMR websocket connections work through the server proxy. When
LLAMA_DEPLOY_SERVER_PORT is set, clientPort directs the browser's HMR
websocket to connect via the proxy server port.
Bump patch versions for all affected templates.
https://claude.ai/code/session_01Hq5ZQxquwtyJVJ2qw48bbt
---------
Co-authored-by: Claude <noreply@anthropic.com>
* Refactor extract-basic to prevent load_config anti-pattern
- Remove bad example from create_union_schema() docstring that showed
using a load_config() function
- Add comprehensive example showing the correct Resource-based pattern
for multi-document-type workflows
- Update AGENTS.extraction.md with prominent warnings about the
load_config anti-pattern and proper ResourceConfig usage
- Add "Common Mistakes" section documenting this critical anti-pattern
The load_config pattern bypasses ResourceConfig, causing extraction
configs to be invisible in the workflow representation and preventing
users from editing extraction schemas in the UI.
* Add DRY pattern for ResourceConfig type aliases
Show how to store ResourceConfig annotations as type aliases
(e.g., Extract10KConfig) that can be reused across multiple workflow
steps and Resource functions, reducing duplication.
* Simplify ResourceConfig documentation
Remove explicit anti-pattern examples that may inadvertently teach
the pattern. Keep warnings brief and general, focus on showing the
correct Resource function pattern.
---------
Co-authored-by: Claude <noreply@anthropic.com>
* feat: template with new sdk
* chore: more test updates
* chore: more tests
* chore: update system prompt
* fix: generate_value for nested pydantic models
* chore: template validation
* chore: add ExtractedData
* chore: last tweaks to new sdk template
* feat: add --template flag to bundle-coder.sh (#181)
* feat: add --template flag to bundle-coder.sh
Add a -T/--template flag to select which template to bundle instead of
creating a separate script. This consolidates bundle-coder.sh and
bundle-coder-new-sdk.sh into a single script.
- Default template remains 'extract-basic'
- Use --template extract-basic-new to bundle the new SDK template
- Template name suffix is included in the e2b template name
* Update bundle-coder.sh
---------
Co-authored-by: Claude <noreply@anthropic.com>
* chore: pr suggestions
* chore: package versioning
* chore: move extract-basic-new to extract-basic
* chore: prompt tweaks
* fix: typo
* fix: typo pt2
* chore: pr suggestions
---------
Co-authored-by: Adrian Lyjak <adrianlyjak@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Improve docstrings throughout extract-basic workflow to be more
domain-expert friendly, using product terms instead of programming
jargon. Also document resource function naming behavior in AGENTS.md.
Co-authored-by: Claude <noreply@anthropic.com>
* fix: pin @llamaindex/ui to ~3.6.1 to avoid breaking changes in minors
Changed from ^x.y.z (caret) to ~3.6.1 (tilde) versioning for
@llamaindex/ui dependency across all template UI packages to prevent
breaking changes from minor version bumps.
* chore: bump template versions for @llamaindex/ui update
Incremented patch versions for all templates with updated UI dependency:
- basic-ui: 0.2.4 → 0.2.5
- classify-extract-sec: 0.2.6 → 0.2.7
- data-extraction: 0.3.7 → 0.3.8
- document-qa: 0.2.6 → 0.2.7
- extract-basic: 0.1.6 → 0.1.7
- extract-reconcile-invoice: 0.3.2 → 0.3.3
- showcase: 0.3.1 → 0.3.2
* fix: revert document-qa and basic-ui to @llamaindex/ui ^2.1.1
These templates still use v2 of the UI package, so keeping them on their
original caret range and reverting their version bumps.
---------
Co-authored-by: Claude <noreply@anthropic.com>
* fix: handle files.get when ID is uuidv4 in mock utilities
* chore: tweaks to test and prompt
* fix: fix problem with nested objects
* chore: use jsonref!
* chore: remove mention to uuid4
* chore: resort to preloading files to get their ID instead of uuid
* chore: warn explicitly about test being skipped
* wip: offload ui tests running to a subagent
* chore: clarification comment
* chore: automated ui tests with mocks
* feat: background test runner
* chore: prepare experiment for bg test runner
* fix: use threading for bg test runner, update test template
* ci: ruff format and check
* fix: import uuid in test template + try fixing race conditions in file watcher
* ci: format
* feat: experiment
* fix: threading approach to log collection; chore: prepare experiment
* chore: migrate to watchfiles and asyncio tasks
* chore: clean experiment and prepare to run again
* feat: experiment result; fix: fix test results hook to read from the correct file
* fix: ui test while loop breaking
* chore: reset experiment ground
* fix: use sys.executable to run tests
* fix: bug hunting
* ci: format
* fix: try adding a debugging layer
* yay it worked 🎉
* chore: refactor to be async, make filewatcher a singleton shared across modules (hopefully)
* chore: prepare experiment
* chore: try make tests complete
* fix: merge conflicts mess
* chore: prepare for testing
* feat: instrument test runner + perform experiment
* ci: format
* chore: re-instrument _read_logs_stream
* chore: PR comments
* chore: modify extract basic template
* ci: format
* chore: version bump
* docs: mention only stateless extraction
* chore: prepare for first experiment with extract-basic
* chore: experiment 1 + cleanup as per PR comments
* ci: format and lint
* Tweaks to code and docs to encourage better coding agent behavior
---------
Co-authored-by: Adrian Lyjak <adrianlyjak@gmail.com>