Skip to content

Commit 6a3a23e

Browse files
move AdaptiveAllocations to common types to avoid duplicates (#4143) (#4144)
(cherry picked from commit 055139d) Co-authored-by: Laurent Saint-Félix <[email protected]>
1 parent 7df8792 commit 6a3a23e

File tree

3 files changed

+22
-39
lines changed

3 files changed

+22
-39
lines changed

specification/inference/_types/CommonTypes.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
Message
2424
} from '@inference/chat_completion_unified/UnifiedRequest'
2525
import { RequestBase } from '@_types/Base'
26-
import { float, long } from '@_types/Numeric'
26+
import { float, integer, long } from '@_types/Numeric'
2727

2828
export interface RequestChatCompletionBase extends RequestBase {
2929
/**
@@ -59,3 +59,22 @@ export interface RequestChatCompletionBase extends RequestBase {
5959
*/
6060
top_p?: float
6161
}
62+
63+
export class AdaptiveAllocations {
64+
/**
65+
* Turn on `adaptive_allocations`.
66+
* @server_default false
67+
*/
68+
enabled?: boolean
69+
/**
70+
* The maximum number of allocations to scale to.
71+
* If set, it must be greater than or equal to `min_number_of_allocations`.
72+
*/
73+
max_number_of_allocations?: integer
74+
/**
75+
* The minimum number of allocations to scale to.
76+
* If set, it must be greater than or equal to 0.
77+
* If not defined, the deployment scales to 0.
78+
*/
79+
min_number_of_allocations?: integer
80+
}

specification/inference/put_elasticsearch/PutElasticsearchRequest.ts

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* under the License.
1818
*/
1919

20+
import { AdaptiveAllocations } from '@inference/_types/CommonTypes'
2021
import { InferenceChunkingSettings } from '@inference/_types/Services'
2122
import { RequestBase } from '@_types/Base'
2223
import { Id } from '@_types/common'
@@ -95,25 +96,6 @@ export enum ServiceType {
9596
elasticsearch
9697
}
9798

98-
export class AdaptiveAllocations {
99-
/**
100-
* Turn on `adaptive_allocations`.
101-
* @server_default false
102-
*/
103-
enabled?: boolean
104-
/**
105-
* The maximum number of allocations to scale to.
106-
* If set, it must be greater than or equal to `min_number_of_allocations`.
107-
*/
108-
max_number_of_allocations?: integer
109-
/**
110-
* The minimum number of allocations to scale to.
111-
* If set, it must be greater than or equal to 0.
112-
* If not defined, the deployment scales to 0.
113-
*/
114-
min_number_of_allocations?: integer
115-
}
116-
11799
export class ElasticsearchServiceSettings {
118100
/**
119101
* Adaptive allocations configuration details.

specification/inference/put_elser/PutElserRequest.ts

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* under the License.
1818
*/
1919

20+
import { AdaptiveAllocations } from '@inference/_types/CommonTypes'
2021
import { InferenceChunkingSettings } from '@inference/_types/Services'
2122
import { RequestBase } from '@_types/Base'
2223
import { Id } from '@_types/common'
@@ -89,25 +90,6 @@ export enum ServiceType {
8990
elser
9091
}
9192

92-
export class AdaptiveAllocations {
93-
/**
94-
* Turn on `adaptive_allocations`.
95-
* @server_default false
96-
*/
97-
enabled?: boolean
98-
/**
99-
* The maximum number of allocations to scale to.
100-
* If set, it must be greater than or equal to `min_number_of_allocations`.
101-
*/
102-
max_number_of_allocations?: integer
103-
/**
104-
* The minimum number of allocations to scale to.
105-
* If set, it must be greater than or equal to 0.
106-
* If not defined, the deployment scales to 0.
107-
*/
108-
min_number_of_allocations?: integer
109-
}
110-
11193
export class ElserServiceSettings {
11294
/**
11395
* Adaptive allocations configuration details.

0 commit comments

Comments
 (0)