@inconvoai/node 0.3.0 → 0.4.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 +18 -0
- package/README.md +37 -22
- package/client.d.mts +2 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -2
- package/client.d.ts.map +1 -1
- package/client.js +1 -1
- package/client.js.map +1 -1
- package/client.mjs +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/conversations/conversations.d.mts +40 -2
- package/resources/conversations/conversations.d.mts.map +1 -1
- package/resources/conversations/conversations.d.ts +40 -2
- package/resources/conversations/conversations.d.ts.map +1 -1
- package/resources/conversations/conversations.js +21 -0
- package/resources/conversations/conversations.js.map +1 -1
- package/resources/conversations/conversations.mjs +21 -0
- package/resources/conversations/conversations.mjs.map +1 -1
- package/resources/conversations/response/feedback.d.mts +18 -0
- package/resources/conversations/response/feedback.d.mts.map +1 -1
- package/resources/conversations/response/feedback.d.ts +18 -0
- package/resources/conversations/response/feedback.d.ts.map +1 -1
- package/resources/conversations/response/feedback.js +18 -0
- package/resources/conversations/response/feedback.js.map +1 -1
- package/resources/conversations/response/feedback.mjs +18 -0
- package/resources/conversations/response/feedback.mjs.map +1 -1
- package/resources/conversations/response/response.d.mts +17 -0
- package/resources/conversations/response/response.d.mts.map +1 -1
- package/resources/conversations/response/response.d.ts +17 -0
- package/resources/conversations/response/response.d.ts.map +1 -1
- package/resources/conversations/response/response.js +9 -0
- package/resources/conversations/response/response.js.map +1 -1
- package/resources/conversations/response/response.mjs +9 -0
- package/resources/conversations/response/response.mjs.map +1 -1
- package/resources/datasets/context.d.mts +100 -0
- package/resources/datasets/context.d.mts.map +1 -0
- package/resources/datasets/context.d.ts +100 -0
- package/resources/datasets/context.d.ts.map +1 -0
- package/resources/datasets/context.js +61 -0
- package/resources/datasets/context.js.map +1 -0
- package/resources/datasets/context.mjs +57 -0
- package/resources/datasets/context.mjs.map +1 -0
- package/resources/datasets/datasets.d.mts +14 -0
- package/resources/datasets/datasets.d.mts.map +1 -0
- package/resources/datasets/datasets.d.ts +14 -0
- package/resources/datasets/datasets.d.ts.map +1 -0
- package/resources/datasets/datasets.js +21 -0
- package/resources/datasets/datasets.js.map +1 -0
- package/resources/datasets/datasets.mjs +16 -0
- package/resources/datasets/datasets.mjs.map +1 -0
- package/resources/datasets/index.d.mts +4 -0
- package/resources/datasets/index.d.mts.map +1 -0
- package/resources/datasets/index.d.ts +4 -0
- package/resources/datasets/index.d.ts.map +1 -0
- package/resources/datasets/index.js +11 -0
- package/resources/datasets/index.js.map +1 -0
- package/resources/datasets/index.mjs +5 -0
- package/resources/datasets/index.mjs.map +1 -0
- package/resources/datasets/user.d.mts +77 -0
- package/resources/datasets/user.d.mts.map +1 -0
- package/resources/datasets/user.d.ts +77 -0
- package/resources/datasets/user.d.ts.map +1 -0
- package/resources/datasets/user.js +50 -0
- package/resources/datasets/user.js.map +1 -0
- package/resources/datasets/user.mjs +46 -0
- package/resources/datasets/user.mjs.map +1 -0
- package/resources/datasets.d.mts +1 -66
- package/resources/datasets.d.mts.map +1 -1
- package/resources/datasets.d.ts +1 -66
- package/resources/datasets.d.ts.map +1 -1
- package/resources/datasets.js +2 -26
- package/resources/datasets.js.map +1 -1
- package/resources/datasets.mjs +1 -24
- package/resources/datasets.mjs.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/src/client.ts +2 -18
- package/src/resources/conversations/conversations.ts +44 -2
- package/src/resources/conversations/response/feedback.ts +18 -0
- package/src/resources/conversations/response/response.ts +17 -0
- package/src/resources/datasets/context.ts +153 -0
- package/src/resources/datasets/datasets.ts +51 -0
- package/src/resources/datasets/index.ts +20 -0
- package/src/resources/datasets/user.ts +120 -0
- package/src/resources/datasets.ts +1 -100
- package/src/resources/index.ts +1 -9
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/resources/datasets.d.ts
CHANGED
|
@@ -1,67 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { APIPromise } from "../core/api-promise.js";
|
|
3
|
-
import { type Uploadable } from "../core/uploads.js";
|
|
4
|
-
import { RequestOptions } from "../internal/request-options.js";
|
|
5
|
-
export declare class Datasets extends APIResource {
|
|
6
|
-
/**
|
|
7
|
-
* List dataset files
|
|
8
|
-
*/
|
|
9
|
-
list(query: DatasetListParams, options?: RequestOptions): APIPromise<DatasetListResponse>;
|
|
10
|
-
/**
|
|
11
|
-
* Delete dataset file
|
|
12
|
-
*/
|
|
13
|
-
delete(filename: string, params: DatasetDeleteParams, options?: RequestOptions): APIPromise<DatasetDeleteResponse>;
|
|
14
|
-
/**
|
|
15
|
-
* Upload dataset file
|
|
16
|
-
*/
|
|
17
|
-
upload(body: DatasetUploadParams, options?: RequestOptions): APIPromise<DatasetUploadResponse>;
|
|
18
|
-
}
|
|
19
|
-
export interface DatasetListResponse {
|
|
20
|
-
files: Array<string>;
|
|
21
|
-
}
|
|
22
|
-
export interface DatasetDeleteResponse {
|
|
23
|
-
file: string;
|
|
24
|
-
success: boolean;
|
|
25
|
-
error?: string;
|
|
26
|
-
}
|
|
27
|
-
export interface DatasetUploadResponse {
|
|
28
|
-
file: DatasetUploadResponse.File;
|
|
29
|
-
error?: string;
|
|
30
|
-
}
|
|
31
|
-
export declare namespace DatasetUploadResponse {
|
|
32
|
-
interface File {
|
|
33
|
-
name: string;
|
|
34
|
-
path: string;
|
|
35
|
-
size: number;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
export interface DatasetListParams {
|
|
39
|
-
userContext: {
|
|
40
|
-
[key: string]: string | number;
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
export interface DatasetDeleteParams {
|
|
44
|
-
userContext: {
|
|
45
|
-
[key: string]: string | number;
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
export interface DatasetUploadParams {
|
|
49
|
-
/**
|
|
50
|
-
* The file to upload
|
|
51
|
-
*/
|
|
52
|
-
file: Uploadable;
|
|
53
|
-
/**
|
|
54
|
-
* Request context for scoping the file, as a JSON-encoded string. Pass your
|
|
55
|
-
* context object through JSON.stringify() before sending. Example:
|
|
56
|
-
* JSON.stringify({ userId: 123, orgId: 456 })
|
|
57
|
-
*/
|
|
58
|
-
userContext: string;
|
|
59
|
-
/**
|
|
60
|
-
* Optional notes or description for the dataset
|
|
61
|
-
*/
|
|
62
|
-
notes?: string;
|
|
63
|
-
}
|
|
64
|
-
export declare namespace Datasets {
|
|
65
|
-
export { type DatasetListResponse as DatasetListResponse, type DatasetDeleteResponse as DatasetDeleteResponse, type DatasetUploadResponse as DatasetUploadResponse, type DatasetListParams as DatasetListParams, type DatasetDeleteParams as DatasetDeleteParams, type DatasetUploadParams as DatasetUploadParams, };
|
|
66
|
-
}
|
|
1
|
+
export * from "./datasets/index.js";
|
|
67
2
|
//# sourceMappingURL=datasets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datasets.d.ts","sourceRoot":"","sources":["../src/resources/datasets.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"datasets.d.ts","sourceRoot":"","sources":["../src/resources/datasets.ts"],"names":[],"mappings":""}
|
package/resources/datasets.js
CHANGED
|
@@ -1,30 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const uploads_1 = require("../internal/uploads.js");
|
|
7
|
-
const path_1 = require("../internal/utils/path.js");
|
|
8
|
-
class Datasets extends resource_1.APIResource {
|
|
9
|
-
/**
|
|
10
|
-
* List dataset files
|
|
11
|
-
*/
|
|
12
|
-
list(query, options) {
|
|
13
|
-
return this._client.get('/datasets', { query, ...options });
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Delete dataset file
|
|
17
|
-
*/
|
|
18
|
-
delete(filename, params, options) {
|
|
19
|
-
const { userContext } = params;
|
|
20
|
-
return this._client.delete((0, path_1.path) `/datasets/${filename}`, { query: { userContext }, ...options });
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Upload dataset file
|
|
24
|
-
*/
|
|
25
|
-
upload(body, options) {
|
|
26
|
-
return this._client.post('/datasets', (0, uploads_1.multipartFormRequestOptions)({ body, ...options }, this._client));
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.Datasets = Datasets;
|
|
4
|
+
const tslib_1 = require("../internal/tslib.js");
|
|
5
|
+
tslib_1.__exportStar(require("./datasets/index.js"), exports);
|
|
30
6
|
//# sourceMappingURL=datasets.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datasets.js","sourceRoot":"","sources":["../src/resources/datasets.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"datasets.js","sourceRoot":"","sources":["../src/resources/datasets.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,8DAAiC"}
|
package/resources/datasets.mjs
CHANGED
|
@@ -1,26 +1,3 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { multipartFormRequestOptions } from "../internal/uploads.mjs";
|
|
4
|
-
import { path } from "../internal/utils/path.mjs";
|
|
5
|
-
export class Datasets extends APIResource {
|
|
6
|
-
/**
|
|
7
|
-
* List dataset files
|
|
8
|
-
*/
|
|
9
|
-
list(query, options) {
|
|
10
|
-
return this._client.get('/datasets', { query, ...options });
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Delete dataset file
|
|
14
|
-
*/
|
|
15
|
-
delete(filename, params, options) {
|
|
16
|
-
const { userContext } = params;
|
|
17
|
-
return this._client.delete(path `/datasets/${filename}`, { query: { userContext }, ...options });
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Upload dataset file
|
|
21
|
-
*/
|
|
22
|
-
upload(body, options) {
|
|
23
|
-
return this._client.post('/datasets', multipartFormRequestOptions({ body, ...options }, this._client));
|
|
24
|
-
}
|
|
25
|
-
}
|
|
2
|
+
export * from "./datasets/index.mjs";
|
|
26
3
|
//# sourceMappingURL=datasets.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datasets.mjs","sourceRoot":"","sources":["../src/resources/datasets.ts"],"names":[],"mappings":"AAAA,sFAAsF
|
|
1
|
+
{"version":3,"file":"datasets.mjs","sourceRoot":"","sources":["../src/resources/datasets.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
|
package/resources/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { Agents } from "./agents/agents.mjs";
|
|
2
2
|
export { Conversations, type InconvoConversation, type ConversationCreateResponse, type ConversationListResponse, type ConversationCreateParams, type ConversationListParams, type ConversationListResponsesConversationsCursor, } from "./conversations/conversations.mjs";
|
|
3
|
-
export { Datasets
|
|
3
|
+
export { Datasets } from "./datasets/datasets.mjs";
|
|
4
4
|
export { McpServers } from "./mcp-servers/mcp-servers.mjs";
|
|
5
5
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EAAE,MAAM,EAAE;OACV,EACL,aAAa,EACb,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,4CAA4C,GAClD;OACM,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EAAE,MAAM,EAAE;OACV,EACL,aAAa,EACb,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,4CAA4C,GAClD;OACM,EAAE,QAAQ,EAAE;OACZ,EAAE,UAAU,EAAE"}
|
package/resources/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { Agents } from "./agents/agents.js";
|
|
2
2
|
export { Conversations, type InconvoConversation, type ConversationCreateResponse, type ConversationListResponse, type ConversationCreateParams, type ConversationListParams, type ConversationListResponsesConversationsCursor, } from "./conversations/conversations.js";
|
|
3
|
-
export { Datasets
|
|
3
|
+
export { Datasets } from "./datasets/datasets.js";
|
|
4
4
|
export { McpServers } from "./mcp-servers/mcp-servers.js";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/resources/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EAAE,MAAM,EAAE;OACV,EACL,aAAa,EACb,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,4CAA4C,GAClD;OACM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EAAE,MAAM,EAAE;OACV,EACL,aAAa,EACb,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,4CAA4C,GAClD;OACM,EAAE,QAAQ,EAAE;OACZ,EAAE,UAAU,EAAE"}
|
package/resources/index.js
CHANGED
|
@@ -6,7 +6,7 @@ var agents_1 = require("./agents/agents.js");
|
|
|
6
6
|
Object.defineProperty(exports, "Agents", { enumerable: true, get: function () { return agents_1.Agents; } });
|
|
7
7
|
var conversations_1 = require("./conversations/conversations.js");
|
|
8
8
|
Object.defineProperty(exports, "Conversations", { enumerable: true, get: function () { return conversations_1.Conversations; } });
|
|
9
|
-
var datasets_1 = require("./datasets.js");
|
|
9
|
+
var datasets_1 = require("./datasets/datasets.js");
|
|
10
10
|
Object.defineProperty(exports, "Datasets", { enumerable: true, get: function () { return datasets_1.Datasets; } });
|
|
11
11
|
var mcp_servers_1 = require("./mcp-servers/mcp-servers.js");
|
|
12
12
|
Object.defineProperty(exports, "McpServers", { enumerable: true, get: function () { return mcp_servers_1.McpServers; } });
|
package/resources/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAAyC;AAAhC,gGAAA,MAAM,OAAA;AACf,kEAQuC;AAPrC,8GAAA,aAAa,OAAA;AAQf,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAAyC;AAAhC,gGAAA,MAAM,OAAA;AACf,kEAQuC;AAPrC,8GAAA,aAAa,OAAA;AAQf,mDAA+C;AAAtC,oGAAA,QAAQ,OAAA;AACjB,4DAAuD;AAA9C,yGAAA,UAAU,OAAA"}
|
package/resources/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
export { Agents } from "./agents/agents.mjs";
|
|
3
3
|
export { Conversations, } from "./conversations/conversations.mjs";
|
|
4
|
-
export { Datasets
|
|
4
|
+
export { Datasets } from "./datasets/datasets.mjs";
|
|
5
5
|
export { McpServers } from "./mcp-servers/mcp-servers.mjs";
|
|
6
6
|
//# sourceMappingURL=index.mjs.map
|
package/resources/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,MAAM,EAAE;OACV,EACL,aAAa,GAOd;OACM,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,MAAM,EAAE;OACV,EACL,aAAa,GAOd;OACM,EAAE,QAAQ,EAAE;OACZ,EAAE,UAAU,EAAE"}
|
package/src/client.ts
CHANGED
|
@@ -19,15 +19,6 @@ import { AbstractPage, type ConversationsCursorParams, ConversationsCursorRespon
|
|
|
19
19
|
import * as Uploads from './core/uploads';
|
|
20
20
|
import * as API from './resources/index';
|
|
21
21
|
import { APIPromise } from './core/api-promise';
|
|
22
|
-
import {
|
|
23
|
-
DatasetDeleteParams,
|
|
24
|
-
DatasetDeleteResponse,
|
|
25
|
-
DatasetListParams,
|
|
26
|
-
DatasetListResponse,
|
|
27
|
-
DatasetUploadParams,
|
|
28
|
-
DatasetUploadResponse,
|
|
29
|
-
Datasets,
|
|
30
|
-
} from './resources/datasets';
|
|
31
22
|
import { Agents } from './resources/agents/agents';
|
|
32
23
|
import {
|
|
33
24
|
ConversationCreateParams,
|
|
@@ -38,6 +29,7 @@ import {
|
|
|
38
29
|
Conversations,
|
|
39
30
|
InconvoConversation,
|
|
40
31
|
} from './resources/conversations/conversations';
|
|
32
|
+
import { Datasets } from './resources/datasets/datasets';
|
|
41
33
|
import { McpServers } from './resources/mcp-servers/mcp-servers';
|
|
42
34
|
import { type Fetch } from './internal/builtin-types';
|
|
43
35
|
import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
|
|
@@ -773,13 +765,5 @@ export declare namespace Inconvo {
|
|
|
773
765
|
|
|
774
766
|
export { Agents as Agents };
|
|
775
767
|
|
|
776
|
-
export {
|
|
777
|
-
Datasets as Datasets,
|
|
778
|
-
type DatasetListResponse as DatasetListResponse,
|
|
779
|
-
type DatasetDeleteResponse as DatasetDeleteResponse,
|
|
780
|
-
type DatasetUploadResponse as DatasetUploadResponse,
|
|
781
|
-
type DatasetListParams as DatasetListParams,
|
|
782
|
-
type DatasetDeleteParams as DatasetDeleteParams,
|
|
783
|
-
type DatasetUploadParams as DatasetUploadParams,
|
|
784
|
-
};
|
|
768
|
+
export { Datasets as Datasets };
|
|
785
769
|
}
|
|
@@ -21,6 +21,13 @@ export class Conversations extends APIResource {
|
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Create conversation
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const conversation = await client.conversations.create({
|
|
28
|
+
* userIdentifier: 'user_123',
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
24
31
|
*/
|
|
25
32
|
create(body: ConversationCreateParams, options?: RequestOptions): APIPromise<ConversationCreateResponse> {
|
|
26
33
|
return this._client.post('/conversations', { body, ...options });
|
|
@@ -28,6 +35,12 @@ export class Conversations extends APIResource {
|
|
|
28
35
|
|
|
29
36
|
/**
|
|
30
37
|
* Retrieve conversation
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const inconvoConversation =
|
|
42
|
+
* await client.conversations.retrieve('id');
|
|
43
|
+
* ```
|
|
31
44
|
*/
|
|
32
45
|
retrieve(id: string, options?: RequestOptions): APIPromise<InconvoConversation> {
|
|
33
46
|
return this._client.get(path`/conversations/${id}`, options);
|
|
@@ -35,6 +48,14 @@ export class Conversations extends APIResource {
|
|
|
35
48
|
|
|
36
49
|
/**
|
|
37
50
|
* List conversations
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* // Automatically fetches more pages as needed.
|
|
55
|
+
* for await (const conversationListResponse of client.conversations.list()) {
|
|
56
|
+
* // ...
|
|
57
|
+
* }
|
|
58
|
+
* ```
|
|
38
59
|
*/
|
|
39
60
|
list(
|
|
40
61
|
query: ConversationListParams | null | undefined = {},
|
|
@@ -55,6 +76,11 @@ export interface InconvoConversation {
|
|
|
55
76
|
messages: Array<InconvoConversation.Message>;
|
|
56
77
|
|
|
57
78
|
userContext: { [key: string]: string | number };
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Unique identifier for the end-user (may be null for legacy conversations)
|
|
82
|
+
*/
|
|
83
|
+
userIdentifier?: string | null;
|
|
58
84
|
}
|
|
59
85
|
|
|
60
86
|
export namespace InconvoConversation {
|
|
@@ -89,13 +115,24 @@ export interface ConversationListResponse {
|
|
|
89
115
|
title: string;
|
|
90
116
|
|
|
91
117
|
userContext: { [key: string]: string | number };
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Unique identifier for the end-user (may be null for legacy conversations)
|
|
121
|
+
*/
|
|
122
|
+
userIdentifier?: string | null;
|
|
92
123
|
}
|
|
93
124
|
|
|
94
125
|
export interface ConversationCreateParams {
|
|
95
126
|
/**
|
|
96
|
-
*
|
|
127
|
+
* Unique identifier for the end-user (1-256 chars). Allowed characters:
|
|
128
|
+
* alphanumeric, underscore, hyphen, colon, period, at symbol.
|
|
97
129
|
*/
|
|
98
|
-
|
|
130
|
+
userIdentifier: string;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Optional context key-values for additional filtering/tenancy.
|
|
134
|
+
*/
|
|
135
|
+
userContext?: { [key: string]: unknown };
|
|
99
136
|
}
|
|
100
137
|
|
|
101
138
|
export interface ConversationListParams extends ConversationsCursorParams {
|
|
@@ -104,6 +141,11 @@ export interface ConversationListParams extends ConversationsCursorParams {
|
|
|
104
141
|
* /conversations?userContext[userId]=42&userContext[orgId]=12
|
|
105
142
|
*/
|
|
106
143
|
userContext?: { [key: string]: string | number };
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Filter by user identifier
|
|
147
|
+
*/
|
|
148
|
+
userIdentifier?: string;
|
|
107
149
|
}
|
|
108
150
|
|
|
109
151
|
Conversations.Response = Response;
|
|
@@ -8,6 +8,15 @@ import { path } from '../../../internal/utils/path';
|
|
|
8
8
|
export class FeedbackResource extends APIResource {
|
|
9
9
|
/**
|
|
10
10
|
* Create feedback
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const feedback =
|
|
15
|
+
* await client.conversations.response.feedback.create(
|
|
16
|
+
* 'response_id',
|
|
17
|
+
* { id: 'id', rating: 'positive' },
|
|
18
|
+
* );
|
|
19
|
+
* ```
|
|
11
20
|
*/
|
|
12
21
|
create(responseID: string, params: FeedbackCreateParams, options?: RequestOptions): APIPromise<Feedback> {
|
|
13
22
|
const { id, ...body } = params;
|
|
@@ -19,6 +28,15 @@ export class FeedbackResource extends APIResource {
|
|
|
19
28
|
|
|
20
29
|
/**
|
|
21
30
|
* Update feedback
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* const feedback =
|
|
35
|
+
* await client.conversations.response.feedback.update(
|
|
36
|
+
* 'feedback_id',
|
|
37
|
+
* { id: 'id', response_id: 'response_id' },
|
|
38
|
+
* );
|
|
39
|
+
* ```
|
|
22
40
|
*/
|
|
23
41
|
update(feedbackID: string, params: FeedbackUpdateParams, options?: RequestOptions): APIPromise<Feedback> {
|
|
24
42
|
const { id, response_id, ...body } = params;
|
|
@@ -14,6 +14,14 @@ export class Response extends APIResource {
|
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Create response (sync or streamed)
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const response = await client.conversations.response.create(
|
|
21
|
+
* 'id',
|
|
22
|
+
* { message: 'message' },
|
|
23
|
+
* );
|
|
24
|
+
* ```
|
|
17
25
|
*/
|
|
18
26
|
create(
|
|
19
27
|
id: string,
|
|
@@ -43,6 +51,15 @@ export class Response extends APIResource {
|
|
|
43
51
|
|
|
44
52
|
/**
|
|
45
53
|
* Get a response
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* const response =
|
|
58
|
+
* await client.conversations.response.retrieve(
|
|
59
|
+
* 'response_id',
|
|
60
|
+
* { conversation_id: 'conversation_id' },
|
|
61
|
+
* );
|
|
62
|
+
* ```
|
|
46
63
|
*/
|
|
47
64
|
retrieve(
|
|
48
65
|
responseID: string,
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { type Uploadable } from '../../core/uploads';
|
|
6
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
7
|
+
import { multipartFormRequestOptions } from '../../internal/uploads';
|
|
8
|
+
import { path } from '../../internal/utils/path';
|
|
9
|
+
|
|
10
|
+
export class Context extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* List all dataset files scoped to a context value. These files are shared with
|
|
13
|
+
* all users who have this context value.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const contexts = await client.datasets.context.list(
|
|
18
|
+
* 'org_456',
|
|
19
|
+
* { contextKey: 'orgId' },
|
|
20
|
+
* );
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
list(
|
|
24
|
+
contextValue: string,
|
|
25
|
+
params: ContextListParams,
|
|
26
|
+
options?: RequestOptions,
|
|
27
|
+
): APIPromise<ContextListResponse> {
|
|
28
|
+
const { contextKey } = params;
|
|
29
|
+
return this._client.get(path`/datasets/context/${contextKey}/${contextValue}`, options);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Delete a dataset file scoped to a context value.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* const context = await client.datasets.context.delete(
|
|
38
|
+
* 'shared_data.csv',
|
|
39
|
+
* { contextKey: 'orgId', contextValue: 'org_456' },
|
|
40
|
+
* );
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
delete(
|
|
44
|
+
filename: string,
|
|
45
|
+
params: ContextDeleteParams,
|
|
46
|
+
options?: RequestOptions,
|
|
47
|
+
): APIPromise<ContextDeleteResponse> {
|
|
48
|
+
const { contextKey, contextValue } = params;
|
|
49
|
+
return this._client.delete(path`/datasets/context/${contextKey}/${contextValue}/${filename}`, options);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Upload a dataset file scoped to a context value. This file will be shared with
|
|
54
|
+
* all users who have this context value.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* const response = await client.datasets.context.upload(
|
|
59
|
+
* 'org_456',
|
|
60
|
+
* {
|
|
61
|
+
* contextKey: 'orgId',
|
|
62
|
+
* file: fs.createReadStream('path/to/file'),
|
|
63
|
+
* },
|
|
64
|
+
* );
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
upload(
|
|
68
|
+
contextValue: string,
|
|
69
|
+
params: ContextUploadParams,
|
|
70
|
+
options?: RequestOptions,
|
|
71
|
+
): APIPromise<ContextUploadResponse> {
|
|
72
|
+
const { contextKey, ...body } = params;
|
|
73
|
+
return this._client.post(
|
|
74
|
+
path`/datasets/context/${contextKey}/${contextValue}`,
|
|
75
|
+
multipartFormRequestOptions({ body, ...options }, this._client),
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface ContextListResponse {
|
|
81
|
+
files: Array<string>;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface ContextDeleteResponse {
|
|
85
|
+
file: string;
|
|
86
|
+
|
|
87
|
+
success: boolean;
|
|
88
|
+
|
|
89
|
+
error?: string;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface ContextUploadResponse {
|
|
93
|
+
file: ContextUploadResponse.File;
|
|
94
|
+
|
|
95
|
+
error?: string;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export namespace ContextUploadResponse {
|
|
99
|
+
export interface File {
|
|
100
|
+
name: string;
|
|
101
|
+
|
|
102
|
+
path: string;
|
|
103
|
+
|
|
104
|
+
size: number;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface ContextListParams {
|
|
109
|
+
/**
|
|
110
|
+
* The context key (e.g., "orgId", "teamId")
|
|
111
|
+
*/
|
|
112
|
+
contextKey: string;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface ContextDeleteParams {
|
|
116
|
+
/**
|
|
117
|
+
* The context key (e.g., "orgId", "teamId")
|
|
118
|
+
*/
|
|
119
|
+
contextKey: string;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* The context value
|
|
123
|
+
*/
|
|
124
|
+
contextValue: string;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface ContextUploadParams {
|
|
128
|
+
/**
|
|
129
|
+
* Path param: The context key (e.g., "orgId", "teamId")
|
|
130
|
+
*/
|
|
131
|
+
contextKey: string;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Body param: The file to upload (CSV or JSON, max 10MB)
|
|
135
|
+
*/
|
|
136
|
+
file: Uploadable;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Body param: Optional notes or description for the dataset
|
|
140
|
+
*/
|
|
141
|
+
notes?: string;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export declare namespace Context {
|
|
145
|
+
export {
|
|
146
|
+
type ContextListResponse as ContextListResponse,
|
|
147
|
+
type ContextDeleteResponse as ContextDeleteResponse,
|
|
148
|
+
type ContextUploadResponse as ContextUploadResponse,
|
|
149
|
+
type ContextListParams as ContextListParams,
|
|
150
|
+
type ContextDeleteParams as ContextDeleteParams,
|
|
151
|
+
type ContextUploadParams as ContextUploadParams,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import * as ContextAPI from './context';
|
|
5
|
+
import {
|
|
6
|
+
Context,
|
|
7
|
+
ContextDeleteParams,
|
|
8
|
+
ContextDeleteResponse,
|
|
9
|
+
ContextListParams,
|
|
10
|
+
ContextListResponse,
|
|
11
|
+
ContextUploadParams,
|
|
12
|
+
ContextUploadResponse,
|
|
13
|
+
} from './context';
|
|
14
|
+
import * as UserAPI from './user';
|
|
15
|
+
import {
|
|
16
|
+
User,
|
|
17
|
+
UserDeleteParams,
|
|
18
|
+
UserDeleteResponse,
|
|
19
|
+
UserListResponse,
|
|
20
|
+
UserUploadParams,
|
|
21
|
+
UserUploadResponse,
|
|
22
|
+
} from './user';
|
|
23
|
+
|
|
24
|
+
export class Datasets extends APIResource {
|
|
25
|
+
user: UserAPI.User = new UserAPI.User(this._client);
|
|
26
|
+
context: ContextAPI.Context = new ContextAPI.Context(this._client);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
Datasets.User = User;
|
|
30
|
+
Datasets.Context = Context;
|
|
31
|
+
|
|
32
|
+
export declare namespace Datasets {
|
|
33
|
+
export {
|
|
34
|
+
User as User,
|
|
35
|
+
type UserListResponse as UserListResponse,
|
|
36
|
+
type UserDeleteResponse as UserDeleteResponse,
|
|
37
|
+
type UserUploadResponse as UserUploadResponse,
|
|
38
|
+
type UserDeleteParams as UserDeleteParams,
|
|
39
|
+
type UserUploadParams as UserUploadParams,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export {
|
|
43
|
+
Context as Context,
|
|
44
|
+
type ContextListResponse as ContextListResponse,
|
|
45
|
+
type ContextDeleteResponse as ContextDeleteResponse,
|
|
46
|
+
type ContextUploadResponse as ContextUploadResponse,
|
|
47
|
+
type ContextListParams as ContextListParams,
|
|
48
|
+
type ContextDeleteParams as ContextDeleteParams,
|
|
49
|
+
type ContextUploadParams as ContextUploadParams,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
Context,
|
|
5
|
+
type ContextListResponse,
|
|
6
|
+
type ContextDeleteResponse,
|
|
7
|
+
type ContextUploadResponse,
|
|
8
|
+
type ContextListParams,
|
|
9
|
+
type ContextDeleteParams,
|
|
10
|
+
type ContextUploadParams,
|
|
11
|
+
} from './context';
|
|
12
|
+
export { Datasets } from './datasets';
|
|
13
|
+
export {
|
|
14
|
+
User,
|
|
15
|
+
type UserListResponse,
|
|
16
|
+
type UserDeleteResponse,
|
|
17
|
+
type UserUploadResponse,
|
|
18
|
+
type UserDeleteParams,
|
|
19
|
+
type UserUploadParams,
|
|
20
|
+
} from './user';
|