Skip to content

Commit 7027ec0

Browse files
jonathan-buttnerl-trotta
authored andcommitted
Jonathans suggestion for chat completion eis
1 parent 3a0cc32 commit 7027ec0

File tree

1 file changed

+6
-62
lines changed

1 file changed

+6
-62
lines changed

specification/inference/post_eis/PostEisRequest.ts

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

20-
import { RequestBase } from '@_types/Base'
20+
import type { Request as RequestChatCompletion } from '../chat_completion_unified/UnifiedRequest'
2121
import { Id } from '@_types/common'
22-
import { float, long } from '@_types/Numeric'
22+
23+
24+
export type OmittedChatCompletionRequest = Omit<RequestChatCompletion, 'urls' | 'path_parts'>;
2325

2426
/**
2527
* Performs an inference task through the Elastic Inference Service (EIS).
@@ -31,10 +33,10 @@ import { float, long } from '@_types/Numeric'
3133
* @cluster_privileges manage_inference
3234
* @doc_id inference-api-post-eis
3335
*/
34-
export interface Request extends RequestBase {
36+
export interface Request extends OmittedChatCompletionRequest {
3537
urls: [
3638
{
37-
path: '/_inference/{task_type}/{eis_inference_id}'
39+
path: '/_inference/{task_type}/{eis_inference_id}/_stream'
3840
methods: ['POST']
3941
}
4042
]
@@ -48,67 +50,9 @@ export interface Request extends RequestBase {
4850
*/
4951
eis_inference_id: Id
5052
}
51-
body: {
52-
/**
53-
* A list of objects representing the conversation.
54-
*/
55-
messages: Array<Message>
56-
/**
57-
* The ID of the model to use.
58-
*/
59-
model?: string
60-
/**
61-
* The upper bound limit for the number of tokens that can be generated for a completion request.
62-
*/
63-
max_completion_tokens?: long
64-
/**
65-
* A sequence of strings to control when the model should stop generating additional tokens.
66-
*/
67-
stop?: Array<string>
68-
/**
69-
* The sampling temperature to use.
70-
*/
71-
temperature?: float
72-
/**
73-
* Nucleus sampling, an alternative to sampling with temperature.
74-
*/
75-
top_p?: float
76-
}
7753
}
7854

7955
export enum EisTaskType {
8056
chat_completion
8157
}
8258

83-
/**
84-
* @codegen_names string, object
85-
*/
86-
export type MessageContent = string | Array<ContentObject>
87-
88-
/**
89-
* An object style representation of a single portion of a conversation.
90-
*/
91-
export interface ContentObject {
92-
/**
93-
* The text content.
94-
*/
95-
text: string
96-
/**
97-
* The type of content.
98-
*/
99-
type: string
100-
}
101-
102-
/**
103-
* An object representing part of the conversation.
104-
*/
105-
export interface Message {
106-
/**
107-
* The content of the message.
108-
*/
109-
content?: MessageContent
110-
/**
111-
* The role of the message author.
112-
*/
113-
role: string
114-
}

0 commit comments

Comments
 (0)