flexinference 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +11 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +47 -0
- package/dist/types.d.ts +355 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.1.0
|
|
4
|
+
|
|
5
|
+
Adds the **Interactions** caller format (`client.interactions.create`), the third format
|
|
6
|
+
alongside Responses and chat completions. It works for both OpenAI and Gemini models and
|
|
7
|
+
posts to `/interactions`. `start_within` is required (same rule as the other formats) and
|
|
8
|
+
`service_tier` is a compile-time error (the router owns the tier). New `interactionText(obj)`
|
|
9
|
+
helper pulls the assistant text out of the `steps[]` shape, where `outputText` returns "".
|
|
10
|
+
|
|
11
|
+
## 1.0.1
|
|
12
|
+
|
|
13
|
+
Gemini now supports **image input** and **web search** (send a Responses `web_search`
|
|
14
|
+
tool; the router maps it to Gemini's `google_search`), in addition to text, streaming,
|
|
15
|
+
structured outputs, and function calling. No API or type changes - translation is
|
|
16
|
+
handled server-side, so existing code keeps working.
|
|
17
|
+
|
|
3
18
|
## 1.0.0
|
|
4
19
|
|
|
5
20
|
The stable v1 of the FlexInference TypeScript SDK. This release makes `start_within`
|
package/README.md
CHANGED
|
@@ -26,6 +26,17 @@ Responses come back as the **raw OpenAI JSON** (we never reshape the body), so t
|
|
|
26
26
|
|
|
27
27
|
`start_within` is **required** on every request. It takes `"default"`, `"priority"`, `"auto"`, or a duration `"HHh-MMm-SSs"` (5s-10m). The duration races OpenAI's flex tier on a flex-capable model and falls back to standard if it can't start in time; `"default"`, `"priority"`, and `"auto"` map to those OpenAI service tiers and proxy any model. It is typed, so a missing value or a value outside the allowed shapes is a **compile-time** error; a duration that fits the shape but is malformed or out of range is caught at **runtime**, the same check plain-JavaScript callers get. See the [docs](https://flexinference.mintlify.app/deadline-routing).
|
|
28
28
|
|
|
29
|
+
## Providers (OpenAI and Gemini)
|
|
30
|
+
|
|
31
|
+
FlexInference routes to **OpenAI** and **Google Gemini**. Send the same OpenAI-shaped request and pass whichever model id you want - `gpt-5.5`, `o4-mini`, `gemini-3.5-flash`, and so on. We run Gemini through its Interactions API and translate it back to the OpenAI shape, so your code is identical for both.
|
|
32
|
+
|
|
33
|
+
- **OpenAI:** `default` (standard tier), `priority`, `auto`, and the flex race (a duration) on flex-capable models.
|
|
34
|
+
- **Gemini:** `default` maps to Gemini's **standard** tier, plus `priority` and the flex race on the Gemini flex models (`gemini-3.5-flash`, `gemini-3.1-flash-lite`, `gemini-3.1-pro-preview`, `gemini-3-flash-preview`, `gemini-2.5-pro`, `gemini-2.5-flash`, `gemini-2.5-flash-lite`). Gemini has no `auto` tier, so `start_within: "auto"` on a Gemini model returns `400`.
|
|
35
|
+
|
|
36
|
+
Add the provider key you'll use (OpenAI and/or Gemini) in the [dashboard](https://www.flexinference.com/dashboard). Text, streaming, structured outputs, function calling, image input, and web search work on both providers (send a Responses `web_search` tool; we map it to Gemini's `google_search`).
|
|
37
|
+
|
|
38
|
+
Don't send `service_tier` - the router controls the tier from `start_within` and rejects a caller-supplied `service_tier` with `400 service_tier_not_allowed`.
|
|
39
|
+
|
|
29
40
|
## Streaming
|
|
30
41
|
|
|
31
42
|
```ts
|
package/dist/index.d.ts
CHANGED
|
@@ -17,6 +17,11 @@ type RawChatRequest = Schemas["CreateChatCompletionRequest"];
|
|
|
17
17
|
export type ChatCompletionCreateParams = WithStartWithin<Partial<RawChatRequest> & Required<Pick<RawChatRequest, "model" | "messages">>>;
|
|
18
18
|
export type ChatCompletion = Schemas["CreateChatCompletionResponse"];
|
|
19
19
|
export type ChatCompletionChunk = Schemas["CreateChatCompletionStreamResponse"];
|
|
20
|
+
export type InteractionCreateParams = WithStartWithin<Schemas["InteractionCreateParams"]> & {
|
|
21
|
+
service_tier?: never;
|
|
22
|
+
};
|
|
23
|
+
export type InteractionObject = Schemas["InteractionObject"];
|
|
24
|
+
export type InteractionStreamEvent = Schemas["InteractionStreamEvent"];
|
|
20
25
|
/**
|
|
21
26
|
* Concatenate the assistant's text from a non-streamed response. Works on a Responses
|
|
22
27
|
* object (walks `output[].content[]` for `output_text` parts) and on a chat completion
|
|
@@ -27,6 +32,14 @@ export type ChatCompletionChunk = Schemas["CreateChatCompletionStreamResponse"];
|
|
|
27
32
|
* their `output_text.delta` events instead.
|
|
28
33
|
*/
|
|
29
34
|
export declare function outputText(response: ResponseObject | ChatCompletion): string;
|
|
35
|
+
/**
|
|
36
|
+
* Concatenate the assistant's text from a non-streamed Interactions response. The text
|
|
37
|
+
* lives in `steps[]` of type `model_output`, each a `content[]` of `{type:"text",text}`
|
|
38
|
+
* parts (a different shape from Responses/chat, so `outputText` returns "" on it). Returns
|
|
39
|
+
* "" when there is no text (e.g. a function-call-only interaction). Read-only: nothing is
|
|
40
|
+
* reshaped. Streamed interactions are not objects; collect their `step.delta` text events.
|
|
41
|
+
*/
|
|
42
|
+
export declare function interactionText(interaction: InteractionObject): string;
|
|
30
43
|
export interface FlexErrorBody {
|
|
31
44
|
error: {
|
|
32
45
|
message: string;
|
|
@@ -65,6 +78,7 @@ type Post = (path: string, body: unknown, signal: AbortSignal | undefined) => Pr
|
|
|
65
78
|
export declare class FlexInference {
|
|
66
79
|
readonly responses: Responses;
|
|
67
80
|
readonly chat: Chat;
|
|
81
|
+
readonly interactions: Interactions;
|
|
68
82
|
private readonly apiKey;
|
|
69
83
|
private readonly baseURL;
|
|
70
84
|
private readonly fetchImpl;
|
|
@@ -96,4 +110,14 @@ declare class ChatCompletions {
|
|
|
96
110
|
stream: true;
|
|
97
111
|
}, options?: RequestOptions): Promise<AsyncIterable<ChatCompletionChunk>>;
|
|
98
112
|
}
|
|
113
|
+
declare class Interactions {
|
|
114
|
+
private readonly post;
|
|
115
|
+
constructor(post: Post);
|
|
116
|
+
create(body: InteractionCreateParams & {
|
|
117
|
+
stream?: false | null;
|
|
118
|
+
}, options?: RequestOptions): Promise<InteractionObject>;
|
|
119
|
+
create(body: InteractionCreateParams & {
|
|
120
|
+
stream: true;
|
|
121
|
+
}, options?: RequestOptions): Promise<AsyncIterable<InteractionStreamEvent>>;
|
|
122
|
+
}
|
|
99
123
|
export {};
|
package/dist/index.js
CHANGED
|
@@ -36,6 +36,32 @@ export function outputText(response) {
|
|
|
36
36
|
}
|
|
37
37
|
return "";
|
|
38
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Concatenate the assistant's text from a non-streamed Interactions response. The text
|
|
41
|
+
* lives in `steps[]` of type `model_output`, each a `content[]` of `{type:"text",text}`
|
|
42
|
+
* parts (a different shape from Responses/chat, so `outputText` returns "" on it). Returns
|
|
43
|
+
* "" when there is no text (e.g. a function-call-only interaction). Read-only: nothing is
|
|
44
|
+
* reshaped. Streamed interactions are not objects; collect their `step.delta` text events.
|
|
45
|
+
*/
|
|
46
|
+
export function interactionText(interaction) {
|
|
47
|
+
const obj = interaction;
|
|
48
|
+
if (!isRecord(obj))
|
|
49
|
+
return "";
|
|
50
|
+
const steps = obj.steps;
|
|
51
|
+
if (!Array.isArray(steps))
|
|
52
|
+
return "";
|
|
53
|
+
let text = "";
|
|
54
|
+
for (const step of steps) {
|
|
55
|
+
if (!isRecord(step) || step.type !== "model_output" || !Array.isArray(step.content))
|
|
56
|
+
continue;
|
|
57
|
+
for (const part of step.content) {
|
|
58
|
+
if (isRecord(part) && part.type === "text" && typeof part.text === "string") {
|
|
59
|
+
text += part.text;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return text;
|
|
64
|
+
}
|
|
39
65
|
export class FlexInferenceError extends Error {
|
|
40
66
|
status;
|
|
41
67
|
type;
|
|
@@ -87,6 +113,7 @@ function assertStartWithin(body) {
|
|
|
87
113
|
export class FlexInference {
|
|
88
114
|
responses;
|
|
89
115
|
chat;
|
|
116
|
+
interactions;
|
|
90
117
|
apiKey;
|
|
91
118
|
baseURL;
|
|
92
119
|
fetchImpl;
|
|
@@ -105,6 +132,7 @@ export class FlexInference {
|
|
|
105
132
|
const post = (path, body, signal) => this.post(path, body, signal);
|
|
106
133
|
this.responses = new Responses(post);
|
|
107
134
|
this.chat = new Chat(post);
|
|
135
|
+
this.interactions = new Interactions(post);
|
|
108
136
|
}
|
|
109
137
|
async post(path, body, signal) {
|
|
110
138
|
// One AbortController fed by three sources: the caller's signal, a 10s connect
|
|
@@ -214,6 +242,25 @@ class ChatCompletions {
|
|
|
214
242
|
}
|
|
215
243
|
}
|
|
216
244
|
}
|
|
245
|
+
class Interactions {
|
|
246
|
+
post;
|
|
247
|
+
constructor(post) {
|
|
248
|
+
this.post = post;
|
|
249
|
+
}
|
|
250
|
+
async create(body, options) {
|
|
251
|
+
assertStartWithin(body);
|
|
252
|
+
const { res, cleanup } = await this.post("/interactions", body, options?.signal);
|
|
253
|
+
if (body.stream) {
|
|
254
|
+
return streamSSE(res, cleanup);
|
|
255
|
+
}
|
|
256
|
+
try {
|
|
257
|
+
return (await res.json());
|
|
258
|
+
}
|
|
259
|
+
finally {
|
|
260
|
+
cleanup();
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
217
264
|
async function* streamSSE(res, cleanup) {
|
|
218
265
|
if (!res.body) {
|
|
219
266
|
cleanup();
|
package/dist/types.d.ts
CHANGED
|
@@ -64,6 +64,23 @@ export interface paths {
|
|
|
64
64
|
patch?: never;
|
|
65
65
|
trace?: never;
|
|
66
66
|
};
|
|
67
|
+
"/interactions": {
|
|
68
|
+
parameters: {
|
|
69
|
+
query?: never;
|
|
70
|
+
header?: never;
|
|
71
|
+
path?: never;
|
|
72
|
+
cookie?: never;
|
|
73
|
+
};
|
|
74
|
+
get?: never;
|
|
75
|
+
put?: never;
|
|
76
|
+
/** Create an interaction. The third FlexInference caller format; works for OpenAI and Gemini models via the canonical Responses path. Send start_within and do not send service_tier. */
|
|
77
|
+
post: operations["createInteraction"];
|
|
78
|
+
delete?: never;
|
|
79
|
+
options?: never;
|
|
80
|
+
head?: never;
|
|
81
|
+
patch?: never;
|
|
82
|
+
trace?: never;
|
|
83
|
+
};
|
|
67
84
|
}
|
|
68
85
|
export type webhooks = Record<string, never>;
|
|
69
86
|
export interface components {
|
|
@@ -1105,7 +1122,7 @@ export interface components {
|
|
|
1105
1122
|
*/
|
|
1106
1123
|
top_logprobs?: number;
|
|
1107
1124
|
/**
|
|
1108
|
-
* @description FlexInference deadline control. Required on every request. "default"
|
|
1125
|
+
* @description FlexInference deadline control. Required on every request. "default" maps to the provider's standard real-time tier (OpenAI "default", Gemini "standard"), "priority" to the provider's priority tier, and "auto" to OpenAI's auto tier (OpenAI only; Gemini has no auto tier). These proxy any model. A duration "HHh-MMm-SSs" between 5 seconds and 10 minutes runs the provider's flex tier (OpenAI or Gemini) on a flex-capable model and automatically falls back to standard if it has not started within the window. Do not send service_tier (the router controls the tier). The retired value "standard" is no longer accepted (use "default").
|
|
1109
1126
|
* @example 00h-00m-30s
|
|
1110
1127
|
*/
|
|
1111
1128
|
start_within?: string;
|
|
@@ -5366,6 +5383,298 @@ export interface components {
|
|
|
5366
5383
|
param?: string | null;
|
|
5367
5384
|
};
|
|
5368
5385
|
};
|
|
5386
|
+
/** Interaction Text Part */
|
|
5387
|
+
InteractionTextPart: {
|
|
5388
|
+
/** @constant */
|
|
5389
|
+
type: "text";
|
|
5390
|
+
text: string;
|
|
5391
|
+
};
|
|
5392
|
+
/** Interaction Image Part */
|
|
5393
|
+
InteractionImagePart: {
|
|
5394
|
+
/** @constant */
|
|
5395
|
+
type: "image";
|
|
5396
|
+
mime_type: string;
|
|
5397
|
+
/** @description Base64-encoded image bytes. */
|
|
5398
|
+
data: string;
|
|
5399
|
+
};
|
|
5400
|
+
/** Interaction Document Part */
|
|
5401
|
+
InteractionDocumentPart: {
|
|
5402
|
+
/** @constant */
|
|
5403
|
+
type: "document";
|
|
5404
|
+
mime_type: string;
|
|
5405
|
+
/** @description Base64-encoded document bytes. */
|
|
5406
|
+
data: string;
|
|
5407
|
+
};
|
|
5408
|
+
/**
|
|
5409
|
+
* Interaction Content Part
|
|
5410
|
+
* @description A single piece of multimodal content in an Interactions request.
|
|
5411
|
+
*/
|
|
5412
|
+
InteractionContentPart: components["schemas"]["InteractionTextPart"] | components["schemas"]["InteractionImagePart"] | components["schemas"]["InteractionDocumentPart"];
|
|
5413
|
+
/** Interaction User Input Step */
|
|
5414
|
+
InteractionUserInputStep: {
|
|
5415
|
+
/** @constant */
|
|
5416
|
+
type: "user_input";
|
|
5417
|
+
content: components["schemas"]["InteractionContentPart"][];
|
|
5418
|
+
};
|
|
5419
|
+
/** Interaction Model Output Step */
|
|
5420
|
+
InteractionModelOutputStep: {
|
|
5421
|
+
/** @constant */
|
|
5422
|
+
type: "model_output";
|
|
5423
|
+
content: components["schemas"]["InteractionContentPart"][];
|
|
5424
|
+
};
|
|
5425
|
+
/** Interaction Function Call Step */
|
|
5426
|
+
InteractionFunctionCallStep: {
|
|
5427
|
+
/** @constant */
|
|
5428
|
+
type: "function_call";
|
|
5429
|
+
id?: string;
|
|
5430
|
+
name: string;
|
|
5431
|
+
/** @description Parsed function arguments object (not a JSON string). */
|
|
5432
|
+
arguments: {
|
|
5433
|
+
[key: string]: unknown;
|
|
5434
|
+
};
|
|
5435
|
+
};
|
|
5436
|
+
/** Interaction Function Result Step */
|
|
5437
|
+
InteractionFunctionResultStep: {
|
|
5438
|
+
/** @constant */
|
|
5439
|
+
type: "function_result";
|
|
5440
|
+
name: string;
|
|
5441
|
+
/** @description Tool result payload; any JSON value. */
|
|
5442
|
+
result: unknown;
|
|
5443
|
+
};
|
|
5444
|
+
/**
|
|
5445
|
+
* Interaction Step
|
|
5446
|
+
* @description One turn in a multi-turn Interactions request (a step list).
|
|
5447
|
+
*/
|
|
5448
|
+
InteractionStep: components["schemas"]["InteractionUserInputStep"] | components["schemas"]["InteractionModelOutputStep"] | components["schemas"]["InteractionFunctionCallStep"] | components["schemas"]["InteractionFunctionResultStep"];
|
|
5449
|
+
/** Interaction Function Tool */
|
|
5450
|
+
InteractionFunctionTool: {
|
|
5451
|
+
/** @constant */
|
|
5452
|
+
type: "function";
|
|
5453
|
+
name: string;
|
|
5454
|
+
description?: string;
|
|
5455
|
+
/** @description JSON Schema for the function parameters. */
|
|
5456
|
+
parameters?: {
|
|
5457
|
+
[key: string]: unknown;
|
|
5458
|
+
};
|
|
5459
|
+
};
|
|
5460
|
+
/** Interaction Google Search Tool */
|
|
5461
|
+
InteractionGoogleSearchTool: {
|
|
5462
|
+
/** @constant */
|
|
5463
|
+
type: "google_search";
|
|
5464
|
+
};
|
|
5465
|
+
/** Interaction Tool */
|
|
5466
|
+
InteractionTool: components["schemas"]["InteractionFunctionTool"] | components["schemas"]["InteractionGoogleSearchTool"];
|
|
5467
|
+
/**
|
|
5468
|
+
* Interaction Generation Config
|
|
5469
|
+
* @description Generation controls. thinking_level maps to canonical reasoning.effort.
|
|
5470
|
+
*/
|
|
5471
|
+
InteractionGenerationConfig: {
|
|
5472
|
+
max_output_tokens?: number;
|
|
5473
|
+
temperature?: number;
|
|
5474
|
+
top_p?: number;
|
|
5475
|
+
/** @enum {string} */
|
|
5476
|
+
thinking_level?: "minimal" | "low" | "medium" | "high";
|
|
5477
|
+
/** @description auto, none, or any. "any" maps to canonical tool_choice "required". */
|
|
5478
|
+
tool_choice?: string;
|
|
5479
|
+
};
|
|
5480
|
+
/**
|
|
5481
|
+
* Interaction Create Params
|
|
5482
|
+
* @description Request body for POST /v1/interactions. Works for both OpenAI and Gemini models via the canonical Responses path. Does not accept service_tier (the router owns the tier). start_within is required at runtime but left optional here.
|
|
5483
|
+
*/
|
|
5484
|
+
InteractionCreateParams: {
|
|
5485
|
+
model: string;
|
|
5486
|
+
/** @description A prompt string, a content-part array (one turn), or a step list (multi-turn). */
|
|
5487
|
+
input?: string | components["schemas"]["InteractionContentPart"][] | components["schemas"]["InteractionStep"][];
|
|
5488
|
+
/** @description System instruction as a string or a content-part array. */
|
|
5489
|
+
system_instruction?: string | components["schemas"]["InteractionContentPart"][];
|
|
5490
|
+
tools?: components["schemas"]["InteractionTool"][];
|
|
5491
|
+
/** @description Inline JSON schema, mapped to canonical text.format.json_schema. */
|
|
5492
|
+
response_format?: {
|
|
5493
|
+
[key: string]: unknown;
|
|
5494
|
+
};
|
|
5495
|
+
generation_config?: components["schemas"]["InteractionGenerationConfig"];
|
|
5496
|
+
previous_interaction_id?: string;
|
|
5497
|
+
stream?: boolean;
|
|
5498
|
+
background?: boolean;
|
|
5499
|
+
store?: boolean;
|
|
5500
|
+
/** @description FlexInference deadline control (see the Responses/Chat ops). Required on every request; enforced by the router at runtime, not by this schema. */
|
|
5501
|
+
start_within?: string;
|
|
5502
|
+
} & {
|
|
5503
|
+
[key: string]: unknown;
|
|
5504
|
+
};
|
|
5505
|
+
/** Interaction Usage */
|
|
5506
|
+
InteractionUsage: {
|
|
5507
|
+
total_input_tokens?: number;
|
|
5508
|
+
total_output_tokens?: number;
|
|
5509
|
+
total_thought_tokens?: number;
|
|
5510
|
+
total_cached_tokens?: number;
|
|
5511
|
+
total_tokens?: number;
|
|
5512
|
+
total_tool_use_tokens?: number;
|
|
5513
|
+
};
|
|
5514
|
+
/**
|
|
5515
|
+
* Interaction Text Annotation
|
|
5516
|
+
* @description An opaque annotation on emitted text (e.g. a web-search citation).
|
|
5517
|
+
*/
|
|
5518
|
+
InteractionTextAnnotation: {
|
|
5519
|
+
[key: string]: unknown;
|
|
5520
|
+
};
|
|
5521
|
+
/** Interaction Response Text Content */
|
|
5522
|
+
InteractionResponseTextContent: {
|
|
5523
|
+
/** @constant */
|
|
5524
|
+
type: "text";
|
|
5525
|
+
text: string;
|
|
5526
|
+
annotations?: components["schemas"]["InteractionTextAnnotation"][];
|
|
5527
|
+
};
|
|
5528
|
+
/** Interaction Model Output Response Step */
|
|
5529
|
+
InteractionModelOutputResponseStep: {
|
|
5530
|
+
/** @constant */
|
|
5531
|
+
type: "model_output";
|
|
5532
|
+
content: components["schemas"]["InteractionResponseTextContent"][];
|
|
5533
|
+
};
|
|
5534
|
+
/** Interaction Function Call Response Step */
|
|
5535
|
+
InteractionFunctionCallResponseStep: {
|
|
5536
|
+
/** @constant */
|
|
5537
|
+
type: "function_call";
|
|
5538
|
+
id?: string;
|
|
5539
|
+
name: string;
|
|
5540
|
+
arguments: {
|
|
5541
|
+
[key: string]: unknown;
|
|
5542
|
+
};
|
|
5543
|
+
};
|
|
5544
|
+
/** Interaction Google Search Call Step */
|
|
5545
|
+
InteractionGoogleSearchCallStep: {
|
|
5546
|
+
/** @constant */
|
|
5547
|
+
type: "google_search_call";
|
|
5548
|
+
id: string;
|
|
5549
|
+
};
|
|
5550
|
+
/** Interaction Response Step */
|
|
5551
|
+
InteractionResponseStep: components["schemas"]["InteractionModelOutputResponseStep"] | components["schemas"]["InteractionFunctionCallResponseStep"] | components["schemas"]["InteractionGoogleSearchCallStep"];
|
|
5552
|
+
/**
|
|
5553
|
+
* Interaction Object
|
|
5554
|
+
* @description Non-stream response from POST /v1/interactions.
|
|
5555
|
+
*/
|
|
5556
|
+
InteractionObject: {
|
|
5557
|
+
id: string;
|
|
5558
|
+
/** @constant */
|
|
5559
|
+
object: "interaction";
|
|
5560
|
+
/** @enum {string} */
|
|
5561
|
+
status: "completed" | "requires_action" | "incomplete" | "failed";
|
|
5562
|
+
model: string;
|
|
5563
|
+
created?: number;
|
|
5564
|
+
updated?: number;
|
|
5565
|
+
service_tier?: string;
|
|
5566
|
+
usage?: components["schemas"]["InteractionUsage"];
|
|
5567
|
+
steps: components["schemas"]["InteractionResponseStep"][];
|
|
5568
|
+
};
|
|
5569
|
+
/**
|
|
5570
|
+
* Interaction Stream Snapshot
|
|
5571
|
+
* @description Interaction state carried by created and completed stream events.
|
|
5572
|
+
*/
|
|
5573
|
+
InteractionStreamSnapshot: {
|
|
5574
|
+
id: string;
|
|
5575
|
+
status: string;
|
|
5576
|
+
/** @constant */
|
|
5577
|
+
object: "interaction";
|
|
5578
|
+
model: string;
|
|
5579
|
+
usage?: components["schemas"]["InteractionUsage"];
|
|
5580
|
+
} & {
|
|
5581
|
+
[key: string]: unknown;
|
|
5582
|
+
};
|
|
5583
|
+
/**
|
|
5584
|
+
* Interaction Stream Step
|
|
5585
|
+
* @description The step descriptor on a step.start event.
|
|
5586
|
+
*/
|
|
5587
|
+
InteractionStreamStep: {
|
|
5588
|
+
/** @enum {string} */
|
|
5589
|
+
type: "model_output" | "function_call" | "google_search_call";
|
|
5590
|
+
id?: string;
|
|
5591
|
+
name?: string;
|
|
5592
|
+
};
|
|
5593
|
+
/**
|
|
5594
|
+
* Interaction Stream Delta
|
|
5595
|
+
* @description The incremental payload on a step.delta event.
|
|
5596
|
+
*/
|
|
5597
|
+
InteractionStreamDelta: {
|
|
5598
|
+
/** @enum {string} */
|
|
5599
|
+
type?: "text" | "arguments_delta";
|
|
5600
|
+
text?: string;
|
|
5601
|
+
arguments?: string;
|
|
5602
|
+
annotations?: components["schemas"]["InteractionTextAnnotation"][];
|
|
5603
|
+
};
|
|
5604
|
+
/** Interaction Created Event */
|
|
5605
|
+
InteractionCreatedEvent: {
|
|
5606
|
+
/**
|
|
5607
|
+
* @description discriminator enum property added by openapi-typescript
|
|
5608
|
+
* @enum {string}
|
|
5609
|
+
*/
|
|
5610
|
+
event_type: "interaction.created";
|
|
5611
|
+
interaction: components["schemas"]["InteractionStreamSnapshot"];
|
|
5612
|
+
};
|
|
5613
|
+
/** Interaction Status Update Event */
|
|
5614
|
+
InteractionStatusUpdateEvent: {
|
|
5615
|
+
/**
|
|
5616
|
+
* @description discriminator enum property added by openapi-typescript
|
|
5617
|
+
* @enum {string}
|
|
5618
|
+
*/
|
|
5619
|
+
event_type: "interaction.status_update";
|
|
5620
|
+
interaction_id: string;
|
|
5621
|
+
status: string;
|
|
5622
|
+
};
|
|
5623
|
+
/** Interaction Completed Event */
|
|
5624
|
+
InteractionCompletedEvent: {
|
|
5625
|
+
/**
|
|
5626
|
+
* @description discriminator enum property added by openapi-typescript
|
|
5627
|
+
* @enum {string}
|
|
5628
|
+
*/
|
|
5629
|
+
event_type: "interaction.completed";
|
|
5630
|
+
interaction: components["schemas"]["InteractionStreamSnapshot"];
|
|
5631
|
+
};
|
|
5632
|
+
/** Interaction Step Start Event */
|
|
5633
|
+
InteractionStepStartEvent: {
|
|
5634
|
+
/**
|
|
5635
|
+
* @description discriminator enum property added by openapi-typescript
|
|
5636
|
+
* @enum {string}
|
|
5637
|
+
*/
|
|
5638
|
+
event_type: "step.start";
|
|
5639
|
+
index: number;
|
|
5640
|
+
step: components["schemas"]["InteractionStreamStep"];
|
|
5641
|
+
};
|
|
5642
|
+
/** Interaction Step Delta Event */
|
|
5643
|
+
InteractionStepDeltaEvent: {
|
|
5644
|
+
/**
|
|
5645
|
+
* @description discriminator enum property added by openapi-typescript
|
|
5646
|
+
* @enum {string}
|
|
5647
|
+
*/
|
|
5648
|
+
event_type: "step.delta";
|
|
5649
|
+
index: number;
|
|
5650
|
+
delta: components["schemas"]["InteractionStreamDelta"];
|
|
5651
|
+
};
|
|
5652
|
+
/** Interaction Step Stop Event */
|
|
5653
|
+
InteractionStepStopEvent: {
|
|
5654
|
+
/**
|
|
5655
|
+
* @description discriminator enum property added by openapi-typescript
|
|
5656
|
+
* @enum {string}
|
|
5657
|
+
*/
|
|
5658
|
+
event_type: "step.stop";
|
|
5659
|
+
index: number;
|
|
5660
|
+
};
|
|
5661
|
+
/** Interaction Error Event */
|
|
5662
|
+
InteractionErrorEvent: {
|
|
5663
|
+
/**
|
|
5664
|
+
* @description discriminator enum property added by openapi-typescript
|
|
5665
|
+
* @enum {string}
|
|
5666
|
+
*/
|
|
5667
|
+
event_type: "error";
|
|
5668
|
+
/** @description Error payload (mirrors the FlexError error object). */
|
|
5669
|
+
error: {
|
|
5670
|
+
[key: string]: unknown;
|
|
5671
|
+
};
|
|
5672
|
+
};
|
|
5673
|
+
/**
|
|
5674
|
+
* Interaction Stream Event
|
|
5675
|
+
* @description One server-sent event frame on the Interactions stream.
|
|
5676
|
+
*/
|
|
5677
|
+
InteractionStreamEvent: components["schemas"]["InteractionCreatedEvent"] | components["schemas"]["InteractionStatusUpdateEvent"] | components["schemas"]["InteractionCompletedEvent"] | components["schemas"]["InteractionStepStartEvent"] | components["schemas"]["InteractionStepDeltaEvent"] | components["schemas"]["InteractionStepStopEvent"] | components["schemas"]["InteractionErrorEvent"];
|
|
5369
5678
|
};
|
|
5370
5679
|
responses: never;
|
|
5371
5680
|
parameters: never;
|
|
@@ -5398,7 +5707,7 @@ export interface operations {
|
|
|
5398
5707
|
"text/event-stream": components["schemas"]["CreateChatCompletionStreamResponse"];
|
|
5399
5708
|
};
|
|
5400
5709
|
};
|
|
5401
|
-
/** @description Bad request. A FlexInference-layer rejection (type flexinference_error, e.g. missing_start_within, invalid_start_within, model_not_flex_capable, no_byok_key) or an OpenAI rejection passed through unchanged. */
|
|
5710
|
+
/** @description Bad request. A FlexInference-layer rejection (type flexinference_error, e.g. missing_start_within, invalid_start_within, model_not_flex_capable, no_byok_key, no_gemini_key, auto_unsupported_for_gemini, service_tier_not_allowed) or an OpenAI/Gemini rejection passed through unchanged. */
|
|
5402
5711
|
400: {
|
|
5403
5712
|
headers: {
|
|
5404
5713
|
[name: string]: unknown;
|
|
@@ -5441,7 +5750,50 @@ export interface operations {
|
|
|
5441
5750
|
"text/event-stream": components["schemas"]["ResponseStreamEvent"];
|
|
5442
5751
|
};
|
|
5443
5752
|
};
|
|
5444
|
-
/** @description Bad request. A FlexInference-layer rejection (type flexinference_error, e.g. missing_start_within, invalid_start_within, model_not_flex_capable, no_byok_key) or an OpenAI rejection passed through unchanged. */
|
|
5753
|
+
/** @description Bad request. A FlexInference-layer rejection (type flexinference_error, e.g. missing_start_within, invalid_start_within, model_not_flex_capable, no_byok_key, no_gemini_key, auto_unsupported_for_gemini, service_tier_not_allowed) or an OpenAI/Gemini rejection passed through unchanged. */
|
|
5754
|
+
400: {
|
|
5755
|
+
headers: {
|
|
5756
|
+
[name: string]: unknown;
|
|
5757
|
+
};
|
|
5758
|
+
content: {
|
|
5759
|
+
"application/json": components["schemas"]["FlexError"];
|
|
5760
|
+
};
|
|
5761
|
+
};
|
|
5762
|
+
/** @description Invalid or missing FlexInference API key (type flexinference_error, code invalid_api_key). */
|
|
5763
|
+
401: {
|
|
5764
|
+
headers: {
|
|
5765
|
+
[name: string]: unknown;
|
|
5766
|
+
};
|
|
5767
|
+
content: {
|
|
5768
|
+
"application/json": components["schemas"]["FlexError"];
|
|
5769
|
+
};
|
|
5770
|
+
};
|
|
5771
|
+
};
|
|
5772
|
+
};
|
|
5773
|
+
createInteraction: {
|
|
5774
|
+
parameters: {
|
|
5775
|
+
query?: never;
|
|
5776
|
+
header?: never;
|
|
5777
|
+
path?: never;
|
|
5778
|
+
cookie?: never;
|
|
5779
|
+
};
|
|
5780
|
+
requestBody: {
|
|
5781
|
+
content: {
|
|
5782
|
+
"application/json": components["schemas"]["InteractionCreateParams"];
|
|
5783
|
+
};
|
|
5784
|
+
};
|
|
5785
|
+
responses: {
|
|
5786
|
+
/** @description OK */
|
|
5787
|
+
200: {
|
|
5788
|
+
headers: {
|
|
5789
|
+
[name: string]: unknown;
|
|
5790
|
+
};
|
|
5791
|
+
content: {
|
|
5792
|
+
"application/json": components["schemas"]["InteractionObject"];
|
|
5793
|
+
"text/event-stream": components["schemas"]["InteractionStreamEvent"];
|
|
5794
|
+
};
|
|
5795
|
+
};
|
|
5796
|
+
/** @description Bad request. A FlexInference-layer rejection (type flexinference_error, e.g. missing_start_within, invalid_start_within, model_not_flex_capable, auto_unsupported_for_gemini, service_tier_not_allowed) or an OpenAI/Gemini rejection passed through unchanged. */
|
|
5445
5797
|
400: {
|
|
5446
5798
|
headers: {
|
|
5447
5799
|
[name: string]: unknown;
|
package/package.json
CHANGED