Skip to content

Commit e21cfdb

Browse files
committed
inference refactor
1 parent 0dd71e2 commit e21cfdb

File tree

52 files changed

+5885
-5273
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+5885
-5273
lines changed

output/openapi/elasticsearch-openapi.json

Lines changed: 370 additions & 140 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/openapi/elasticsearch-serverless-openapi.json

Lines changed: 370 additions & 140 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/schema-serverless.json

Lines changed: 698 additions & 659 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/schema.json

Lines changed: 2811 additions & 2770 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/typescript/types.ts

Lines changed: 373 additions & 371 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/inference/_types/CommonTypes.ts

Lines changed: 1115 additions & 6 deletions
Large diffs are not rendered by default.

specification/inference/chat_completion_unified/UnifiedRequest.ts

Lines changed: 4 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,17 @@
1818
*/
1919

2020
import { RequestChatCompletionBase } from '@inference/_types/CommonTypes'
21-
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'
21+
import { RequestBase } from '@_types/Base'
2222
import { Id } from '@_types/common'
2323
import { Duration } from '@_types/Time'
24-
2524
/**
2625
* Perform chat completion inference
2726
* @rest_spec_name inference.chat_completion_unified
2827
* @availability stack since=8.18.0 stability=stable visibility=public
2928
* @availability serverless stability=stable visibility=public
3029
* @doc_id inference-api-chat-completion
3130
*/
32-
export interface Request extends RequestChatCompletionBase {
31+
export interface Request extends RequestBase {
3332
urls: [
3433
{
3534
path: '/_inference/chat_completion/{inference_id}/_stream'
@@ -49,144 +48,6 @@ export interface Request extends RequestChatCompletionBase {
4948
*/
5049
timeout?: Duration
5150
}
52-
}
53-
54-
/**
55-
* @codegen_names string, object
56-
*/
57-
export type CompletionToolType = string | CompletionToolChoice
58-
59-
/**
60-
* An object style representation of a single portion of a conversation.
61-
*/
62-
export interface ContentObject {
63-
/**
64-
* The text content.
65-
*/
66-
text: string
67-
/**
68-
* The type of content.
69-
*/
70-
type: string
71-
}
72-
73-
/**
74-
* The function that the model called.
75-
*/
76-
export interface ToolCallFunction {
77-
/**
78-
* The arguments to call the function with in JSON format.
79-
*/
80-
arguments: string
81-
/**
82-
* The name of the function to call.
83-
*/
84-
name: string
85-
}
86-
87-
/**
88-
* A tool call generated by the model.
89-
*/
90-
export interface ToolCall {
91-
/**
92-
* The identifier of the tool call.
93-
*/
94-
id: Id
95-
/**
96-
* The function that the model called.
97-
*/
98-
function: ToolCallFunction
99-
/**
100-
* The type of the tool call.
101-
*/
102-
type: string
103-
}
104-
105-
/**
106-
* @codegen_names string, object
107-
*/
108-
export type MessageContent = string | Array<ContentObject>
109-
110-
/**
111-
* An object representing part of the conversation.
112-
*/
113-
export interface Message {
114-
/**
115-
* The content of the message.
116-
*/
117-
content?: MessageContent
118-
/**
119-
* The role of the message author.
120-
*/
121-
role: string
122-
/**
123-
* The tool call that this message is responding to.
124-
*/
125-
tool_call_id?: Id
126-
/**
127-
* The tool calls generated by the model.
128-
*/
129-
tool_calls?: Array<ToolCall>
130-
}
131-
132-
/**
133-
* The tool choice function.
134-
*
135-
*/
136-
export interface CompletionToolChoiceFunction {
137-
/**
138-
* The name of the function to call.
139-
*/
140-
name: string
141-
}
142-
143-
/**
144-
* Controls which tool is called by the model.
145-
*/
146-
export interface CompletionToolChoice {
147-
/**
148-
* The type of the tool.
149-
*/
150-
type: string
151-
/**
152-
* The tool choice function.
153-
*/
154-
function: CompletionToolChoiceFunction
155-
}
156-
157-
/**
158-
* The completion tool function definition.
159-
*/
160-
export interface CompletionToolFunction {
161-
/**
162-
* A description of what the function does.
163-
* This is used by the model to choose when and how to call the function.
164-
*/
165-
description?: string
166-
/**
167-
* The name of the function.
168-
*/
169-
name: string
170-
/**
171-
* The parameters the functional accepts. This should be formatted as a JSON object.
172-
*/
173-
parameters?: UserDefinedValue
174-
/**
175-
* Whether to enable schema adherence when generating the function call.
176-
*/
177-
strict?: boolean
178-
}
179-
180-
/**
181-
* A list of tools that the model can call.
182-
*/
183-
export interface CompletionTool {
184-
/**
185-
* The type of tool.
186-
*/
187-
type: string
188-
/**
189-
* The function definition.
190-
*/
191-
function: CompletionToolFunction
51+
/** @codegen_name chat_completion_request */
52+
body: RequestChatCompletionBase
19253
}

specification/inference/chat_completion_unified/UnifiedResponse.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@
2020
import { StreamResult } from '@_types/Binary'
2121

2222
export class Response {
23+
/** @codegen_name data */
2324
body: StreamResult
2425
}

specification/inference/completion/CompletionResponse.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@
2020
import { CompletionInferenceResult } from '@inference/_types/Results'
2121

2222
export class Response {
23+
/** @codegen_name completion_result */
2324
body: CompletionInferenceResult
2425
}

specification/inference/delete/DeleteResponse.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@
2020
import { DeleteInferenceEndpointResult } from '@inference/_types/Results'
2121

2222
export class Response {
23+
/** @codegen_name delete_result */
2324
body: DeleteInferenceEndpointResult
2425
}

0 commit comments

Comments
 (0)