Skip to content

Commit 8b02e55

Browse files
committed
Adds custom InferenceEndpointInfo classes
1 parent 1302eb5 commit 8b02e55

File tree

17 files changed

+265
-32
lines changed

17 files changed

+265
-32
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 { integer } from '@_types/Numeric'
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/chat_completion_unified/UnifiedRequest.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ import { Duration } from '@_types/Time'
2626
*
2727
* The chat completion inference API enables real-time responses for chat completion tasks by delivering answers incrementally, reducing response times during computation.
2828
* It only works with the `chat_completion` task type for `openai` and `elastic` inference services.
29-
30-
* IMPORTANT: The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Azure, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, or Hugging Face.
31-
* For built-in models and models uploaded through Eland, the inference APIs offer an alternative way to use and manage trained models. However, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the machine learning trained model APIs.
3229
*
3330
* NOTE: The `chat_completion` task type is only available within the _stream API and only supports streaming.
3431
* The Chat completion inference API and the Stream inference API differ in their response structure and capabilities.

specification/inference/put_amazonbedrock/PutAmazonBedrockResponse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
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 {
2323
/** @codegen_name endpoint_info */
24-
body: InferenceEndpointInfo
24+
body: InferenceEndpointInfoAmazonBedrock
2525
}

specification/inference/put_anthropic/PutAnthropicResponse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
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 {
2323
/** @codegen_name endpoint_info */
24-
body: InferenceEndpointInfo
24+
body: InferenceEndpointInfoAnthropic
2525
}

specification/inference/put_azureaistudio/PutAzureAiStudioResponse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
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 {
2323
/** @codegen_name endpoint_info */
24-
body: InferenceEndpointInfo
24+
body: InferenceEndpointInfoAzureAIStudio
2525
}

specification/inference/put_azureopenai/PutAzureOpenAiResponse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
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 {
2323
/** @codegen_name endpoint_info */
24-
body: InferenceEndpointInfo
24+
body: InferenceEndpointInfoAzureOpenAI
2525
}

specification/inference/put_cohere/PutCohereResponse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
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 {
2323
/** @codegen_name endpoint_info */
24-
body: InferenceEndpointInfo
24+
body: InferenceEndpointInfoCohere
2525
}

specification/inference/put_elasticsearch/PutElasticsearchResponse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
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 {
2323
/** @codegen_name endpoint_info */
24-
body: InferenceEndpointInfo
24+
body: InferenceEndpointInfoElasticsearch
2525
}

specification/inference/put_elser/PutElserResponse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
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 {
2323
/** @codegen_name endpoint_info */
24-
body: InferenceEndpointInfo
24+
body: InferenceEndpointInfoELSER
2525
}

specification/inference/put_googleaistudio/PutGoogleAiStudioResponse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
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 {
2323
/** @codegen_name endpoint_info */
24-
body: InferenceEndpointInfo
24+
body: InferenceEndpointInfoGoogleAIStudio
2525
}

specification/inference/put_googlevertexai/PutGoogleVertexAiResponse.ts

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

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

2222
export class Response {
2323
/** @codegen_name endpoint_info */
24-
body: InferenceEndpointInfo
24+
body: InferenceEndpointInfoGoogleVertexAI
2525
}

specification/inference/put_hugging_face/PutHuggingFaceResponse.ts

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

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

2222
export class Response {
2323
/** @codegen_name endpoint_info */
24-
body: InferenceEndpointInfo
24+
body: InferenceEndpointInfoHuggingFace
2525
}

specification/inference/put_mistral/PutMistralResponse.ts

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

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

2222
export class Response {
2323
/** @codegen_name endpoint_info */
24-
body: InferenceEndpointInfo
24+
body: InferenceEndpointInfoMistral
2525
}

0 commit comments

Comments
 (0)