@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.
Files changed (98) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +37 -22
  3. package/client.d.mts +2 -2
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +2 -2
  6. package/client.d.ts.map +1 -1
  7. package/client.js +1 -1
  8. package/client.js.map +1 -1
  9. package/client.mjs +1 -1
  10. package/client.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/conversations/conversations.d.mts +40 -2
  13. package/resources/conversations/conversations.d.mts.map +1 -1
  14. package/resources/conversations/conversations.d.ts +40 -2
  15. package/resources/conversations/conversations.d.ts.map +1 -1
  16. package/resources/conversations/conversations.js +21 -0
  17. package/resources/conversations/conversations.js.map +1 -1
  18. package/resources/conversations/conversations.mjs +21 -0
  19. package/resources/conversations/conversations.mjs.map +1 -1
  20. package/resources/conversations/response/feedback.d.mts +18 -0
  21. package/resources/conversations/response/feedback.d.mts.map +1 -1
  22. package/resources/conversations/response/feedback.d.ts +18 -0
  23. package/resources/conversations/response/feedback.d.ts.map +1 -1
  24. package/resources/conversations/response/feedback.js +18 -0
  25. package/resources/conversations/response/feedback.js.map +1 -1
  26. package/resources/conversations/response/feedback.mjs +18 -0
  27. package/resources/conversations/response/feedback.mjs.map +1 -1
  28. package/resources/conversations/response/response.d.mts +17 -0
  29. package/resources/conversations/response/response.d.mts.map +1 -1
  30. package/resources/conversations/response/response.d.ts +17 -0
  31. package/resources/conversations/response/response.d.ts.map +1 -1
  32. package/resources/conversations/response/response.js +9 -0
  33. package/resources/conversations/response/response.js.map +1 -1
  34. package/resources/conversations/response/response.mjs +9 -0
  35. package/resources/conversations/response/response.mjs.map +1 -1
  36. package/resources/datasets/context.d.mts +100 -0
  37. package/resources/datasets/context.d.mts.map +1 -0
  38. package/resources/datasets/context.d.ts +100 -0
  39. package/resources/datasets/context.d.ts.map +1 -0
  40. package/resources/datasets/context.js +61 -0
  41. package/resources/datasets/context.js.map +1 -0
  42. package/resources/datasets/context.mjs +57 -0
  43. package/resources/datasets/context.mjs.map +1 -0
  44. package/resources/datasets/datasets.d.mts +14 -0
  45. package/resources/datasets/datasets.d.mts.map +1 -0
  46. package/resources/datasets/datasets.d.ts +14 -0
  47. package/resources/datasets/datasets.d.ts.map +1 -0
  48. package/resources/datasets/datasets.js +21 -0
  49. package/resources/datasets/datasets.js.map +1 -0
  50. package/resources/datasets/datasets.mjs +16 -0
  51. package/resources/datasets/datasets.mjs.map +1 -0
  52. package/resources/datasets/index.d.mts +4 -0
  53. package/resources/datasets/index.d.mts.map +1 -0
  54. package/resources/datasets/index.d.ts +4 -0
  55. package/resources/datasets/index.d.ts.map +1 -0
  56. package/resources/datasets/index.js +11 -0
  57. package/resources/datasets/index.js.map +1 -0
  58. package/resources/datasets/index.mjs +5 -0
  59. package/resources/datasets/index.mjs.map +1 -0
  60. package/resources/datasets/user.d.mts +77 -0
  61. package/resources/datasets/user.d.mts.map +1 -0
  62. package/resources/datasets/user.d.ts +77 -0
  63. package/resources/datasets/user.d.ts.map +1 -0
  64. package/resources/datasets/user.js +50 -0
  65. package/resources/datasets/user.js.map +1 -0
  66. package/resources/datasets/user.mjs +46 -0
  67. package/resources/datasets/user.mjs.map +1 -0
  68. package/resources/datasets.d.mts +1 -66
  69. package/resources/datasets.d.mts.map +1 -1
  70. package/resources/datasets.d.ts +1 -66
  71. package/resources/datasets.d.ts.map +1 -1
  72. package/resources/datasets.js +2 -26
  73. package/resources/datasets.js.map +1 -1
  74. package/resources/datasets.mjs +1 -24
  75. package/resources/datasets.mjs.map +1 -1
  76. package/resources/index.d.mts +1 -1
  77. package/resources/index.d.mts.map +1 -1
  78. package/resources/index.d.ts +1 -1
  79. package/resources/index.d.ts.map +1 -1
  80. package/resources/index.js +1 -1
  81. package/resources/index.js.map +1 -1
  82. package/resources/index.mjs +1 -1
  83. package/resources/index.mjs.map +1 -1
  84. package/src/client.ts +2 -18
  85. package/src/resources/conversations/conversations.ts +44 -2
  86. package/src/resources/conversations/response/feedback.ts +18 -0
  87. package/src/resources/conversations/response/response.ts +17 -0
  88. package/src/resources/datasets/context.ts +153 -0
  89. package/src/resources/datasets/datasets.ts +51 -0
  90. package/src/resources/datasets/index.ts +20 -0
  91. package/src/resources/datasets/user.ts +120 -0
  92. package/src/resources/datasets.ts +1 -100
  93. package/src/resources/index.ts +1 -9
  94. package/src/version.ts +1 -1
  95. package/version.d.mts +1 -1
  96. package/version.d.ts +1 -1
  97. package/version.js +1 -1
  98. package/version.mjs +1 -1
@@ -1,67 +1,2 @@
1
- import { APIResource } from "../core/resource.js";
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":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,UAAU,EAAE;OACnB,EAAE,cAAc,EAAE;AAIzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;OAEG;IACH,IAAI,CAAC,KAAK,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,mBAAmB,CAAC;IAIzF;;OAEG;IACH,MAAM,CACJ,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,mBAAmB,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,qBAAqB,CAAC;IAKpC;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,qBAAqB,CAAC;CAG/F;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IAEb,OAAO,EAAE,OAAO,CAAC;IAEjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,qBAAqB,CAAC,IAAI,CAAC;IAEjC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,yBAAiB,qBAAqB,CAAC;IACrC,UAAiB,IAAI;QACnB,IAAI,EAAE,MAAM,CAAC;QAEb,IAAI,EAAE,MAAM,CAAC;QAEb,IAAI,EAAE,MAAM,CAAC;KACd;CACF;AAED,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CACjD;AAED,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CACjD;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;IAEjB;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
1
+ {"version":3,"file":"datasets.d.ts","sourceRoot":"","sources":["../src/resources/datasets.ts"],"names":[],"mappings":""}
@@ -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
- exports.Datasets = void 0;
5
- const resource_1 = require("../core/resource.js");
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,kDAA+C;AAI/C,oDAAkE;AAClE,oDAA8C;AAE9C,MAAa,QAAS,SAAQ,sBAAW;IACvC;;OAEG;IACH,IAAI,CAAC,KAAwB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACH,MAAM,CACJ,QAAgB,EAChB,MAA2B,EAC3B,OAAwB;QAExB,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,aAAa,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClG,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,IAAyB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,IAAA,qCAA2B,EAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IACzG,CAAC;CACF;AA1BD,4BA0BC"}
1
+ {"version":3,"file":"datasets.js","sourceRoot":"","sources":["../src/resources/datasets.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,8DAAiC"}
@@ -1,26 +1,3 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- import { APIResource } from "../core/resource.mjs";
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;OAE/E,EAAE,WAAW,EAAE;OAIf,EAAE,2BAA2B,EAAE;OAC/B,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;OAEG;IACH,IAAI,CAAC,KAAwB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACH,MAAM,CACJ,QAAgB,EAChB,MAA2B,EAC3B,OAAwB;QAExB,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,aAAa,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClG,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,IAAyB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,2BAA2B,CAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IACzG,CAAC;CACF"}
1
+ {"version":3,"file":"datasets.mjs","sourceRoot":"","sources":["../src/resources/datasets.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
@@ -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, type DatasetListResponse, type DatasetDeleteResponse, type DatasetUploadResponse, type DatasetListParams, type DatasetDeleteParams, type DatasetUploadParams, } from "./datasets.mjs";
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,EACL,QAAQ,EACR,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,GACzB;OACM,EAAE,UAAU,EAAE"}
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"}
@@ -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, type DatasetListResponse, type DatasetDeleteResponse, type DatasetUploadResponse, type DatasetListParams, type DatasetDeleteParams, type DatasetUploadParams, } from "./datasets.js";
3
+ export { Datasets } from "./datasets/datasets.js";
4
4
  export { McpServers } from "./mcp-servers/mcp-servers.js";
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -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,EACL,QAAQ,EACR,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,GACzB;OACM,EAAE,UAAU,EAAE"}
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"}
@@ -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; } });
@@ -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,0CAQoB;AAPlB,oGAAA,QAAQ,OAAA;AAQV,4DAAuD;AAA9C,yGAAA,UAAU,OAAA"}
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"}
@@ -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, } from "./datasets.mjs";
4
+ export { Datasets } from "./datasets/datasets.mjs";
5
5
  export { McpServers } from "./mcp-servers/mcp-servers.mjs";
6
6
  //# sourceMappingURL=index.mjs.map
@@ -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,EACL,QAAQ,GAOT;OACM,EAAE,UAAU,EAAE"}
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
- * Context key-values used for tenancy / filtering.
127
+ * Unique identifier for the end-user (1-256 chars). Allowed characters:
128
+ * alphanumeric, underscore, hyphen, colon, period, at symbol.
97
129
  */
98
- userContext: { [key: string]: unknown };
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';