feat: Passwordless cross-device authentication

- Arkitektur: docs/auth/passwordless-architecture.md
- Backend: iom/quixzoom-auth-service/ (FastAPI + Redis)
- Webb: quixzoom-market-pages/se/login/ (QR-kod + polling)
- App: iom/quixzoom-app/src/features/auth/ (push + deep links)

Flöde: QR-kod → app-godkännande → webb-inloggad
This commit is contained in:
Bernt
2026-07-07 07:11:50 +00:00
parent 4aa984ad74
commit 6989a98d75
61843 changed files with 5491611 additions and 872231 deletions
+191
View File
@@ -0,0 +1,191 @@
import { APIResource } from "../../core/resource.mjs";
import * as Shared from "../shared.mjs";
import * as ItemsAPI from "./items.mjs";
import { ConversationItem, ConversationItemList, ConversationItemsPage, ItemCreateParams, ItemDeleteParams, ItemListParams, ItemRetrieveParams, Items } from "./items.mjs";
import * as ResponsesAPI from "../responses/responses.mjs";
import { APIPromise } from "../../core/api-promise.mjs";
import { RequestOptions } from "../../internal/request-options.mjs";
/**
* Manage conversations and conversation items.
*/
export declare class Conversations extends APIResource {
items: ItemsAPI.Items;
/**
* Create a conversation.
*/
create(body?: ConversationCreateParams | null | undefined, options?: RequestOptions): APIPromise<Conversation>;
/**
* Get a conversation
*/
retrieve(conversationID: string, options?: RequestOptions): APIPromise<Conversation>;
/**
* Update a conversation
*/
update(conversationID: string, body: ConversationUpdateParams, options?: RequestOptions): APIPromise<Conversation>;
/**
* Delete a conversation. Items in the conversation will not be deleted.
*/
delete(conversationID: string, options?: RequestOptions): APIPromise<ConversationDeletedResource>;
}
/**
* A screenshot of a computer.
*/
export interface ComputerScreenshotContent {
/**
* The detail level of the screenshot image to be sent to the model. One of `high`,
* `low`, `auto`, or `original`. Defaults to `auto`.
*/
detail: 'low' | 'high' | 'auto' | 'original';
/**
* The identifier of an uploaded file that contains the screenshot.
*/
file_id: string | null;
/**
* The URL of the screenshot image.
*/
image_url: string | null;
/**
* Specifies the event type. For a computer screenshot, this property is always set
* to `computer_screenshot`.
*/
type: 'computer_screenshot';
}
export interface Conversation {
/**
* The unique ID of the conversation.
*/
id: string;
/**
* The time at which the conversation was created, measured in seconds since the
* Unix epoch.
*/
created_at: number;
/**
* Set of 16 key-value pairs that can be attached to an object. This can be useful
* for storing additional information about the object in a structured format, and
* querying for objects via API or the dashboard. Keys are strings with a maximum
* length of 64 characters. Values are strings with a maximum length of 512
* characters.
*/
metadata: unknown;
/**
* The object type, which is always `conversation`.
*/
object: 'conversation';
}
export interface ConversationDeleted {
id: string;
deleted: boolean;
object: 'conversation.deleted';
}
export interface ConversationDeletedResource {
id: string;
deleted: boolean;
object: 'conversation.deleted';
}
/**
* A message to or from the model.
*/
export interface Message {
/**
* The unique ID of the message.
*/
id: string;
/**
* The content of the message
*/
content: Array<ResponsesAPI.ResponseInputText | ResponsesAPI.ResponseOutputText | TextContent | SummaryTextContent | Message.ReasoningText | ResponsesAPI.ResponseOutputRefusal | ResponsesAPI.ResponseInputImage | ComputerScreenshotContent | ResponsesAPI.ResponseInputFile>;
/**
* The role of the message. One of `unknown`, `user`, `assistant`, `system`,
* `critic`, `discriminator`, `developer`, or `tool`.
*/
role: 'unknown' | 'user' | 'assistant' | 'system' | 'critic' | 'discriminator' | 'developer' | 'tool';
/**
* The status of item. One of `in_progress`, `completed`, or `incomplete`.
* Populated when items are returned via API.
*/
status: 'in_progress' | 'completed' | 'incomplete';
/**
* The type of the message. Always set to `message`.
*/
type: 'message';
/**
* Labels an `assistant` message as intermediate commentary (`commentary`) or the
* final answer (`final_answer`). For models like `gpt-5.3-codex` and beyond, when
* sending follow-up requests, preserve and resend phase on all assistant messages
* — dropping it can degrade performance. Not used for user messages.
*/
phase?: 'commentary' | 'final_answer' | null;
}
export declare namespace Message {
/**
* Reasoning text from the model.
*/
interface ReasoningText {
/**
* The reasoning text from the model.
*/
text: string;
/**
* The type of the reasoning text. Always `reasoning_text`.
*/
type: 'reasoning_text';
}
}
/**
* A summary text from the model.
*/
export interface SummaryTextContent {
/**
* A summary of the reasoning output from the model so far.
*/
text: string;
/**
* The type of the object. Always `summary_text`.
*/
type: 'summary_text';
}
/**
* A text content.
*/
export interface TextContent {
text: string;
type: 'text';
}
export type InputTextContent = ResponsesAPI.ResponseInputText;
export type OutputTextContent = ResponsesAPI.ResponseOutputText;
export type RefusalContent = ResponsesAPI.ResponseOutputRefusal;
export type InputImageContent = ResponsesAPI.ResponseInputImage;
export type InputFileContent = ResponsesAPI.ResponseInputFile;
export interface ConversationCreateParams {
/**
* Initial items to include in the conversation context. You may add up to 20 items
* at a time.
*/
items?: Array<ResponsesAPI.ResponseInputItem> | null;
/**
* Set of 16 key-value pairs that can be attached to an object. This can be useful
* for storing additional information about the object in a structured format, and
* querying for objects via API or the dashboard.
*
* Keys are strings with a maximum length of 64 characters. Values are strings with
* a maximum length of 512 characters.
*/
metadata?: Shared.Metadata | null;
}
export interface ConversationUpdateParams {
/**
* Set of 16 key-value pairs that can be attached to an object. This can be useful
* for storing additional information about the object in a structured format, and
* querying for objects via API or the dashboard.
*
* Keys are strings with a maximum length of 64 characters. Values are strings with
* a maximum length of 512 characters.
*/
metadata: Shared.Metadata | null;
}
export declare namespace Conversations {
export { type ComputerScreenshotContent as ComputerScreenshotContent, type Conversation as Conversation, type ConversationDeleted as ConversationDeleted, type ConversationDeletedResource as ConversationDeletedResource, type Message as Message, type SummaryTextContent as SummaryTextContent, type TextContent as TextContent, type InputTextContent as InputTextContent, type OutputTextContent as OutputTextContent, type RefusalContent as RefusalContent, type InputImageContent as InputImageContent, type InputFileContent as InputFileContent, type ConversationCreateParams as ConversationCreateParams, type ConversationUpdateParams as ConversationUpdateParams, };
export { Items as Items, type ConversationItem as ConversationItem, type ConversationItemList as ConversationItemList, type ConversationItemsPage as ConversationItemsPage, type ItemCreateParams as ItemCreateParams, type ItemRetrieveParams as ItemRetrieveParams, type ItemListParams as ItemListParams, type ItemDeleteParams as ItemDeleteParams, };
}
//# sourceMappingURL=conversations.d.mts.map
@@ -0,0 +1 @@
{"version":3,"file":"conversations.d.mts","sourceRoot":"","sources":["../../src/resources/conversations/conversations.ts"],"names":[],"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,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;IAEF,OAAO,EACL,KAAK,IAAI,KAAK,EACd,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
+191
View File
@@ -0,0 +1,191 @@
import { APIResource } from "../../core/resource.js";
import * as Shared from "../shared.js";
import * as ItemsAPI from "./items.js";
import { ConversationItem, ConversationItemList, ConversationItemsPage, ItemCreateParams, ItemDeleteParams, ItemListParams, ItemRetrieveParams, Items } from "./items.js";
import * as ResponsesAPI from "../responses/responses.js";
import { APIPromise } from "../../core/api-promise.js";
import { RequestOptions } from "../../internal/request-options.js";
/**
* Manage conversations and conversation items.
*/
export declare class Conversations extends APIResource {
items: ItemsAPI.Items;
/**
* Create a conversation.
*/
create(body?: ConversationCreateParams | null | undefined, options?: RequestOptions): APIPromise<Conversation>;
/**
* Get a conversation
*/
retrieve(conversationID: string, options?: RequestOptions): APIPromise<Conversation>;
/**
* Update a conversation
*/
update(conversationID: string, body: ConversationUpdateParams, options?: RequestOptions): APIPromise<Conversation>;
/**
* Delete a conversation. Items in the conversation will not be deleted.
*/
delete(conversationID: string, options?: RequestOptions): APIPromise<ConversationDeletedResource>;
}
/**
* A screenshot of a computer.
*/
export interface ComputerScreenshotContent {
/**
* The detail level of the screenshot image to be sent to the model. One of `high`,
* `low`, `auto`, or `original`. Defaults to `auto`.
*/
detail: 'low' | 'high' | 'auto' | 'original';
/**
* The identifier of an uploaded file that contains the screenshot.
*/
file_id: string | null;
/**
* The URL of the screenshot image.
*/
image_url: string | null;
/**
* Specifies the event type. For a computer screenshot, this property is always set
* to `computer_screenshot`.
*/
type: 'computer_screenshot';
}
export interface Conversation {
/**
* The unique ID of the conversation.
*/
id: string;
/**
* The time at which the conversation was created, measured in seconds since the
* Unix epoch.
*/
created_at: number;
/**
* Set of 16 key-value pairs that can be attached to an object. This can be useful
* for storing additional information about the object in a structured format, and
* querying for objects via API or the dashboard. Keys are strings with a maximum
* length of 64 characters. Values are strings with a maximum length of 512
* characters.
*/
metadata: unknown;
/**
* The object type, which is always `conversation`.
*/
object: 'conversation';
}
export interface ConversationDeleted {
id: string;
deleted: boolean;
object: 'conversation.deleted';
}
export interface ConversationDeletedResource {
id: string;
deleted: boolean;
object: 'conversation.deleted';
}
/**
* A message to or from the model.
*/
export interface Message {
/**
* The unique ID of the message.
*/
id: string;
/**
* The content of the message
*/
content: Array<ResponsesAPI.ResponseInputText | ResponsesAPI.ResponseOutputText | TextContent | SummaryTextContent | Message.ReasoningText | ResponsesAPI.ResponseOutputRefusal | ResponsesAPI.ResponseInputImage | ComputerScreenshotContent | ResponsesAPI.ResponseInputFile>;
/**
* The role of the message. One of `unknown`, `user`, `assistant`, `system`,
* `critic`, `discriminator`, `developer`, or `tool`.
*/
role: 'unknown' | 'user' | 'assistant' | 'system' | 'critic' | 'discriminator' | 'developer' | 'tool';
/**
* The status of item. One of `in_progress`, `completed`, or `incomplete`.
* Populated when items are returned via API.
*/
status: 'in_progress' | 'completed' | 'incomplete';
/**
* The type of the message. Always set to `message`.
*/
type: 'message';
/**
* Labels an `assistant` message as intermediate commentary (`commentary`) or the
* final answer (`final_answer`). For models like `gpt-5.3-codex` and beyond, when
* sending follow-up requests, preserve and resend phase on all assistant messages
* — dropping it can degrade performance. Not used for user messages.
*/
phase?: 'commentary' | 'final_answer' | null;
}
export declare namespace Message {
/**
* Reasoning text from the model.
*/
interface ReasoningText {
/**
* The reasoning text from the model.
*/
text: string;
/**
* The type of the reasoning text. Always `reasoning_text`.
*/
type: 'reasoning_text';
}
}
/**
* A summary text from the model.
*/
export interface SummaryTextContent {
/**
* A summary of the reasoning output from the model so far.
*/
text: string;
/**
* The type of the object. Always `summary_text`.
*/
type: 'summary_text';
}
/**
* A text content.
*/
export interface TextContent {
text: string;
type: 'text';
}
export type InputTextContent = ResponsesAPI.ResponseInputText;
export type OutputTextContent = ResponsesAPI.ResponseOutputText;
export type RefusalContent = ResponsesAPI.ResponseOutputRefusal;
export type InputImageContent = ResponsesAPI.ResponseInputImage;
export type InputFileContent = ResponsesAPI.ResponseInputFile;
export interface ConversationCreateParams {
/**
* Initial items to include in the conversation context. You may add up to 20 items
* at a time.
*/
items?: Array<ResponsesAPI.ResponseInputItem> | null;
/**
* Set of 16 key-value pairs that can be attached to an object. This can be useful
* for storing additional information about the object in a structured format, and
* querying for objects via API or the dashboard.
*
* Keys are strings with a maximum length of 64 characters. Values are strings with
* a maximum length of 512 characters.
*/
metadata?: Shared.Metadata | null;
}
export interface ConversationUpdateParams {
/**
* Set of 16 key-value pairs that can be attached to an object. This can be useful
* for storing additional information about the object in a structured format, and
* querying for objects via API or the dashboard.
*
* Keys are strings with a maximum length of 64 characters. Values are strings with
* a maximum length of 512 characters.
*/
metadata: Shared.Metadata | null;
}
export declare namespace Conversations {
export { type ComputerScreenshotContent as ComputerScreenshotContent, type Conversation as Conversation, type ConversationDeleted as ConversationDeleted, type ConversationDeletedResource as ConversationDeletedResource, type Message as Message, type SummaryTextContent as SummaryTextContent, type TextContent as TextContent, type InputTextContent as InputTextContent, type OutputTextContent as OutputTextContent, type RefusalContent as RefusalContent, type InputImageContent as InputImageContent, type InputFileContent as InputFileContent, type ConversationCreateParams as ConversationCreateParams, type ConversationUpdateParams as ConversationUpdateParams, };
export { Items as Items, type ConversationItem as ConversationItem, type ConversationItemList as ConversationItemList, type ConversationItemsPage as ConversationItemsPage, type ItemCreateParams as ItemCreateParams, type ItemRetrieveParams as ItemRetrieveParams, type ItemListParams as ItemListParams, type ItemDeleteParams as ItemDeleteParams, };
}
//# sourceMappingURL=conversations.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"conversations.d.ts","sourceRoot":"","sources":["../../src/resources/conversations/conversations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,MAAM,qBAAkB;AACpC,OAAO,KAAK,QAAQ,mBAAgB;AACpC,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,KAAK,EACN,mBAAgB;AACjB,OAAO,KAAK,YAAY,kCAA+B;AACvD,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAGhE;;GAEG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC5C,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAoC;IAEzD;;OAEG;IACH,MAAM,CACJ,IAAI,GAAE,wBAAwB,GAAG,IAAI,GAAG,SAAc,EACtD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,YAAY,CAAC;IAI3B;;OAEG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,YAAY,CAAC;IAOpF;;OAEG;IACH,MAAM,CACJ,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,wBAAwB,EAC9B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,YAAY,CAAC;IAQ3B;;OAEG;IACH,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,2BAA2B,CAAC;CAMlG;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,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C/D,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;IAEF,OAAO,EACL,KAAK,IAAI,KAAK,EACd,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
+55
View File
@@ -0,0 +1,55 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Conversations = void 0;
const tslib_1 = require("../../internal/tslib.js");
const resource_1 = require("../../core/resource.js");
const ItemsAPI = tslib_1.__importStar(require("./items.js"));
const items_1 = require("./items.js");
const path_1 = require("../../internal/utils/path.js");
/**
* Manage conversations and conversation items.
*/
class Conversations extends resource_1.APIResource {
constructor() {
super(...arguments);
this.items = new ItemsAPI.Items(this._client);
}
/**
* Create a conversation.
*/
create(body = {}, options) {
return this._client.post('/conversations', { body, ...options, __security: { bearerAuth: true } });
}
/**
* Get a conversation
*/
retrieve(conversationID, options) {
return this._client.get((0, path_1.path) `/conversations/${conversationID}`, {
...options,
__security: { bearerAuth: true },
});
}
/**
* Update a conversation
*/
update(conversationID, body, options) {
return this._client.post((0, path_1.path) `/conversations/${conversationID}`, {
body,
...options,
__security: { bearerAuth: true },
});
}
/**
* Delete a conversation. Items in the conversation will not be deleted.
*/
delete(conversationID, options) {
return this._client.delete((0, path_1.path) `/conversations/${conversationID}`, {
...options,
__security: { bearerAuth: true },
});
}
}
exports.Conversations = Conversations;
Conversations.Items = items_1.Items;
//# sourceMappingURL=conversations.js.map
@@ -0,0 +1 @@
{"version":3,"file":"conversations.js","sourceRoot":"","sources":["../../src/resources/conversations/conversations.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAElD,6DAAoC;AACpC,sCASiB;AAIjB,uDAAiD;AAEjD;;GAEG;AACH,MAAa,aAAc,SAAQ,sBAAW;IAA9C;;QACE,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA8C3D,CAAC;IA5CC;;OAEG;IACH,MAAM,CACJ,OAAoD,EAAE,EACtD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IACrG,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,cAAsB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,kBAAkB,cAAc,EAAE,EAAE;YAC9D,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;SACjC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,MAAM,CACJ,cAAsB,EACtB,IAA8B,EAC9B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,kBAAkB,cAAc,EAAE,EAAE;YAC/D,IAAI;YACJ,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;SACjC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,cAAsB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,kBAAkB,cAAc,EAAE,EAAE;YACjE,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;SACjC,CAAC,CAAC;IACL,CAAC;CACF;AA/CD,sCA+CC;AA2MD,aAAa,CAAC,KAAK,GAAG,aAAK,CAAC"}
+50
View File
@@ -0,0 +1,50 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../core/resource.mjs";
import * as ItemsAPI from "./items.mjs";
import { Items, } from "./items.mjs";
import { path } from "../../internal/utils/path.mjs";
/**
* Manage conversations and conversation items.
*/
export class Conversations extends APIResource {
constructor() {
super(...arguments);
this.items = new ItemsAPI.Items(this._client);
}
/**
* Create a conversation.
*/
create(body = {}, options) {
return this._client.post('/conversations', { body, ...options, __security: { bearerAuth: true } });
}
/**
* Get a conversation
*/
retrieve(conversationID, options) {
return this._client.get(path `/conversations/${conversationID}`, {
...options,
__security: { bearerAuth: true },
});
}
/**
* Update a conversation
*/
update(conversationID, body, options) {
return this._client.post(path `/conversations/${conversationID}`, {
body,
...options,
__security: { bearerAuth: true },
});
}
/**
* Delete a conversation. Items in the conversation will not be deleted.
*/
delete(conversationID, options) {
return this._client.delete(path `/conversations/${conversationID}`, {
...options,
__security: { bearerAuth: true },
});
}
}
Conversations.Items = Items;
//# sourceMappingURL=conversations.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"conversations.mjs","sourceRoot":"","sources":["../../src/resources/conversations/conversations.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAElD,OAAO,KAAK,QAAQ,oBAAgB;AACpC,OAAO,EAQL,KAAK,GACN,oBAAgB;AAIjB,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,WAAW;IAA9C;;QACE,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA8C3D,CAAC;IA5CC;;OAEG;IACH,MAAM,CACJ,OAAoD,EAAE,EACtD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IACrG,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,cAAsB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,kBAAkB,cAAc,EAAE,EAAE;YAC9D,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;SACjC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,MAAM,CACJ,cAAsB,EACtB,IAA8B,EAC9B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,kBAAkB,cAAc,EAAE,EAAE;YAC/D,IAAI;YACJ,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;SACjC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,cAAsB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,kBAAkB,cAAc,EAAE,EAAE;YACjE,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;SACjC,CAAC,CAAC;IACL,CAAC;CACF;AA2MD,aAAa,CAAC,KAAK,GAAG,KAAK,CAAC"}
+3
View File
@@ -0,0 +1,3 @@
export * from "./conversations.mjs";
export { Items, type ConversationItem, type ConversationItemList, type ItemCreateParams, type ItemRetrieveParams, type ItemListParams, type ItemDeleteParams, type ConversationItemsPage, } from "./items.mjs";
//# sourceMappingURL=index.d.mts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/conversations/index.ts"],"names":[],"mappings":"AAEA,oCAAgC;AAChC,OAAO,EACL,KAAK,EACL,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,GAC3B,oBAAgB"}
+3
View File
@@ -0,0 +1,3 @@
export * from "./conversations.js";
export { Items, type ConversationItem, type ConversationItemList, type ItemCreateParams, type ItemRetrieveParams, type ItemListParams, type ItemDeleteParams, type ConversationItemsPage, } from "./items.js";
//# sourceMappingURL=index.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/conversations/index.ts"],"names":[],"mappings":"AAEA,mCAAgC;AAChC,OAAO,EACL,KAAK,EACL,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,GAC3B,mBAAgB"}
+9
View File
@@ -0,0 +1,9 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Items = void 0;
const tslib_1 = require("../../internal/tslib.js");
tslib_1.__exportStar(require("./conversations.js"), exports);
var items_1 = require("./items.js");
Object.defineProperty(exports, "Items", { enumerable: true, get: function () { return items_1.Items; } });
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/conversations/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,6DAAgC;AAChC,oCASiB;AARf,8FAAA,KAAK,OAAA"}
+4
View File
@@ -0,0 +1,4 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export * from "./conversations.mjs";
export { Items, } from "./items.mjs";
//# sourceMappingURL=index.mjs.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/conversations/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,oCAAgC;AAChC,OAAO,EACL,KAAK,GAQN,oBAAgB"}
+388
View File
@@ -0,0 +1,388 @@
import { APIResource } from "../../core/resource.mjs";
import * as ConversationsAPI from "./conversations.mjs";
import * as ResponsesAPI from "../responses/responses.mjs";
import { APIPromise } from "../../core/api-promise.mjs";
import { ConversationCursorPage, type ConversationCursorPageParams, PagePromise } from "../../core/pagination.mjs";
import { RequestOptions } from "../../internal/request-options.mjs";
/**
* Manage conversations and conversation items.
*/
export declare class Items extends APIResource {
/**
* Create items in a conversation with the given ID.
*/
create(conversationID: string, params: ItemCreateParams, options?: RequestOptions): APIPromise<ConversationItemList>;
/**
* Get a single item from a conversation with the given IDs.
*/
retrieve(itemID: string, params: ItemRetrieveParams, options?: RequestOptions): APIPromise<ConversationItem>;
/**
* List all items for a conversation with the given ID.
*/
list(conversationID: string, query?: ItemListParams | null | undefined, options?: RequestOptions): PagePromise<ConversationItemsPage, ConversationItem>;
/**
* Delete an item from a conversation with the given IDs.
*/
delete(itemID: string, params: ItemDeleteParams, options?: RequestOptions): APIPromise<ConversationsAPI.Conversation>;
}
export type ConversationItemsPage = ConversationCursorPage<ConversationItem>;
/**
* A single item within a conversation. The set of possible types are the same as
* the `output` type of a
* [Response object](https://platform.openai.com/docs/api-reference/responses/object#responses/object-output).
*/
export type ConversationItem = ConversationsAPI.Message | ResponsesAPI.ResponseFunctionToolCallItem | ResponsesAPI.ResponseFunctionToolCallOutputItem | ResponsesAPI.ResponseFileSearchToolCall | ResponsesAPI.ResponseFunctionWebSearch | ConversationItem.ImageGenerationCall | ResponsesAPI.ResponseComputerToolCall | ResponsesAPI.ResponseComputerToolCallOutputItem | ResponsesAPI.ResponseToolSearchCall | ResponsesAPI.ResponseToolSearchOutputItem | ConversationItem.AdditionalTools | ResponsesAPI.ResponseReasoningItem | ResponsesAPI.ResponseCompactionItem | ResponsesAPI.ResponseCodeInterpreterToolCall | ConversationItem.LocalShellCall | ConversationItem.LocalShellCallOutput | ResponsesAPI.ResponseFunctionShellToolCall | ResponsesAPI.ResponseFunctionShellToolCallOutput | ResponsesAPI.ResponseApplyPatchToolCall | ResponsesAPI.ResponseApplyPatchToolCallOutput | ConversationItem.McpListTools | ConversationItem.McpApprovalRequest | ConversationItem.McpApprovalResponse | ConversationItem.McpCall | ResponsesAPI.ResponseCustomToolCall | ResponsesAPI.ResponseCustomToolCallOutput;
export declare namespace ConversationItem {
/**
* An image generation request made by the model.
*/
interface ImageGenerationCall {
/**
* The unique ID of the image generation call.
*/
id: string;
/**
* The generated image encoded in base64.
*/
result: string | null;
/**
* The status of the image generation call.
*/
status: 'in_progress' | 'completed' | 'generating' | 'failed';
/**
* The type of the image generation call. Always `image_generation_call`.
*/
type: 'image_generation_call';
}
interface AdditionalTools {
/**
* The unique ID of the additional tools item.
*/
id: string;
/**
* The role that provided the additional tools.
*/
role: 'unknown' | 'user' | 'assistant' | 'system' | 'critic' | 'discriminator' | 'developer' | 'tool';
/**
* The additional tool definitions made available at this item.
*/
tools: Array<ResponsesAPI.Tool>;
/**
* The type of the item. Always `additional_tools`.
*/
type: 'additional_tools';
}
/**
* A tool call to run a command on the local shell.
*/
interface LocalShellCall {
/**
* The unique ID of the local shell call.
*/
id: string;
/**
* Execute a shell command on the server.
*/
action: LocalShellCall.Action;
/**
* The unique ID of the local shell tool call generated by the model.
*/
call_id: string;
/**
* The status of the local shell call.
*/
status: 'in_progress' | 'completed' | 'incomplete';
/**
* The type of the local shell call. Always `local_shell_call`.
*/
type: 'local_shell_call';
}
namespace LocalShellCall {
/**
* Execute a shell command on the server.
*/
interface Action {
/**
* The command to run.
*/
command: Array<string>;
/**
* Environment variables to set for the command.
*/
env: {
[key: string]: string;
};
/**
* The type of the local shell action. Always `exec`.
*/
type: 'exec';
/**
* Optional timeout in milliseconds for the command.
*/
timeout_ms?: number | null;
/**
* Optional user to run the command as.
*/
user?: string | null;
/**
* Optional working directory to run the command in.
*/
working_directory?: string | null;
}
}
/**
* The output of a local shell tool call.
*/
interface LocalShellCallOutput {
/**
* The unique ID of the local shell tool call generated by the model.
*/
id: string;
/**
* A JSON string of the output of the local shell tool call.
*/
output: string;
/**
* The type of the local shell tool call output. Always `local_shell_call_output`.
*/
type: 'local_shell_call_output';
/**
* The status of the item. One of `in_progress`, `completed`, or `incomplete`.
*/
status?: 'in_progress' | 'completed' | 'incomplete' | null;
}
/**
* A list of tools available on an MCP server.
*/
interface McpListTools {
/**
* The unique ID of the list.
*/
id: string;
/**
* The label of the MCP server.
*/
server_label: string;
/**
* The tools available on the server.
*/
tools: Array<McpListTools.Tool>;
/**
* The type of the item. Always `mcp_list_tools`.
*/
type: 'mcp_list_tools';
/**
* Error message if the server could not list tools.
*/
error?: string | null;
}
namespace McpListTools {
/**
* A tool available on an MCP server.
*/
interface Tool {
/**
* The JSON schema describing the tool's input.
*/
input_schema: unknown;
/**
* The name of the tool.
*/
name: string;
/**
* Additional annotations about the tool.
*/
annotations?: unknown | null;
/**
* The description of the tool.
*/
description?: string | null;
}
}
/**
* A request for human approval of a tool invocation.
*/
interface McpApprovalRequest {
/**
* The unique ID of the approval request.
*/
id: string;
/**
* A JSON string of arguments for the tool.
*/
arguments: string;
/**
* The name of the tool to run.
*/
name: string;
/**
* The label of the MCP server making the request.
*/
server_label: string;
/**
* The type of the item. Always `mcp_approval_request`.
*/
type: 'mcp_approval_request';
}
/**
* A response to an MCP approval request.
*/
interface McpApprovalResponse {
/**
* The unique ID of the approval response
*/
id: string;
/**
* The ID of the approval request being answered.
*/
approval_request_id: string;
/**
* Whether the request was approved.
*/
approve: boolean;
/**
* The type of the item. Always `mcp_approval_response`.
*/
type: 'mcp_approval_response';
/**
* Optional reason for the decision.
*/
reason?: string | null;
}
/**
* An invocation of a tool on an MCP server.
*/
interface McpCall {
/**
* The unique ID of the tool call.
*/
id: string;
/**
* A JSON string of the arguments passed to the tool.
*/
arguments: string;
/**
* The name of the tool that was run.
*/
name: string;
/**
* The label of the MCP server running the tool.
*/
server_label: string;
/**
* The type of the item. Always `mcp_call`.
*/
type: 'mcp_call';
/**
* Unique identifier for the MCP tool call approval request. Include this value in
* a subsequent `mcp_approval_response` input to approve or reject the
* corresponding tool call.
*/
approval_request_id?: string | null;
/**
* The error from the tool call, if any.
*/
error?: string | null;
/**
* The output from the tool call.
*/
output?: string | null;
/**
* The status of the tool call. One of `in_progress`, `completed`, `incomplete`,
* `calling`, or `failed`.
*/
status?: 'in_progress' | 'completed' | 'incomplete' | 'calling' | 'failed';
}
}
/**
* A list of Conversation items.
*/
export interface ConversationItemList {
/**
* A list of conversation items.
*/
data: Array<ConversationItem>;
/**
* The ID of the first item in the list.
*/
first_id: string;
/**
* Whether there are more items available.
*/
has_more: boolean;
/**
* The ID of the last item in the list.
*/
last_id: string;
/**
* The type of object returned, must be `list`.
*/
object: 'list';
}
export interface ItemCreateParams {
/**
* Body param: The items to add to the conversation. You may add up to 20 items at
* a time.
*/
items: Array<ResponsesAPI.ResponseInputItem>;
/**
* Query param: Additional fields to include in the response. See the `include`
* parameter for
* [listing Conversation items above](https://platform.openai.com/docs/api-reference/conversations/list-items#conversations_list_items-include)
* for more information.
*/
include?: Array<ResponsesAPI.ResponseIncludable>;
}
export interface ItemRetrieveParams {
/**
* Path param: The ID of the conversation that contains the item.
*/
conversation_id: string;
/**
* Query param: Additional fields to include in the response. See the `include`
* parameter for
* [listing Conversation items above](https://platform.openai.com/docs/api-reference/conversations/list-items#conversations_list_items-include)
* for more information.
*/
include?: Array<ResponsesAPI.ResponseIncludable>;
}
export interface ItemListParams extends ConversationCursorPageParams {
/**
* Specify additional output data to include in the model response. Currently
* supported values are:
*
* - `web_search_call.action.sources`: Include the sources of the web search tool
* call.
* - `code_interpreter_call.outputs`: Includes the outputs of python code execution
* in code interpreter tool call items.
* - `computer_call_output.output.image_url`: Include image urls from the computer
* call output.
* - `file_search_call.results`: Include the search results of the file search tool
* call.
* - `message.input_image.image_url`: Include image urls from the input message.
* - `message.output_text.logprobs`: Include logprobs with assistant messages.
* - `reasoning.encrypted_content`: Includes an encrypted version of reasoning
* tokens in reasoning item outputs. This enables reasoning items to be used in
* multi-turn conversations when using the Responses API statelessly (like when
* the `store` parameter is set to `false`, or when an organization is enrolled
* in the zero data retention program).
*/
include?: Array<ResponsesAPI.ResponseIncludable>;
/**
* The order to return the input items in. Default is `desc`.
*
* - `asc`: Return the input items in ascending order.
* - `desc`: Return the input items in descending order.
*/
order?: 'asc' | 'desc';
}
export interface ItemDeleteParams {
/**
* The ID of the conversation that contains the item.
*/
conversation_id: string;
}
export declare namespace Items {
export { type ConversationItem as ConversationItem, type ConversationItemList as ConversationItemList, type ConversationItemsPage as ConversationItemsPage, type ItemCreateParams as ItemCreateParams, type ItemRetrieveParams as ItemRetrieveParams, type ItemListParams as ItemListParams, type ItemDeleteParams as ItemDeleteParams, };
}
//# sourceMappingURL=items.d.mts.map
File diff suppressed because one or more lines are too long
+388
View File
@@ -0,0 +1,388 @@
import { APIResource } from "../../core/resource.js";
import * as ConversationsAPI from "./conversations.js";
import * as ResponsesAPI from "../responses/responses.js";
import { APIPromise } from "../../core/api-promise.js";
import { ConversationCursorPage, type ConversationCursorPageParams, PagePromise } from "../../core/pagination.js";
import { RequestOptions } from "../../internal/request-options.js";
/**
* Manage conversations and conversation items.
*/
export declare class Items extends APIResource {
/**
* Create items in a conversation with the given ID.
*/
create(conversationID: string, params: ItemCreateParams, options?: RequestOptions): APIPromise<ConversationItemList>;
/**
* Get a single item from a conversation with the given IDs.
*/
retrieve(itemID: string, params: ItemRetrieveParams, options?: RequestOptions): APIPromise<ConversationItem>;
/**
* List all items for a conversation with the given ID.
*/
list(conversationID: string, query?: ItemListParams | null | undefined, options?: RequestOptions): PagePromise<ConversationItemsPage, ConversationItem>;
/**
* Delete an item from a conversation with the given IDs.
*/
delete(itemID: string, params: ItemDeleteParams, options?: RequestOptions): APIPromise<ConversationsAPI.Conversation>;
}
export type ConversationItemsPage = ConversationCursorPage<ConversationItem>;
/**
* A single item within a conversation. The set of possible types are the same as
* the `output` type of a
* [Response object](https://platform.openai.com/docs/api-reference/responses/object#responses/object-output).
*/
export type ConversationItem = ConversationsAPI.Message | ResponsesAPI.ResponseFunctionToolCallItem | ResponsesAPI.ResponseFunctionToolCallOutputItem | ResponsesAPI.ResponseFileSearchToolCall | ResponsesAPI.ResponseFunctionWebSearch | ConversationItem.ImageGenerationCall | ResponsesAPI.ResponseComputerToolCall | ResponsesAPI.ResponseComputerToolCallOutputItem | ResponsesAPI.ResponseToolSearchCall | ResponsesAPI.ResponseToolSearchOutputItem | ConversationItem.AdditionalTools | ResponsesAPI.ResponseReasoningItem | ResponsesAPI.ResponseCompactionItem | ResponsesAPI.ResponseCodeInterpreterToolCall | ConversationItem.LocalShellCall | ConversationItem.LocalShellCallOutput | ResponsesAPI.ResponseFunctionShellToolCall | ResponsesAPI.ResponseFunctionShellToolCallOutput | ResponsesAPI.ResponseApplyPatchToolCall | ResponsesAPI.ResponseApplyPatchToolCallOutput | ConversationItem.McpListTools | ConversationItem.McpApprovalRequest | ConversationItem.McpApprovalResponse | ConversationItem.McpCall | ResponsesAPI.ResponseCustomToolCall | ResponsesAPI.ResponseCustomToolCallOutput;
export declare namespace ConversationItem {
/**
* An image generation request made by the model.
*/
interface ImageGenerationCall {
/**
* The unique ID of the image generation call.
*/
id: string;
/**
* The generated image encoded in base64.
*/
result: string | null;
/**
* The status of the image generation call.
*/
status: 'in_progress' | 'completed' | 'generating' | 'failed';
/**
* The type of the image generation call. Always `image_generation_call`.
*/
type: 'image_generation_call';
}
interface AdditionalTools {
/**
* The unique ID of the additional tools item.
*/
id: string;
/**
* The role that provided the additional tools.
*/
role: 'unknown' | 'user' | 'assistant' | 'system' | 'critic' | 'discriminator' | 'developer' | 'tool';
/**
* The additional tool definitions made available at this item.
*/
tools: Array<ResponsesAPI.Tool>;
/**
* The type of the item. Always `additional_tools`.
*/
type: 'additional_tools';
}
/**
* A tool call to run a command on the local shell.
*/
interface LocalShellCall {
/**
* The unique ID of the local shell call.
*/
id: string;
/**
* Execute a shell command on the server.
*/
action: LocalShellCall.Action;
/**
* The unique ID of the local shell tool call generated by the model.
*/
call_id: string;
/**
* The status of the local shell call.
*/
status: 'in_progress' | 'completed' | 'incomplete';
/**
* The type of the local shell call. Always `local_shell_call`.
*/
type: 'local_shell_call';
}
namespace LocalShellCall {
/**
* Execute a shell command on the server.
*/
interface Action {
/**
* The command to run.
*/
command: Array<string>;
/**
* Environment variables to set for the command.
*/
env: {
[key: string]: string;
};
/**
* The type of the local shell action. Always `exec`.
*/
type: 'exec';
/**
* Optional timeout in milliseconds for the command.
*/
timeout_ms?: number | null;
/**
* Optional user to run the command as.
*/
user?: string | null;
/**
* Optional working directory to run the command in.
*/
working_directory?: string | null;
}
}
/**
* The output of a local shell tool call.
*/
interface LocalShellCallOutput {
/**
* The unique ID of the local shell tool call generated by the model.
*/
id: string;
/**
* A JSON string of the output of the local shell tool call.
*/
output: string;
/**
* The type of the local shell tool call output. Always `local_shell_call_output`.
*/
type: 'local_shell_call_output';
/**
* The status of the item. One of `in_progress`, `completed`, or `incomplete`.
*/
status?: 'in_progress' | 'completed' | 'incomplete' | null;
}
/**
* A list of tools available on an MCP server.
*/
interface McpListTools {
/**
* The unique ID of the list.
*/
id: string;
/**
* The label of the MCP server.
*/
server_label: string;
/**
* The tools available on the server.
*/
tools: Array<McpListTools.Tool>;
/**
* The type of the item. Always `mcp_list_tools`.
*/
type: 'mcp_list_tools';
/**
* Error message if the server could not list tools.
*/
error?: string | null;
}
namespace McpListTools {
/**
* A tool available on an MCP server.
*/
interface Tool {
/**
* The JSON schema describing the tool's input.
*/
input_schema: unknown;
/**
* The name of the tool.
*/
name: string;
/**
* Additional annotations about the tool.
*/
annotations?: unknown | null;
/**
* The description of the tool.
*/
description?: string | null;
}
}
/**
* A request for human approval of a tool invocation.
*/
interface McpApprovalRequest {
/**
* The unique ID of the approval request.
*/
id: string;
/**
* A JSON string of arguments for the tool.
*/
arguments: string;
/**
* The name of the tool to run.
*/
name: string;
/**
* The label of the MCP server making the request.
*/
server_label: string;
/**
* The type of the item. Always `mcp_approval_request`.
*/
type: 'mcp_approval_request';
}
/**
* A response to an MCP approval request.
*/
interface McpApprovalResponse {
/**
* The unique ID of the approval response
*/
id: string;
/**
* The ID of the approval request being answered.
*/
approval_request_id: string;
/**
* Whether the request was approved.
*/
approve: boolean;
/**
* The type of the item. Always `mcp_approval_response`.
*/
type: 'mcp_approval_response';
/**
* Optional reason for the decision.
*/
reason?: string | null;
}
/**
* An invocation of a tool on an MCP server.
*/
interface McpCall {
/**
* The unique ID of the tool call.
*/
id: string;
/**
* A JSON string of the arguments passed to the tool.
*/
arguments: string;
/**
* The name of the tool that was run.
*/
name: string;
/**
* The label of the MCP server running the tool.
*/
server_label: string;
/**
* The type of the item. Always `mcp_call`.
*/
type: 'mcp_call';
/**
* Unique identifier for the MCP tool call approval request. Include this value in
* a subsequent `mcp_approval_response` input to approve or reject the
* corresponding tool call.
*/
approval_request_id?: string | null;
/**
* The error from the tool call, if any.
*/
error?: string | null;
/**
* The output from the tool call.
*/
output?: string | null;
/**
* The status of the tool call. One of `in_progress`, `completed`, `incomplete`,
* `calling`, or `failed`.
*/
status?: 'in_progress' | 'completed' | 'incomplete' | 'calling' | 'failed';
}
}
/**
* A list of Conversation items.
*/
export interface ConversationItemList {
/**
* A list of conversation items.
*/
data: Array<ConversationItem>;
/**
* The ID of the first item in the list.
*/
first_id: string;
/**
* Whether there are more items available.
*/
has_more: boolean;
/**
* The ID of the last item in the list.
*/
last_id: string;
/**
* The type of object returned, must be `list`.
*/
object: 'list';
}
export interface ItemCreateParams {
/**
* Body param: The items to add to the conversation. You may add up to 20 items at
* a time.
*/
items: Array<ResponsesAPI.ResponseInputItem>;
/**
* Query param: Additional fields to include in the response. See the `include`
* parameter for
* [listing Conversation items above](https://platform.openai.com/docs/api-reference/conversations/list-items#conversations_list_items-include)
* for more information.
*/
include?: Array<ResponsesAPI.ResponseIncludable>;
}
export interface ItemRetrieveParams {
/**
* Path param: The ID of the conversation that contains the item.
*/
conversation_id: string;
/**
* Query param: Additional fields to include in the response. See the `include`
* parameter for
* [listing Conversation items above](https://platform.openai.com/docs/api-reference/conversations/list-items#conversations_list_items-include)
* for more information.
*/
include?: Array<ResponsesAPI.ResponseIncludable>;
}
export interface ItemListParams extends ConversationCursorPageParams {
/**
* Specify additional output data to include in the model response. Currently
* supported values are:
*
* - `web_search_call.action.sources`: Include the sources of the web search tool
* call.
* - `code_interpreter_call.outputs`: Includes the outputs of python code execution
* in code interpreter tool call items.
* - `computer_call_output.output.image_url`: Include image urls from the computer
* call output.
* - `file_search_call.results`: Include the search results of the file search tool
* call.
* - `message.input_image.image_url`: Include image urls from the input message.
* - `message.output_text.logprobs`: Include logprobs with assistant messages.
* - `reasoning.encrypted_content`: Includes an encrypted version of reasoning
* tokens in reasoning item outputs. This enables reasoning items to be used in
* multi-turn conversations when using the Responses API statelessly (like when
* the `store` parameter is set to `false`, or when an organization is enrolled
* in the zero data retention program).
*/
include?: Array<ResponsesAPI.ResponseIncludable>;
/**
* The order to return the input items in. Default is `desc`.
*
* - `asc`: Return the input items in ascending order.
* - `desc`: Return the input items in descending order.
*/
order?: 'asc' | 'desc';
}
export interface ItemDeleteParams {
/**
* The ID of the conversation that contains the item.
*/
conversation_id: string;
}
export declare namespace Items {
export { type ConversationItem as ConversationItem, type ConversationItemList as ConversationItemList, type ConversationItemsPage as ConversationItemsPage, type ItemCreateParams as ItemCreateParams, type ItemRetrieveParams as ItemRetrieveParams, type ItemListParams as ItemListParams, type ItemDeleteParams as ItemDeleteParams, };
}
//# sourceMappingURL=items.d.ts.map
File diff suppressed because one or more lines are too long
+53
View File
@@ -0,0 +1,53 @@
"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Items = void 0;
const resource_1 = require("../../core/resource.js");
const pagination_1 = require("../../core/pagination.js");
const path_1 = require("../../internal/utils/path.js");
/**
* Manage conversations and conversation items.
*/
class Items extends resource_1.APIResource {
/**
* Create items in a conversation with the given ID.
*/
create(conversationID, params, options) {
const { include, ...body } = params;
return this._client.post((0, path_1.path) `/conversations/${conversationID}/items`, {
query: { include },
body,
...options,
__security: { bearerAuth: true },
});
}
/**
* Get a single item from a conversation with the given IDs.
*/
retrieve(itemID, params, options) {
const { conversation_id, ...query } = params;
return this._client.get((0, path_1.path) `/conversations/${conversation_id}/items/${itemID}`, {
query,
...options,
__security: { bearerAuth: true },
});
}
/**
* List all items for a conversation with the given ID.
*/
list(conversationID, query = {}, options) {
return this._client.getAPIList((0, path_1.path) `/conversations/${conversationID}/items`, (pagination_1.ConversationCursorPage), { query, ...options, __security: { bearerAuth: true } });
}
/**
* Delete an item from a conversation with the given IDs.
*/
delete(itemID, params, options) {
const { conversation_id } = params;
return this._client.delete((0, path_1.path) `/conversations/${conversation_id}/items/${itemID}`, {
...options,
__security: { bearerAuth: true },
});
}
}
exports.Items = Items;
//# sourceMappingURL=items.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"items.js","sourceRoot":"","sources":["../../src/resources/conversations/items.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAIlD,yDAI+B;AAE/B,uDAAiD;AAEjD;;GAEG;AACH,MAAa,KAAM,SAAQ,sBAAW;IACpC;;OAEG;IACH,MAAM,CACJ,cAAsB,EACtB,MAAwB,EACxB,OAAwB;QAExB,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,kBAAkB,cAAc,QAAQ,EAAE;YACrE,KAAK,EAAE,EAAE,OAAO,EAAE;YAClB,IAAI;YACJ,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;SACjC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,QAAQ,CACN,MAAc,EACd,MAA0B,EAC1B,OAAwB;QAExB,MAAM,EAAE,eAAe,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,kBAAkB,eAAe,UAAU,MAAM,EAAE,EAAE;YAC/E,KAAK;YACL,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;SACjC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,IAAI,CACF,cAAsB,EACtB,QAA2C,EAAE,EAC7C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAA,WAAI,EAAA,kBAAkB,cAAc,QAAQ,EAC5C,CAAA,mCAAwC,CAAA,EACxC,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CACxD,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,MAAM,CACJ,MAAc,EACd,MAAwB,EACxB,OAAwB;QAExB,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,CAAC;QACnC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,kBAAkB,eAAe,UAAU,MAAM,EAAE,EAAE;YAClF,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;SACjC,CAAC,CAAC;IACL,CAAC;CACF;AA/DD,sBA+DC"}
+49
View File
@@ -0,0 +1,49 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../core/resource.mjs";
import { ConversationCursorPage, } from "../../core/pagination.mjs";
import { path } from "../../internal/utils/path.mjs";
/**
* Manage conversations and conversation items.
*/
export class Items extends APIResource {
/**
* Create items in a conversation with the given ID.
*/
create(conversationID, params, options) {
const { include, ...body } = params;
return this._client.post(path `/conversations/${conversationID}/items`, {
query: { include },
body,
...options,
__security: { bearerAuth: true },
});
}
/**
* Get a single item from a conversation with the given IDs.
*/
retrieve(itemID, params, options) {
const { conversation_id, ...query } = params;
return this._client.get(path `/conversations/${conversation_id}/items/${itemID}`, {
query,
...options,
__security: { bearerAuth: true },
});
}
/**
* List all items for a conversation with the given ID.
*/
list(conversationID, query = {}, options) {
return this._client.getAPIList(path `/conversations/${conversationID}/items`, (ConversationCursorPage), { query, ...options, __security: { bearerAuth: true } });
}
/**
* Delete an item from a conversation with the given IDs.
*/
delete(itemID, params, options) {
const { conversation_id } = params;
return this._client.delete(path `/conversations/${conversation_id}/items/${itemID}`, {
...options,
__security: { bearerAuth: true },
});
}
}
//# sourceMappingURL=items.mjs.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"items.mjs","sourceRoot":"","sources":["../../src/resources/conversations/items.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAIlD,OAAO,EACL,sBAAsB,GAGvB,kCAA8B;AAE/B,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;OAEG;IACH,MAAM,CACJ,cAAsB,EACtB,MAAwB,EACxB,OAAwB;QAExB,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,kBAAkB,cAAc,QAAQ,EAAE;YACrE,KAAK,EAAE,EAAE,OAAO,EAAE;YAClB,IAAI;YACJ,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,UAAU,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