Skip to content

Commit d688d85

Browse files
committed
Adds custom InferenceEndpointInfo classes (#4444)
* Adds custom InferenceEndpointInfo classes * Code style fix * Code style fix (cherry picked from commit 6baef2f) # Conflicts: # specification/inference/put_amazonbedrock/PutAmazonBedrockResponse.ts # specification/inference/put_anthropic/PutAnthropicResponse.ts # specification/inference/put_azureaistudio/PutAzureAiStudioResponse.ts # specification/inference/put_azureopenai/PutAzureOpenAiResponse.ts # specification/inference/put_cohere/PutCohereResponse.ts # specification/inference/put_elasticsearch/PutElasticsearchResponse.ts # specification/inference/put_elser/PutElserResponse.ts # specification/inference/put_googleaistudio/PutGoogleAiStudioResponse.ts # specification/inference/put_googlevertexai/PutGoogleVertexAiResponse.ts # specification/inference/put_hugging_face/PutHuggingFaceResponse.ts # specification/inference/put_mistral/PutMistralResponse.ts # specification/inference/put_openai/PutOpenAiResponse.ts # specification/inference/put_watsonx/PutWatsonxResponse.ts
1 parent a0dca1b commit d688d85

File tree

16 files changed

+272
-28
lines changed

16 files changed

+272
-28
lines changed

specification/inference/_types/Services.ts

Lines changed: 169 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,21 @@ import { UserDefinedValue } from '@spec_utils/UserDefinedValue'
2222
import {
2323
TaskType,
2424
TaskTypeAlibabaCloudAI,
25-
TaskTypeJinaAi
25+
TaskTypeAmazonBedrock,
26+
TaskTypeAnthropic,
27+
TaskTypeAzureAIStudio,
28+
TaskTypeAzureOpenAI,
29+
TaskTypeCohere,
30+
TaskTypeElasticsearch,
31+
TaskTypeELSER,
32+
TaskTypeGoogleAIStudio,
33+
TaskTypeGoogleVertexAI,
34+
TaskTypeHuggingFace,
35+
TaskTypeJinaAi,
36+
TaskTypeMistral,
37+
TaskTypeOpenAI,
38+
TaskTypeVoyageAI,
39+
TaskTypeWatsonx
2640
} from '../_types/TaskType'
2741

2842
/**
@@ -83,6 +97,160 @@ export class InferenceEndpointInfoAlibabaCloudAI extends InferenceEndpoint {
8397
task_type: TaskTypeAlibabaCloudAI
8498
}
8599

100+
export class InferenceEndpointInfoAmazonBedrock extends InferenceEndpoint {
101+
/**
102+
* The inference Id
103+
*/
104+
inference_id: string
105+
/**
106+
* The task type
107+
*/
108+
task_type: TaskTypeAmazonBedrock
109+
}
110+
111+
export class InferenceEndpointInfoAnthropic extends InferenceEndpoint {
112+
/**
113+
* The inference Id
114+
*/
115+
inference_id: string
116+
/**
117+
* The task type
118+
*/
119+
task_type: TaskTypeAnthropic
120+
}
121+
122+
export class InferenceEndpointInfoAzureAIStudio extends InferenceEndpoint {
123+
/**
124+
* The inference Id
125+
*/
126+
inference_id: string
127+
/**
128+
* The task type
129+
*/
130+
task_type: TaskTypeAzureAIStudio
131+
}
132+
133+
export class InferenceEndpointInfoAzureOpenAI extends InferenceEndpoint {
134+
/**
135+
* The inference Id
136+
*/
137+
inference_id: string
138+
/**
139+
* The task type
140+
*/
141+
task_type: TaskTypeAzureOpenAI
142+
}
143+
144+
export class InferenceEndpointInfoCohere extends InferenceEndpoint {
145+
/**
146+
* The inference Id
147+
*/
148+
inference_id: string
149+
/**
150+
* The task type
151+
*/
152+
task_type: TaskTypeCohere
153+
}
154+
155+
export class InferenceEndpointInfoElasticsearch extends InferenceEndpoint {
156+
/**
157+
* The inference Id
158+
*/
159+
inference_id: string
160+
/**
161+
* The task type
162+
*/
163+
task_type: TaskTypeElasticsearch
164+
}
165+
166+
export class InferenceEndpointInfoELSER extends InferenceEndpoint {
167+
/**
168+
* The inference Id
169+
*/
170+
inference_id: string
171+
/**
172+
* The task type
173+
*/
174+
task_type: TaskTypeELSER
175+
}
176+
177+
export class InferenceEndpointInfoGoogleAIStudio extends InferenceEndpoint {
178+
/**
179+
* The inference Id
180+
*/
181+
inference_id: string
182+
/**
183+
* The task type
184+
*/
185+
task_type: TaskTypeGoogleAIStudio
186+
}
187+
188+
export class InferenceEndpointInfoGoogleVertexAI extends InferenceEndpoint {
189+
/**
190+
* The inference Id
191+
*/
192+
inference_id: string
193+
/**
194+
* The task type
195+
*/
196+
task_type: TaskTypeGoogleVertexAI
197+
}
198+
199+
export class InferenceEndpointInfoHuggingFace extends InferenceEndpoint {
200+
/**
201+
* The inference Id
202+
*/
203+
inference_id: string
204+
/**
205+
* The task type
206+
*/
207+
task_type: TaskTypeHuggingFace
208+
}
209+
210+
export class InferenceEndpointInfoMistral extends InferenceEndpoint {
211+
/**
212+
* The inference Id
213+
*/
214+
inference_id: string
215+
/**
216+
* The task type
217+
*/
218+
task_type: TaskTypeMistral
219+
}
220+
221+
export class InferenceEndpointInfoOpenAI extends InferenceEndpoint {
222+
/**
223+
* The inference Id
224+
*/
225+
inference_id: string
226+
/**
227+
* The task type
228+
*/
229+
task_type: TaskTypeOpenAI
230+
}
231+
232+
export class InferenceEndpointInfoVoyageAI extends InferenceEndpoint {
233+
/**
234+
* The inference Id
235+
*/
236+
inference_id: string
237+
/**
238+
* The task type
239+
*/
240+
task_type: TaskTypeVoyageAI
241+
}
242+
243+
export class InferenceEndpointInfoWatsonx extends InferenceEndpoint {
244+
/**
245+
* The inference Id
246+
*/
247+
inference_id: string
248+
/**
249+
* The task type
250+
*/
251+
task_type: TaskTypeWatsonx
252+
}
253+
86254
/**
87255
* Chunking configuration object
88256
*/

specification/inference/_types/TaskType.ts

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,71 @@ export enum TaskTypeAlibabaCloudAI {
3939
completion,
4040
sparse_embedding
4141
}
42+
43+
export enum TaskTypeAmazonBedrock {
44+
text_embedding,
45+
completion
46+
}
47+
48+
export enum TaskTypeAnthropic {
49+
completion
50+
}
51+
52+
export enum TaskTypeAzureAIStudio {
53+
text_embedding,
54+
completion
55+
}
56+
57+
export enum TaskTypeAzureOpenAI {
58+
text_embedding,
59+
completion
60+
}
61+
62+
export enum TaskTypeCohere {
63+
text_embedding,
64+
rerank,
65+
completion
66+
}
67+
68+
export enum TaskTypeElasticsearch {
69+
sparse_embedding,
70+
text_embedding,
71+
rerank
72+
}
73+
74+
export enum TaskTypeELSER {
75+
sparse_embedding
76+
}
77+
78+
export enum TaskTypeGoogleAIStudio {
79+
text_embedding,
80+
completion
81+
}
82+
83+
export enum TaskTypeGoogleVertexAI {
84+
text_embedding,
85+
rerank
86+
}
87+
88+
export enum TaskTypeHuggingFace {
89+
text_embedding
90+
}
91+
92+
export enum TaskTypeMistral {
93+
text_embedding
94+
}
95+
96+
export enum TaskTypeOpenAI {
97+
text_embedding,
98+
chat_completion,
99+
completion
100+
}
101+
102+
export enum TaskTypeVoyageAI {
103+
text_embedding,
104+
rerank
105+
}
106+
107+
export enum TaskTypeWatsonx {
108+
text_embedding
109+
}

specification/inference/put_amazonbedrock/PutAmazonBedrockResponse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
* under the License.
1818
*/
1919

20-
import { InferenceEndpointInfo } from '@inference/_types/Services'
20+
import { InferenceEndpointInfoAmazonBedrock } from '@inference/_types/Services'
2121

2222
export class Response {
23-
body: InferenceEndpointInfo
23+
body: InferenceEndpointInfoAmazonBedrock
2424
}

specification/inference/put_anthropic/PutAnthropicResponse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
* under the License.
1818
*/
1919

20-
import { InferenceEndpointInfo } from '@inference/_types/Services'
20+
import { InferenceEndpointInfoAnthropic } from '@inference/_types/Services'
2121

2222
export class Response {
23-
body: InferenceEndpointInfo
23+
body: InferenceEndpointInfoAnthropic
2424
}

specification/inference/put_azureaistudio/PutAzureAiStudioResponse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
* under the License.
1818
*/
1919

20-
import { InferenceEndpointInfo } from '@inference/_types/Services'
20+
import { InferenceEndpointInfoAzureAIStudio } from '@inference/_types/Services'
2121

2222
export class Response {
23-
body: InferenceEndpointInfo
23+
body: InferenceEndpointInfoAzureAIStudio
2424
}

specification/inference/put_azureopenai/PutAzureOpenAiResponse.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,16 @@
1717
* under the License.
1818
*/
1919

20-
import { InferenceEndpointInfo } from '@inference/_types/Services'
20+
import { InferenceEndpointInfoAzureOpenAI } from '@inference/_types/Services'
2121

2222
export class Response {
23+
<<<<<<< HEAD
2324
body: InferenceEndpointInfo
25+
||||||| parent of 6baef2fa4 (Adds custom InferenceEndpointInfo classes (#4444))
26+
/** @codegen_name endpoint_info */
27+
body: InferenceEndpointInfo
28+
=======
29+
/** @codegen_name endpoint_info */
30+
body: InferenceEndpointInfoAzureOpenAI
31+
>>>>>>> 6baef2fa4 (Adds custom InferenceEndpointInfo classes (#4444))
2432
}

specification/inference/put_cohere/PutCohereResponse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
* under the License.
1818
*/
1919

20-
import { InferenceEndpointInfo } from '@inference/_types/Services'
20+
import { InferenceEndpointInfoCohere } from '@inference/_types/Services'
2121

2222
export class Response {
23-
body: InferenceEndpointInfo
23+
body: InferenceEndpointInfoCohere
2424
}

specification/inference/put_elasticsearch/PutElasticsearchResponse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
* under the License.
1818
*/
1919

20-
import { InferenceEndpointInfo } from '@inference/_types/Services'
20+
import { InferenceEndpointInfoElasticsearch } from '@inference/_types/Services'
2121

2222
export class Response {
23-
body: InferenceEndpointInfo
23+
body: InferenceEndpointInfoElasticsearch
2424
}

specification/inference/put_elser/PutElserResponse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
* under the License.
1818
*/
1919

20-
import { InferenceEndpointInfo } from '@inference/_types/Services'
20+
import { InferenceEndpointInfoELSER } from '@inference/_types/Services'
2121

2222
export class Response {
23-
body: InferenceEndpointInfo
23+
body: InferenceEndpointInfoELSER
2424
}

specification/inference/put_googleaistudio/PutGoogleAiStudioResponse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
* under the License.
1818
*/
1919

20-
import { InferenceEndpointInfo } from '@inference/_types/Services'
20+
import { InferenceEndpointInfoGoogleAIStudio } from '@inference/_types/Services'
2121

2222
export class Response {
23-
body: InferenceEndpointInfo
23+
body: InferenceEndpointInfoGoogleAIStudio
2424
}

0 commit comments

Comments
 (0)