17
17
* under the License.
18
18
*/
19
19
20
- import { RequestBase } from '@_types/Base '
20
+ import type { Request as RequestChatCompletion } from '../chat_completion_unified/UnifiedRequest '
21
21
import { Id } from '@_types/common'
22
- import { float , long } from '@_types/Numeric'
22
+
23
+
24
+ export type OmittedChatCompletionRequest = Omit < RequestChatCompletion , 'urls' | 'path_parts' > ;
23
25
24
26
/**
25
27
* Performs an inference task through the Elastic Inference Service (EIS).
@@ -31,10 +33,10 @@ import { float, long } from '@_types/Numeric'
31
33
* @cluster_privileges manage_inference
32
34
* @doc_id inference-api-post-eis
33
35
*/
34
- export interface Request extends RequestBase {
36
+ export interface Request extends OmittedChatCompletionRequest {
35
37
urls : [
36
38
{
37
- path : '/_inference/{task_type}/{eis_inference_id}'
39
+ path : '/_inference/{task_type}/{eis_inference_id}/_stream '
38
40
methods : [ 'POST' ]
39
41
}
40
42
]
@@ -48,67 +50,9 @@ export interface Request extends RequestBase {
48
50
*/
49
51
eis_inference_id : Id
50
52
}
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
- }
77
53
}
78
54
79
55
export enum EisTaskType {
80
56
chat_completion
81
57
}
82
58
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