Skip to content

Commit 15fef28

Browse files
committed
[Inference API] Adds chunking_settings to PUT inference API.
1 parent 5263910 commit 15fef28

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

specification/inference/_types/Services.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'
2121
import { TaskType } from '../_types/TaskType'
22+
import { integer } from '@_types/Numeric'
2223

2324
/**
2425
* Configuration options when storing the inference endpoint
@@ -52,6 +53,37 @@ export class InferenceEndpointInfo extends InferenceEndpoint {
5253
task_type: TaskType
5354
}
5455

56+
/**
57+
* Chunking configuration object
58+
*/
59+
export class InferenceChunkingSettings extends InferenceEndpoint {
60+
/**
61+
* Specifies the maximum size of a chunk in words
62+
* This value cannot be higher than `300` or lower than `20` (for `sentence` strategy) or `10` (for `word` strategy)
63+
* @server_default 250
64+
*/
65+
max_chunk_size?: integer
66+
/**
67+
* Specifies the number of overlapping words for chunks
68+
* Only for `word` chunking strategy
69+
* This value cannot be higher than the half of `max_chunk_size`
70+
* @server_default 100
71+
*/
72+
overlap?: integer
73+
/**
74+
* Specifies the number of overlapping sentences for chunks
75+
* Only for `sentence` chunking strategy
76+
* It can be either `1` or `0`
77+
* @server_default 1
78+
*/
79+
sentence_overlap?: integer
80+
/**
81+
* Specifies the chunking strategy
82+
* It could be either `sentence` or `word`
83+
*/
84+
strategy?: string
85+
}
86+
5587
export type ServiceSettings = UserDefinedValue
5688

5789
export type TaskSettings = UserDefinedValue

0 commit comments

Comments
 (0)