Skip to content

Commit 120db95

Browse files
author
stlc-bot
committed
feat(extract): reject parse_tier for parse-free tiers + pin turbo fallback to fast (#22919)
Stainless-Generated-From: 24c77712f103352985dd73efc0372b4546d58ef6
1 parent f16916f commit 120db95

2 files changed

Lines changed: 32 additions & 8 deletions

File tree

‎llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/configurations/ExtractV2Parameters.kt‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,19 @@ private constructor(
139139
fun maxPages(): Optional<Long> = maxPages.getOptional("max_pages")
140140

141141
/**
142-
* Saved parse configuration ID to control how the document is parsed before extraction
142+
* Saved parse configuration ID to control how the document is parsed before extraction. Turbo
143+
* extract does not support parse configuration or produce a parse output; use another tier if
144+
* your workflow requires parsed text.
143145
*
144146
* @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if the
145147
* server responded with an unexpected value).
146148
*/
147149
fun parseConfigId(): Optional<String> = parseConfigId.getOptional("parse_config_id")
148150

149151
/**
150-
* Parse tier to use before extraction. Defaults to the extract tier if not specified.
152+
* Parse tier to use before extraction. Defaults to the extract tier if not specified. Turbo
153+
* extract does not support parse configuration or produce a parse output; use another tier if
154+
* your workflow requires parsed text.
151155
*
152156
* @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if the
153157
* server responded with an unexpected value).
@@ -437,7 +441,11 @@ private constructor(
437441
*/
438442
fun maxPages(maxPages: JsonField<Long>) = apply { this.maxPages = maxPages }
439443

440-
/** Saved parse configuration ID to control how the document is parsed before extraction */
444+
/**
445+
* Saved parse configuration ID to control how the document is parsed before extraction.
446+
* Turbo extract does not support parse configuration or produce a parse output; use another
447+
* tier if your workflow requires parsed text.
448+
*/
441449
fun parseConfigId(parseConfigId: String?) =
442450
parseConfigId(JsonField.ofNullable(parseConfigId))
443451

@@ -456,7 +464,11 @@ private constructor(
456464
this.parseConfigId = parseConfigId
457465
}
458466

459-
/** Parse tier to use before extraction. Defaults to the extract tier if not specified. */
467+
/**
468+
* Parse tier to use before extraction. Defaults to the extract tier if not specified. Turbo
469+
* extract does not support parse configuration or produce a parse output; use another tier
470+
* if your workflow requires parsed text.
471+
*/
460472
fun parseTier(parseTier: String?) = parseTier(JsonField.ofNullable(parseTier))
461473

462474
/** Alias for calling [Builder.parseTier] with `parseTier.orElse(null)`. */

‎llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractConfiguration.kt‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,19 @@ private constructor(
123123
fun maxPages(): Optional<Long> = maxPages.getOptional("max_pages")
124124

125125
/**
126-
* Saved parse configuration ID to control how the document is parsed before extraction
126+
* Saved parse configuration ID to control how the document is parsed before extraction. Turbo
127+
* extract does not support parse configuration or produce a parse output; use another tier if
128+
* your workflow requires parsed text.
127129
*
128130
* @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if the
129131
* server responded with an unexpected value).
130132
*/
131133
fun parseConfigId(): Optional<String> = parseConfigId.getOptional("parse_config_id")
132134

133135
/**
134-
* Parse tier to use before extraction. Defaults to the extract tier if not specified.
136+
* Parse tier to use before extraction. Defaults to the extract tier if not specified. Turbo
137+
* extract does not support parse configuration or produce a parse output; use another tier if
138+
* your workflow requires parsed text.
135139
*
136140
* @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if the
137141
* server responded with an unexpected value).
@@ -405,7 +409,11 @@ private constructor(
405409
*/
406410
fun maxPages(maxPages: JsonField<Long>) = apply { this.maxPages = maxPages }
407411

408-
/** Saved parse configuration ID to control how the document is parsed before extraction */
412+
/**
413+
* Saved parse configuration ID to control how the document is parsed before extraction.
414+
* Turbo extract does not support parse configuration or produce a parse output; use another
415+
* tier if your workflow requires parsed text.
416+
*/
409417
fun parseConfigId(parseConfigId: String?) =
410418
parseConfigId(JsonField.ofNullable(parseConfigId))
411419

@@ -424,7 +432,11 @@ private constructor(
424432
this.parseConfigId = parseConfigId
425433
}
426434

427-
/** Parse tier to use before extraction. Defaults to the extract tier if not specified. */
435+
/**
436+
* Parse tier to use before extraction. Defaults to the extract tier if not specified. Turbo
437+
* extract does not support parse configuration or produce a parse output; use another tier
438+
* if your workflow requires parsed text.
439+
*/
428440
fun parseTier(parseTier: String?) = parseTier(JsonField.ofNullable(parseTier))
429441

430442
/** Alias for calling [Builder.parseTier] with `parseTier.orElse(null)`. */

0 commit comments

Comments
 (0)