Commit Graph

9 Commits

Author SHA1 Message Date
Adrian Lyjak 730d00183a extract-basic: migrate to llama-cloud v2 SDK (#249)
* 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.
2026-04-15 11:12:11 -04:00
Adrian Lyjak 8d1bbb50ff Split agents.md up more (#215)
* improving ergonomics

* Split up instructions and adjust discriminator
2026-02-04 15:45:49 -05:00
Adrian Lyjak 39c533fef3 Add discriminator pattern support for multi-schema extraction workflows (#208) 2026-02-02 22:54:06 -05:00
Adrian Lyjak ef3e3ad632 Handle union types in JSON schema value generation (#202)
* 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>
2026-01-27 20:49:20 -05:00
Adrian Lyjak 428152d82f feat: extend mock server with files list, split index, and sheets APIs (#197) 2026-01-27 13:06:19 -05:00
Clelia (Astra) Bertelli 6f4e661fb4 chore: add split to mock server (#199) 2026-01-27 14:17:04 +01:00
Adrian Lyjak 2107116dc5 Make workflow representation export programmatic via ResourceConfig (#187) 2026-01-25 09:56:26 -05:00
Clelia (Astra) Bertelli adda5d6b32 feat: template with new sdk (#178)
* 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>
2026-01-23 16:12:00 +01:00
Adrian Lyjak cfb4963e23 fix parse mock, and test the fake server (#171) 2026-01-14 16:59:51 -05:00