Skip to content

Commit 6131021

Browse files
committed
feat(ts-sdk): release v0.0.94
1 parent 712b42c commit 6131021

3 files changed

Lines changed: 126 additions & 1 deletion

File tree

clients/ts-sdk/openapi.json

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10372,6 +10372,14 @@
1037210372
],
1037310373
"nullable": true
1037410374
},
10375+
"error_handling": {
10376+
"allOf": [
10377+
{
10378+
"$ref": "#/components/schemas/ErrorHandlingStrategy"
10379+
}
10380+
],
10381+
"nullable": true
10382+
},
1037510383
"expires_in": {
1037610384
"type": "integer",
1037710385
"format": "int32",
@@ -10384,6 +10392,14 @@
1038410392
"default": false,
1038510393
"nullable": true
1038610394
},
10395+
"llm_processing": {
10396+
"allOf": [
10397+
{
10398+
"$ref": "#/components/schemas/LlmProcessing"
10399+
}
10400+
],
10401+
"nullable": true
10402+
},
1038710403
"ocr_strategy": {
1038810404
"allOf": [
1038910405
{
@@ -11620,6 +11636,14 @@
1162011636
"Content"
1162111637
]
1162211638
},
11639+
"ErrorHandlingStrategy": {
11640+
"type": "string",
11641+
"description": "Controls how errors are handled during processing:\n- `Fail`: Stops processing and fails the task when any error occurs\n- `Continue`: Attempts to continue processing despite non-critical errors (eg. LLM refusals etc.)",
11642+
"enum": [
11643+
"Fail",
11644+
"Continue"
11645+
]
11646+
},
1162311647
"ErrorResponseBody": {
1162411648
"type": "object",
1162511649
"required": [
@@ -12495,6 +12519,37 @@
1249512519
}
1249612520
}
1249712521
},
12522+
"FallbackStrategy": {
12523+
"oneOf": [
12524+
{
12525+
"type": "string",
12526+
"description": "No fallback will be used",
12527+
"enum": [
12528+
"None"
12529+
]
12530+
},
12531+
{
12532+
"type": "string",
12533+
"description": "Use the system default fallback model",
12534+
"enum": [
12535+
"Default"
12536+
]
12537+
},
12538+
{
12539+
"type": "object",
12540+
"required": [
12541+
"Model"
12542+
],
12543+
"properties": {
12544+
"Model": {
12545+
"type": "string",
12546+
"description": "Use a specific model as fallback"
12547+
}
12548+
}
12549+
}
12550+
],
12551+
"description": "Specifies the fallback strategy for LLM processing\n\nThis can be:\n1. None - No fallback will be used\n2. Default - The system default fallback model will be used\n3. Model - A specific model ID will be used as fallback (check the documentation for the models.)"
12552+
},
1249812553
"FieldCondition": {
1249912554
"type": "object",
1250012555
"description": "FieldCondition is a JSON object which can be used to filter chunks by a field. This is useful for when you want to filter chunks by arbitrary metadata. To access fields inside of the metadata that you provide with the card, prefix the field name with `metadata.`.",
@@ -14124,6 +14179,32 @@
1412414179
}
1412514180
}
1412614181
},
14182+
"LlmProcessing": {
14183+
"type": "object",
14184+
"description": "Controls the LLM used for the task.",
14185+
"properties": {
14186+
"fallback_strategy": {
14187+
"$ref": "#/components/schemas/FallbackStrategy"
14188+
},
14189+
"max_completion_tokens": {
14190+
"type": "integer",
14191+
"format": "int32",
14192+
"description": "The maximum number of tokens to generate.",
14193+
"nullable": true,
14194+
"minimum": 0
14195+
},
14196+
"model_id": {
14197+
"type": "string",
14198+
"description": "The ID of the model to use for the task. If not provided, the default model will be used.\nPlease check the documentation for the model you want to use.",
14199+
"nullable": true
14200+
},
14201+
"temperature": {
14202+
"type": "number",
14203+
"format": "float",
14204+
"description": "The temperature to use for the LLM."
14205+
}
14206+
}
14207+
},
1412714208
"LocationBoundingBox": {
1412814209
"type": "object",
1412914210
"required": [

clients/ts-sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"files": [
1818
"dist"
1919
],
20-
"version": "0.0.93",
20+
"version": "0.0.94",
2121
"license": "MIT",
2222
"scripts": {
2323
"lint": "eslint 'src/**/*.ts'",

clients/ts-sdk/src/types.gen.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,7 @@ export type CreateDatasetReqPayload = {
910910
*/
911911
export type CreateFormWithoutFile = {
912912
chunk_processing?: ((ChunkProcessing) | null);
913+
error_handling?: ((ErrorHandlingStrategy) | null);
913914
/**
914915
* The number of seconds until task is deleted.
915916
* Expried tasks can **not** be updated, polled or accessed via web interface.
@@ -919,6 +920,7 @@ export type CreateFormWithoutFile = {
919920
* Whether to use high-resolution images for cropping and post-processing. (Latency penalty: ~7 seconds per page)
920921
*/
921922
high_resolution?: (boolean) | null;
923+
llm_processing?: ((LlmProcessing) | null);
922924
ocr_strategy?: ((OcrStrategy) | null);
923925
pipeline?: ((PipelineType) | null);
924926
segment_processing?: ((SegmentProcessing) | null);
@@ -1482,6 +1484,13 @@ export type EditMessageReqPayload = {
14821484

14831485
export type EmbedSource = 'HTML' | 'Markdown' | 'LLM' | 'Content';
14841486

1487+
/**
1488+
* Controls how errors are handled during processing:
1489+
* - `Fail`: Stops processing and fails the task when any error occurs
1490+
* - `Continue`: Attempts to continue processing despite non-critical errors (eg. LLM refusals etc.)
1491+
*/
1492+
export type ErrorHandlingStrategy = 'Fail' | 'Continue';
1493+
14851494
export type ErrorResponseBody = {
14861495
message: string;
14871496
};
@@ -1851,6 +1860,21 @@ export type ExtendedOrganizationUsageCount = {
18511860
website_pages_scraped: number;
18521861
};
18531862

1863+
/**
1864+
* Specifies the fallback strategy for LLM processing
1865+
*
1866+
* This can be:
1867+
* 1. None - No fallback will be used
1868+
* 2. Default - The system default fallback model will be used
1869+
* 3. Model - A specific model ID will be used as fallback (check the documentation for the models.)
1870+
*/
1871+
export type FallbackStrategy = 'None' | 'Default' | {
1872+
/**
1873+
* Use a specific model as fallback
1874+
*/
1875+
Model: string;
1876+
};
1877+
18541878
/**
18551879
* FieldCondition is a JSON object which can be used to filter chunks by a field. This is useful for when you want to filter chunks by arbitrary metadata. To access fields inside of the metadata that you provide with the card, prefix the field name with `metadata.`.
18561880
*/
@@ -2485,6 +2509,26 @@ export type LlmGenerationConfig = {
24852509
markdown?: (GenerationStrategy);
24862510
};
24872511

2512+
/**
2513+
* Controls the LLM used for the task.
2514+
*/
2515+
export type LlmProcessing = {
2516+
fallback_strategy?: FallbackStrategy;
2517+
/**
2518+
* The maximum number of tokens to generate.
2519+
*/
2520+
max_completion_tokens?: (number) | null;
2521+
/**
2522+
* The ID of the model to use for the task. If not provided, the default model will be used.
2523+
* Please check the documentation for the model you want to use.
2524+
*/
2525+
model_id?: (string) | null;
2526+
/**
2527+
* The temperature to use for the LLM.
2528+
*/
2529+
temperature?: number;
2530+
};
2531+
24882532
export type LocationBoundingBox = {
24892533
bottom_right: GeoInfo;
24902534
top_left: GeoInfo;

0 commit comments

Comments
 (0)