@caitlyn-ai/sdk 0.0.0-stage → 0.0.1
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/LICENSE +201 -0
- package/NOTICE +4 -0
- package/README.md +164 -2
- package/dist-browser/sdk/index.mjs +1923 -0
- package/dist-browser/sdk/index.mjs.map +7 -0
- package/dist-cjs/sdk/index.cjs +1974 -0
- package/dist-cjs/sdk/index.cjs.map +7 -0
- package/dist-es/sdk/index.mjs +1925 -0
- package/dist-es/sdk/index.mjs.map +7 -0
- package/dist-types/Caitlyn.d.ts +76 -0
- package/dist-types/CaitlynClient.d.ts +160 -0
- package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
- package/dist-types/auth/httpAuthSchemeProvider.d.ts +81 -0
- package/dist-types/commandBuilder.d.ts +18 -0
- package/dist-types/commands/CreateDocumentCommand.d.ts +190 -0
- package/dist-types/commands/CreateUploadCommand.d.ts +165 -0
- package/dist-types/commands/GetAgentVersionCommand.d.ts +177 -0
- package/dist-types/commands/ListDocumentsCommand.d.ts +176 -0
- package/dist-types/commands/ResumeConversationStreamCommand.d.ts +146 -0
- package/dist-types/commands/SendMessageCommand.d.ts +183 -0
- package/dist-types/commands/UpdateDraftVersionCommand.d.ts +202 -0
- package/dist-types/commands/index.d.ts +7 -0
- package/dist-types/endpoint/EndpointParameters.d.ts +32 -0
- package/dist-types/endpoint/bdd.d.ts +2 -0
- package/dist-types/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/extensionConfiguration.d.ts +8 -0
- package/dist-types/index.d.ts +22 -0
- package/dist-types/models/CaitlynServiceException.d.ts +15 -0
- package/dist-types/models/enums.d.ts +148 -0
- package/dist-types/models/errors.d.ts +659 -0
- package/dist-types/models/models_0.d.ts +754 -0
- package/dist-types/pagination/Interfaces.d.ts +8 -0
- package/dist-types/pagination/ListDocumentsPaginator.d.ts +7 -0
- package/dist-types/pagination/index.d.ts +2 -0
- package/dist-types/runtimeConfig.browser.d.ts +50 -0
- package/dist-types/runtimeConfig.d.ts +50 -0
- package/dist-types/runtimeConfig.native.d.ts +49 -0
- package/dist-types/runtimeConfig.shared.d.ts +36 -0
- package/dist-types/runtimeExtensions.d.ts +17 -0
- package/dist-types/schemas/schemas_0.d.ts +51 -0
- package/dist-types/sdk/client.d.ts +47 -0
- package/dist-types/sdk/events.d.ts +163 -0
- package/dist-types/sdk/index.d.ts +8 -0
- package/dist-types/sdk/operations.d.ts +70 -0
- package/package.json +49 -5
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import type { MetadataBearer as __MetadataBearer } from "@smithy/types";
|
|
2
|
+
import type { GetAgentVersionInput, GetAgentVersionOutput } from "../models/models_0";
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export type { __MetadataBearer };
|
|
7
|
+
/**
|
|
8
|
+
* @public
|
|
9
|
+
*
|
|
10
|
+
* The input for {@link GetAgentVersionCommand}.
|
|
11
|
+
*/
|
|
12
|
+
export interface GetAgentVersionCommandInput extends GetAgentVersionInput {
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @public
|
|
16
|
+
*
|
|
17
|
+
* The output of {@link GetAgentVersionCommand}.
|
|
18
|
+
*/
|
|
19
|
+
export interface GetAgentVersionCommandOutput extends GetAgentVersionOutput, __MetadataBearer {
|
|
20
|
+
}
|
|
21
|
+
declare const GetAgentVersionCommand_base: {
|
|
22
|
+
new (input: GetAgentVersionCommandInput): import("@smithy/core/client").CommandImpl<GetAgentVersionCommandInput, GetAgentVersionCommandOutput, import("..").CaitlynClientResolvedConfig, import("..").ServiceInputTypes, import("..").ServiceOutputTypes>;
|
|
23
|
+
new (input: GetAgentVersionCommandInput): import("@smithy/core/client").CommandImpl<GetAgentVersionCommandInput, GetAgentVersionCommandOutput, import("..").CaitlynClientResolvedConfig, import("..").ServiceInputTypes, import("..").ServiceOutputTypes>;
|
|
24
|
+
getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Gets one version of an agent, with its full configuration and its ETag.
|
|
28
|
+
*
|
|
29
|
+
* `version` is `draft`, `production` or the name of a pinned or published version. Production is
|
|
30
|
+
* readable by everyone with access to the agent; the draft and pinned versions only by the people
|
|
31
|
+
* and groups on the agent's version access grant, and anyone else gets 404.
|
|
32
|
+
* @example
|
|
33
|
+
* Use a bare-bones client and the command you need to make an API call.
|
|
34
|
+
* ```javascript
|
|
35
|
+
* import { CaitlynClient, GetAgentVersionCommand } from "@caitlyn-ai/sdk"; // ES Modules import
|
|
36
|
+
* // const { CaitlynClient, GetAgentVersionCommand } = require("@caitlyn-ai/sdk"); // CommonJS import
|
|
37
|
+
* // import type { CaitlynClientConfig } from "@caitlyn-ai/sdk";
|
|
38
|
+
* const config = {}; // type is CaitlynClientConfig
|
|
39
|
+
* const client = new CaitlynClient(config);
|
|
40
|
+
* const input = { // GetAgentVersionInput
|
|
41
|
+
* agentId: "STRING_VALUE", // required
|
|
42
|
+
* version: "STRING_VALUE", // required
|
|
43
|
+
* };
|
|
44
|
+
* const command = new GetAgentVersionCommand(input);
|
|
45
|
+
* const response = await client.send(command);
|
|
46
|
+
* // { // GetAgentVersionOutput
|
|
47
|
+
* // requestId: "STRING_VALUE",
|
|
48
|
+
* // apiVersion: "STRING_VALUE",
|
|
49
|
+
* // etag: "STRING_VALUE", // required
|
|
50
|
+
* // agentId: "STRING_VALUE", // required
|
|
51
|
+
* // name: "STRING_VALUE", // required
|
|
52
|
+
* // source: "pin" || "publish" || "migration" || "import",
|
|
53
|
+
* // basedOn: "STRING_VALUE",
|
|
54
|
+
* // matchesProduction: true || false,
|
|
55
|
+
* // createdAt: new Date("TIMESTAMP"), // required
|
|
56
|
+
* // note: "STRING_VALUE",
|
|
57
|
+
* // configuration: { // AgentConfiguration
|
|
58
|
+
* // identity: "STRING_VALUE",
|
|
59
|
+
* // instructions: "STRING_VALUE", // required
|
|
60
|
+
* // model: "STRING_VALUE",
|
|
61
|
+
* // knowledgeBases: [ // KnowledgeBaseBindingList
|
|
62
|
+
* // { // KnowledgeBaseBinding
|
|
63
|
+
* // knowledgeBaseId: "STRING_VALUE", // required
|
|
64
|
+
* // numberOfResults: Number("int"),
|
|
65
|
+
* // minimumScore: Number("float"),
|
|
66
|
+
* // },
|
|
67
|
+
* // ],
|
|
68
|
+
* // attachments: { // AttachmentSettings
|
|
69
|
+
* // enabled: true || false,
|
|
70
|
+
* // maxFiles: Number("int"),
|
|
71
|
+
* // },
|
|
72
|
+
* // contentSafety: { // ContentSafety
|
|
73
|
+
* // guardrailId: "STRING_VALUE",
|
|
74
|
+
* // },
|
|
75
|
+
* // deniedDocuments: true || false,
|
|
76
|
+
* // },
|
|
77
|
+
* // };
|
|
78
|
+
*
|
|
79
|
+
* ```
|
|
80
|
+
*
|
|
81
|
+
* @param GetAgentVersionCommandInput - {@link GetAgentVersionCommandInput}
|
|
82
|
+
* @returns {@link GetAgentVersionCommandOutput}
|
|
83
|
+
* @see {@link GetAgentVersionCommandInput} for command's `input` shape.
|
|
84
|
+
* @see {@link GetAgentVersionCommandOutput} for command's `response` shape.
|
|
85
|
+
* @see {@link CaitlynClientResolvedConfig | config} for CaitlynClient's `config` shape.
|
|
86
|
+
*
|
|
87
|
+
* @throws {@link NotFoundError} (client fault)
|
|
88
|
+
* The record does not exist, or the caller may not see it. The two are deliberately the same, so
|
|
89
|
+
* identifiers cannot be probed.
|
|
90
|
+
*
|
|
91
|
+
* @throws {@link InternalError} (server fault)
|
|
92
|
+
* An unexpected server failure. Not retried by the SDKs.
|
|
93
|
+
*
|
|
94
|
+
* @throws {@link PermissionDeniedError} (client fault)
|
|
95
|
+
* The caller may not call this operation: it lacks the permission, its credential type may not
|
|
96
|
+
* call it, or the operation is served only on the organisation's primary workspace. Decided before
|
|
97
|
+
* any record is read. A record the caller may not see is 404 instead.
|
|
98
|
+
*
|
|
99
|
+
* @throws {@link ServiceUnavailableError} (server fault)
|
|
100
|
+
* A dependency is briefly unavailable, or the request's audit event could not be recorded; wait for
|
|
101
|
+
* `Retry-After` and try again.
|
|
102
|
+
*
|
|
103
|
+
* @throws {@link TooManyRequestsError} (client fault)
|
|
104
|
+
* Too many requests; wait for `Retry-After` and try again.
|
|
105
|
+
*
|
|
106
|
+
* @throws {@link UnauthenticatedError} (client fault)
|
|
107
|
+
* No credential was sent, or it is expired or not valid.
|
|
108
|
+
*
|
|
109
|
+
* @throws {@link ValidationError} (client fault)
|
|
110
|
+
* The request is malformed: a member is missing, the wrong type or out of range; it has a member,
|
|
111
|
+
* filter or sort field the operation does not define; or its cursor is not valid for this list.
|
|
112
|
+
*
|
|
113
|
+
* @throws {@link CaitlynServiceException}
|
|
114
|
+
* <p>Base exception class for all service exceptions from Caitlyn service.</p>
|
|
115
|
+
*
|
|
116
|
+
*
|
|
117
|
+
* @example Read the draft before editing it
|
|
118
|
+
* ```javascript
|
|
119
|
+
* //
|
|
120
|
+
* const input = {
|
|
121
|
+
* agentId: "GHT7YRWXPL",
|
|
122
|
+
* version: "draft"
|
|
123
|
+
* };
|
|
124
|
+
* const command = new GetAgentVersionCommand(input);
|
|
125
|
+
* const response = await client.send(command);
|
|
126
|
+
* /* response is
|
|
127
|
+
* {
|
|
128
|
+
* agentId: "GHT7YRWXPL",
|
|
129
|
+
* configuration: {
|
|
130
|
+
* identity: "You are the HR assistant for Harbour Freight staff.",
|
|
131
|
+
* instructions: "Answer leave and pay questions from the HR policy knowledge base.",
|
|
132
|
+
* knowledgeBases: [
|
|
133
|
+
* {
|
|
134
|
+
* knowledgeBaseId: "KB4T7YQ2WL",
|
|
135
|
+
* minimumScore: 0.3,
|
|
136
|
+
* numberOfResults: 8
|
|
137
|
+
* }
|
|
138
|
+
* ],
|
|
139
|
+
* model: "claude-sonnet-5-5"
|
|
140
|
+
* },
|
|
141
|
+
* createdAt: "2026-11-02T03:04:05.000Z",
|
|
142
|
+
* etag: `"draft-41"`,
|
|
143
|
+
* matchesProduction: false,
|
|
144
|
+
* name: "draft"
|
|
145
|
+
* }
|
|
146
|
+
* *\/
|
|
147
|
+
* ```
|
|
148
|
+
*
|
|
149
|
+
* @example A version name that does not exist, or that the caller may not see
|
|
150
|
+
* ```javascript
|
|
151
|
+
* //
|
|
152
|
+
* const input = {
|
|
153
|
+
* agentId: "GHT7YRWXPL",
|
|
154
|
+
* version: "v99"
|
|
155
|
+
* };
|
|
156
|
+
* const command = new GetAgentVersionCommand(input);
|
|
157
|
+
* const response = await client.send(command);
|
|
158
|
+
* /* response is
|
|
159
|
+
* { /* metadata only *\/ }
|
|
160
|
+
* *\/
|
|
161
|
+
* ```
|
|
162
|
+
*
|
|
163
|
+
* @public
|
|
164
|
+
*/
|
|
165
|
+
export declare class GetAgentVersionCommand extends GetAgentVersionCommand_base {
|
|
166
|
+
/** @internal type navigation helper, not in runtime. */
|
|
167
|
+
protected static __types: {
|
|
168
|
+
api: {
|
|
169
|
+
input: GetAgentVersionInput;
|
|
170
|
+
output: GetAgentVersionOutput;
|
|
171
|
+
};
|
|
172
|
+
sdk: {
|
|
173
|
+
input: GetAgentVersionCommandInput;
|
|
174
|
+
output: GetAgentVersionCommandOutput;
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import type { MetadataBearer as __MetadataBearer } from "@smithy/types";
|
|
2
|
+
import type { ListDocumentsInput, ListDocumentsOutput } from "../models/models_0";
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export type { __MetadataBearer };
|
|
7
|
+
/**
|
|
8
|
+
* @public
|
|
9
|
+
*
|
|
10
|
+
* The input for {@link ListDocumentsCommand}.
|
|
11
|
+
*/
|
|
12
|
+
export interface ListDocumentsCommandInput extends ListDocumentsInput {
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @public
|
|
16
|
+
*
|
|
17
|
+
* The output of {@link ListDocumentsCommand}.
|
|
18
|
+
*/
|
|
19
|
+
export interface ListDocumentsCommandOutput extends ListDocumentsOutput, __MetadataBearer {
|
|
20
|
+
}
|
|
21
|
+
declare const ListDocumentsCommand_base: {
|
|
22
|
+
new (input: ListDocumentsCommandInput): import("@smithy/core/client").CommandImpl<ListDocumentsCommandInput, ListDocumentsCommandOutput, import("..").CaitlynClientResolvedConfig, import("..").ServiceInputTypes, import("..").ServiceOutputTypes>;
|
|
23
|
+
new (input: ListDocumentsCommandInput): import("@smithy/core/client").CommandImpl<ListDocumentsCommandInput, ListDocumentsCommandOutput, import("..").CaitlynClientResolvedConfig, import("..").ServiceInputTypes, import("..").ServiceOutputTypes>;
|
|
24
|
+
getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Lists the documents in a knowledge base, one page at a time.
|
|
28
|
+
*
|
|
29
|
+
* Documents are returned in a stable order that does not change between pages. Filters combine
|
|
30
|
+
* with AND. Unlike v2, an unknown filter is refused with 400 `UNKNOWN_FILTER` instead of being
|
|
31
|
+
* ignored, and the list can be sorted by `name`, `updatedAt` (when the document last changed) and
|
|
32
|
+
* `byteSize` on the server; v2 sorts on the client only.
|
|
33
|
+
* @example
|
|
34
|
+
* Use a bare-bones client and the command you need to make an API call.
|
|
35
|
+
* ```javascript
|
|
36
|
+
* import { CaitlynClient, ListDocumentsCommand } from "@caitlyn-ai/sdk"; // ES Modules import
|
|
37
|
+
* // const { CaitlynClient, ListDocumentsCommand } = require("@caitlyn-ai/sdk"); // CommonJS import
|
|
38
|
+
* // import type { CaitlynClientConfig } from "@caitlyn-ai/sdk";
|
|
39
|
+
* const config = {}; // type is CaitlynClientConfig
|
|
40
|
+
* const client = new CaitlynClient(config);
|
|
41
|
+
* const input = { // ListDocumentsInput
|
|
42
|
+
* knowledgeBaseId: "STRING_VALUE", // required
|
|
43
|
+
* limit: Number("int"),
|
|
44
|
+
* cursor: "STRING_VALUE",
|
|
45
|
+
* sort: "STRING_VALUE",
|
|
46
|
+
* folder: "STRING_VALUE",
|
|
47
|
+
* status: "pending" || "processing" || "indexed" || "partially_indexed" || "failed" || "deleting",
|
|
48
|
+
* namePrefix: "STRING_VALUE",
|
|
49
|
+
* };
|
|
50
|
+
* const command = new ListDocumentsCommand(input);
|
|
51
|
+
* const response = await client.send(command);
|
|
52
|
+
* // { // ListDocumentsOutput
|
|
53
|
+
* // requestId: "STRING_VALUE",
|
|
54
|
+
* // apiVersion: "STRING_VALUE",
|
|
55
|
+
* // items: [ // DocumentList // required
|
|
56
|
+
* // { // Document
|
|
57
|
+
* // id: "STRING_VALUE", // required
|
|
58
|
+
* // knowledgeBaseId: "STRING_VALUE", // required
|
|
59
|
+
* // name: "STRING_VALUE", // required
|
|
60
|
+
* // folder: "STRING_VALUE", // required
|
|
61
|
+
* // status: "pending" || "processing" || "indexed" || "partially_indexed" || "failed" || "deleting", // required
|
|
62
|
+
* // stage: "STRING_VALUE",
|
|
63
|
+
* // contentType: "STRING_VALUE",
|
|
64
|
+
* // byteSize: Number("long"),
|
|
65
|
+
* // sha256: "STRING_VALUE",
|
|
66
|
+
* // createdAt: new Date("TIMESTAMP"), // required
|
|
67
|
+
* // updatedAt: new Date("TIMESTAMP"), // required
|
|
68
|
+
* // partialFailures: [ // PartialFailureList
|
|
69
|
+
* // { // PartialFailure
|
|
70
|
+
* // targetId: "STRING_VALUE",
|
|
71
|
+
* // code: "STRING_VALUE", // required
|
|
72
|
+
* // detail: "STRING_VALUE",
|
|
73
|
+
* // },
|
|
74
|
+
* // ],
|
|
75
|
+
* // },
|
|
76
|
+
* // ],
|
|
77
|
+
* // nextCursor: "STRING_VALUE",
|
|
78
|
+
* // };
|
|
79
|
+
*
|
|
80
|
+
* ```
|
|
81
|
+
*
|
|
82
|
+
* @param ListDocumentsCommandInput - {@link ListDocumentsCommandInput}
|
|
83
|
+
* @returns {@link ListDocumentsCommandOutput}
|
|
84
|
+
* @see {@link ListDocumentsCommandInput} for command's `input` shape.
|
|
85
|
+
* @see {@link ListDocumentsCommandOutput} for command's `response` shape.
|
|
86
|
+
* @see {@link CaitlynClientResolvedConfig | config} for CaitlynClient's `config` shape.
|
|
87
|
+
*
|
|
88
|
+
* @throws {@link NotFoundError} (client fault)
|
|
89
|
+
* The record does not exist, or the caller may not see it. The two are deliberately the same, so
|
|
90
|
+
* identifiers cannot be probed.
|
|
91
|
+
*
|
|
92
|
+
* @throws {@link InternalError} (server fault)
|
|
93
|
+
* An unexpected server failure. Not retried by the SDKs.
|
|
94
|
+
*
|
|
95
|
+
* @throws {@link PermissionDeniedError} (client fault)
|
|
96
|
+
* The caller may not call this operation: it lacks the permission, its credential type may not
|
|
97
|
+
* call it, or the operation is served only on the organisation's primary workspace. Decided before
|
|
98
|
+
* any record is read. A record the caller may not see is 404 instead.
|
|
99
|
+
*
|
|
100
|
+
* @throws {@link ServiceUnavailableError} (server fault)
|
|
101
|
+
* A dependency is briefly unavailable, or the request's audit event could not be recorded; wait for
|
|
102
|
+
* `Retry-After` and try again.
|
|
103
|
+
*
|
|
104
|
+
* @throws {@link TooManyRequestsError} (client fault)
|
|
105
|
+
* Too many requests; wait for `Retry-After` and try again.
|
|
106
|
+
*
|
|
107
|
+
* @throws {@link UnauthenticatedError} (client fault)
|
|
108
|
+
* No credential was sent, or it is expired or not valid.
|
|
109
|
+
*
|
|
110
|
+
* @throws {@link ValidationError} (client fault)
|
|
111
|
+
* The request is malformed: a member is missing, the wrong type or out of range; it has a member,
|
|
112
|
+
* filter or sort field the operation does not define; or its cursor is not valid for this list.
|
|
113
|
+
*
|
|
114
|
+
* @throws {@link CaitlynServiceException}
|
|
115
|
+
* <p>Base exception class for all service exceptions from Caitlyn service.</p>
|
|
116
|
+
*
|
|
117
|
+
*
|
|
118
|
+
* @example List the HR folder's documents that finished indexing
|
|
119
|
+
* ```javascript
|
|
120
|
+
* //
|
|
121
|
+
* const input = {
|
|
122
|
+
* folder: "hr/",
|
|
123
|
+
* knowledgeBaseId: "KB4T7YQ2WL",
|
|
124
|
+
* limit: 2,
|
|
125
|
+
* status: "indexed"
|
|
126
|
+
* };
|
|
127
|
+
* const command = new ListDocumentsCommand(input);
|
|
128
|
+
* const response = await client.send(command);
|
|
129
|
+
* /* response is
|
|
130
|
+
* {
|
|
131
|
+
* items: [
|
|
132
|
+
* {
|
|
133
|
+
* byteSize: 482113,
|
|
134
|
+
* contentType: "application/pdf",
|
|
135
|
+
* createdAt: "2026-10-01T22:10:00.000Z",
|
|
136
|
+
* folder: "hr/",
|
|
137
|
+
* id: "doc-3b7f9e21",
|
|
138
|
+
* knowledgeBaseId: "KB4T7YQ2WL",
|
|
139
|
+
* name: "Leave policy",
|
|
140
|
+
* status: "indexed",
|
|
141
|
+
* updatedAt: "2026-10-01T22:14:31.000Z"
|
|
142
|
+
* }
|
|
143
|
+
* ],
|
|
144
|
+
* nextCursor: "c1.MEUCIQDl8z"
|
|
145
|
+
* }
|
|
146
|
+
* *\/
|
|
147
|
+
* ```
|
|
148
|
+
*
|
|
149
|
+
* @example A knowledge base that does not exist, or that the caller may not see
|
|
150
|
+
* ```javascript
|
|
151
|
+
* //
|
|
152
|
+
* const input = {
|
|
153
|
+
* knowledgeBaseId: "KBNOPE0000"
|
|
154
|
+
* };
|
|
155
|
+
* const command = new ListDocumentsCommand(input);
|
|
156
|
+
* const response = await client.send(command);
|
|
157
|
+
* /* response is
|
|
158
|
+
* { /* metadata only *\/ }
|
|
159
|
+
* *\/
|
|
160
|
+
* ```
|
|
161
|
+
*
|
|
162
|
+
* @public
|
|
163
|
+
*/
|
|
164
|
+
export declare class ListDocumentsCommand extends ListDocumentsCommand_base {
|
|
165
|
+
/** @internal type navigation helper, not in runtime. */
|
|
166
|
+
protected static __types: {
|
|
167
|
+
api: {
|
|
168
|
+
input: ListDocumentsInput;
|
|
169
|
+
output: ListDocumentsOutput;
|
|
170
|
+
};
|
|
171
|
+
sdk: {
|
|
172
|
+
input: ListDocumentsCommandInput;
|
|
173
|
+
output: ListDocumentsCommandOutput;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import type { MetadataBearer as __MetadataBearer, StreamingBlobPayloadOutputTypes } from "@smithy/types";
|
|
2
|
+
import type { ResumeConversationStreamInput, ResumeConversationStreamOutput } from "../models/models_0";
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export type { __MetadataBearer };
|
|
7
|
+
/**
|
|
8
|
+
* @public
|
|
9
|
+
*
|
|
10
|
+
* The input for {@link ResumeConversationStreamCommand}.
|
|
11
|
+
*/
|
|
12
|
+
export interface ResumeConversationStreamCommandInput extends ResumeConversationStreamInput {
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @public
|
|
16
|
+
*
|
|
17
|
+
* The output of {@link ResumeConversationStreamCommand}.
|
|
18
|
+
*/
|
|
19
|
+
export interface ResumeConversationStreamCommandOutput extends Omit<ResumeConversationStreamOutput, "events">, __MetadataBearer {
|
|
20
|
+
events: StreamingBlobPayloadOutputTypes;
|
|
21
|
+
}
|
|
22
|
+
declare const ResumeConversationStreamCommand_base: {
|
|
23
|
+
new (input: ResumeConversationStreamCommandInput): import("@smithy/core/client").CommandImpl<ResumeConversationStreamCommandInput, ResumeConversationStreamCommandOutput, import("..").CaitlynClientResolvedConfig, import("..").ServiceInputTypes, import("..").ServiceOutputTypes>;
|
|
24
|
+
new (input: ResumeConversationStreamCommandInput): import("@smithy/core/client").CommandImpl<ResumeConversationStreamCommandInput, ResumeConversationStreamCommandOutput, import("..").CaitlynClientResolvedConfig, import("..").ServiceInputTypes, import("..").ServiceOutputTypes>;
|
|
25
|
+
getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Re-attaches to the answer that is being written, from the event after `Last-Event-ID`.
|
|
29
|
+
*
|
|
30
|
+
* Used by the SDKs after a dropped connection; callers rarely need it directly. When no answer is
|
|
31
|
+
* being written, the stream ends at once.
|
|
32
|
+
* @example
|
|
33
|
+
* Use a bare-bones client and the command you need to make an API call.
|
|
34
|
+
* ```javascript
|
|
35
|
+
* import { CaitlynClient, ResumeConversationStreamCommand } from "@caitlyn-ai/sdk"; // ES Modules import
|
|
36
|
+
* // const { CaitlynClient, ResumeConversationStreamCommand } = require("@caitlyn-ai/sdk"); // CommonJS import
|
|
37
|
+
* // import type { CaitlynClientConfig } from "@caitlyn-ai/sdk";
|
|
38
|
+
* const config = {}; // type is CaitlynClientConfig
|
|
39
|
+
* const client = new CaitlynClient(config);
|
|
40
|
+
* const input = { // ResumeConversationStreamInput
|
|
41
|
+
* conversationId: "STRING_VALUE", // required
|
|
42
|
+
* lastEventId: "STRING_VALUE",
|
|
43
|
+
* };
|
|
44
|
+
* const command = new ResumeConversationStreamCommand(input);
|
|
45
|
+
* const response = await client.send(command);
|
|
46
|
+
* // consume or destroy the stream to free the socket.
|
|
47
|
+
* const bytes = await response.events.transformToByteArray();
|
|
48
|
+
* // const str = await response.events.transformToString();
|
|
49
|
+
* // response.events.destroy(); // only applicable to Node.js Readable streams.
|
|
50
|
+
*
|
|
51
|
+
* // { // ResumeConversationStreamOutput
|
|
52
|
+
* // requestId: "STRING_VALUE",
|
|
53
|
+
* // apiVersion: "STRING_VALUE",
|
|
54
|
+
* // events: "<SdkStream>", // see \@smithy/types -> StreamingBlobPayloadOutputTypes // required
|
|
55
|
+
* // };
|
|
56
|
+
*
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* @param ResumeConversationStreamCommandInput - {@link ResumeConversationStreamCommandInput}
|
|
60
|
+
* @returns {@link ResumeConversationStreamCommandOutput}
|
|
61
|
+
* @see {@link ResumeConversationStreamCommandInput} for command's `input` shape.
|
|
62
|
+
* @see {@link ResumeConversationStreamCommandOutput} for command's `response` shape.
|
|
63
|
+
* @see {@link CaitlynClientResolvedConfig | config} for CaitlynClient's `config` shape.
|
|
64
|
+
*
|
|
65
|
+
* @throws {@link NotFoundError} (client fault)
|
|
66
|
+
* The record does not exist, or the caller may not see it. The two are deliberately the same, so
|
|
67
|
+
* identifiers cannot be probed.
|
|
68
|
+
*
|
|
69
|
+
* @throws {@link InternalError} (server fault)
|
|
70
|
+
* An unexpected server failure. Not retried by the SDKs.
|
|
71
|
+
*
|
|
72
|
+
* @throws {@link PermissionDeniedError} (client fault)
|
|
73
|
+
* The caller may not call this operation: it lacks the permission, its credential type may not
|
|
74
|
+
* call it, or the operation is served only on the organisation's primary workspace. Decided before
|
|
75
|
+
* any record is read. A record the caller may not see is 404 instead.
|
|
76
|
+
*
|
|
77
|
+
* @throws {@link ServiceUnavailableError} (server fault)
|
|
78
|
+
* A dependency is briefly unavailable, or the request's audit event could not be recorded; wait for
|
|
79
|
+
* `Retry-After` and try again.
|
|
80
|
+
*
|
|
81
|
+
* @throws {@link TooManyRequestsError} (client fault)
|
|
82
|
+
* Too many requests; wait for `Retry-After` and try again.
|
|
83
|
+
*
|
|
84
|
+
* @throws {@link UnauthenticatedError} (client fault)
|
|
85
|
+
* No credential was sent, or it is expired or not valid.
|
|
86
|
+
*
|
|
87
|
+
* @throws {@link ValidationError} (client fault)
|
|
88
|
+
* The request is malformed: a member is missing, the wrong type or out of range; it has a member,
|
|
89
|
+
* filter or sort field the operation does not define; or its cursor is not valid for this list.
|
|
90
|
+
*
|
|
91
|
+
* @throws {@link CaitlynServiceException}
|
|
92
|
+
* <p>Base exception class for all service exceptions from Caitlyn service.</p>
|
|
93
|
+
*
|
|
94
|
+
*
|
|
95
|
+
* @example Resume after a dropped connection
|
|
96
|
+
* ```javascript
|
|
97
|
+
* // The answer arrives as a stream of events; the example shows only the request.
|
|
98
|
+
* const input = {
|
|
99
|
+
* conversationId: "0193a6f2-7c4e-7b1a-9d2e-3f5a8c1b0e47",
|
|
100
|
+
* lastEventId: "0193a6f2-9b10-7c3d-8e44-1f2a3b4c5d6e"
|
|
101
|
+
* };
|
|
102
|
+
* const command = new ResumeConversationStreamCommand(input);
|
|
103
|
+
* const response = await client.send(command);
|
|
104
|
+
* // consume or destroy the stream to free the socket.
|
|
105
|
+
* const bytes = await response.events.transformToByteArray();
|
|
106
|
+
* // const str = await response.events.transformToString();
|
|
107
|
+
* // response.events.destroy(); // only applicable to Node.js Readable streams.
|
|
108
|
+
*
|
|
109
|
+
* /* response is
|
|
110
|
+
* { /* metadata only *\/ }
|
|
111
|
+
* *\/
|
|
112
|
+
* ```
|
|
113
|
+
*
|
|
114
|
+
* @example A conversation that does not exist, or that the caller may not see
|
|
115
|
+
* ```javascript
|
|
116
|
+
* //
|
|
117
|
+
* const input = {
|
|
118
|
+
* conversationId: "0193a6f2-0000-7000-8000-000000000000"
|
|
119
|
+
* };
|
|
120
|
+
* const command = new ResumeConversationStreamCommand(input);
|
|
121
|
+
* const response = await client.send(command);
|
|
122
|
+
* // consume or destroy the stream to free the socket.
|
|
123
|
+
* const bytes = await response.events.transformToByteArray();
|
|
124
|
+
* // const str = await response.events.transformToString();
|
|
125
|
+
* // response.events.destroy(); // only applicable to Node.js Readable streams.
|
|
126
|
+
*
|
|
127
|
+
* /* response is
|
|
128
|
+
* { /* metadata only *\/ }
|
|
129
|
+
* *\/
|
|
130
|
+
* ```
|
|
131
|
+
*
|
|
132
|
+
* @public
|
|
133
|
+
*/
|
|
134
|
+
export declare class ResumeConversationStreamCommand extends ResumeConversationStreamCommand_base {
|
|
135
|
+
/** @internal type navigation helper, not in runtime. */
|
|
136
|
+
protected static __types: {
|
|
137
|
+
api: {
|
|
138
|
+
input: ResumeConversationStreamInput;
|
|
139
|
+
output: ResumeConversationStreamOutput;
|
|
140
|
+
};
|
|
141
|
+
sdk: {
|
|
142
|
+
input: ResumeConversationStreamCommandInput;
|
|
143
|
+
output: ResumeConversationStreamCommandOutput;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import type { MetadataBearer as __MetadataBearer, StreamingBlobPayloadOutputTypes } from "@smithy/types";
|
|
2
|
+
import type { SendMessageInput, SendMessageOutput } from "../models/models_0";
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export type { __MetadataBearer };
|
|
7
|
+
/**
|
|
8
|
+
* @public
|
|
9
|
+
*
|
|
10
|
+
* The input for {@link SendMessageCommand}.
|
|
11
|
+
*/
|
|
12
|
+
export interface SendMessageCommandInput extends SendMessageInput {
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @public
|
|
16
|
+
*
|
|
17
|
+
* The output of {@link SendMessageCommand}.
|
|
18
|
+
*/
|
|
19
|
+
export interface SendMessageCommandOutput extends Omit<SendMessageOutput, "events">, __MetadataBearer {
|
|
20
|
+
events: StreamingBlobPayloadOutputTypes;
|
|
21
|
+
}
|
|
22
|
+
declare const SendMessageCommand_base: {
|
|
23
|
+
new (input: SendMessageCommandInput): import("@smithy/core/client").CommandImpl<SendMessageCommandInput, SendMessageCommandOutput, import("..").CaitlynClientResolvedConfig, import("..").ServiceInputTypes, import("..").ServiceOutputTypes>;
|
|
24
|
+
new (input: SendMessageCommandInput): import("@smithy/core/client").CommandImpl<SendMessageCommandInput, SendMessageCommandOutput, import("..").CaitlynClientResolvedConfig, import("..").ServiceInputTypes, import("..").ServiceOutputTypes>;
|
|
25
|
+
getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Sends a message and streams the answer as server-sent events.
|
|
29
|
+
*
|
|
30
|
+
* The stream ends with exactly one `message.completed` or `message.failed`. If the connection
|
|
31
|
+
* drops, the SDK re-attaches with `ResumeConversationStream` and `Last-Event-ID`, so no event is
|
|
32
|
+
* lost or repeated. Not retried automatically: a send that fails before the stream starts is
|
|
33
|
+
* reported to the caller.
|
|
34
|
+
* @example
|
|
35
|
+
* Use a bare-bones client and the command you need to make an API call.
|
|
36
|
+
* ```javascript
|
|
37
|
+
* import { CaitlynClient, SendMessageCommand } from "@caitlyn-ai/sdk"; // ES Modules import
|
|
38
|
+
* // const { CaitlynClient, SendMessageCommand } = require("@caitlyn-ai/sdk"); // CommonJS import
|
|
39
|
+
* // import type { CaitlynClientConfig } from "@caitlyn-ai/sdk";
|
|
40
|
+
* const config = {}; // type is CaitlynClientConfig
|
|
41
|
+
* const client = new CaitlynClient(config);
|
|
42
|
+
* const input = { // SendMessageInput
|
|
43
|
+
* conversationId: "STRING_VALUE", // required
|
|
44
|
+
* message: "STRING_VALUE", // required
|
|
45
|
+
* context: [ // ContextItemList
|
|
46
|
+
* { // ContextItem
|
|
47
|
+
* type: "STRING_VALUE", // required
|
|
48
|
+
* label: "STRING_VALUE", // required
|
|
49
|
+
* uri: "STRING_VALUE",
|
|
50
|
+
* data: "DOCUMENT_VALUE",
|
|
51
|
+
* },
|
|
52
|
+
* ],
|
|
53
|
+
* };
|
|
54
|
+
* const command = new SendMessageCommand(input);
|
|
55
|
+
* const response = await client.send(command);
|
|
56
|
+
* // consume or destroy the stream to free the socket.
|
|
57
|
+
* const bytes = await response.events.transformToByteArray();
|
|
58
|
+
* // const str = await response.events.transformToString();
|
|
59
|
+
* // response.events.destroy(); // only applicable to Node.js Readable streams.
|
|
60
|
+
*
|
|
61
|
+
* // { // SendMessageOutput
|
|
62
|
+
* // requestId: "STRING_VALUE",
|
|
63
|
+
* // apiVersion: "STRING_VALUE",
|
|
64
|
+
* // events: "<SdkStream>", // see \@smithy/types -> StreamingBlobPayloadOutputTypes // required
|
|
65
|
+
* // };
|
|
66
|
+
*
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* @param SendMessageCommandInput - {@link SendMessageCommandInput}
|
|
70
|
+
* @returns {@link SendMessageCommandOutput}
|
|
71
|
+
* @see {@link SendMessageCommandInput} for command's `input` shape.
|
|
72
|
+
* @see {@link SendMessageCommandOutput} for command's `response` shape.
|
|
73
|
+
* @see {@link CaitlynClientResolvedConfig | config} for CaitlynClient's `config` shape.
|
|
74
|
+
*
|
|
75
|
+
* @throws {@link ConflictError} (client fault)
|
|
76
|
+
* The resource's state does not allow the request, a unique name is taken, or a request with the
|
|
77
|
+
* same idempotency key is still in progress.
|
|
78
|
+
*
|
|
79
|
+
* @throws {@link NotFoundError} (client fault)
|
|
80
|
+
* The record does not exist, or the caller may not see it. The two are deliberately the same, so
|
|
81
|
+
* identifiers cannot be probed.
|
|
82
|
+
*
|
|
83
|
+
* @throws {@link PayloadTooLargeError} (client fault)
|
|
84
|
+
* The body, a file or the send `context` is over its documented limit.
|
|
85
|
+
*
|
|
86
|
+
* @throws {@link InternalError} (server fault)
|
|
87
|
+
* An unexpected server failure. Not retried by the SDKs.
|
|
88
|
+
*
|
|
89
|
+
* @throws {@link PermissionDeniedError} (client fault)
|
|
90
|
+
* The caller may not call this operation: it lacks the permission, its credential type may not
|
|
91
|
+
* call it, or the operation is served only on the organisation's primary workspace. Decided before
|
|
92
|
+
* any record is read. A record the caller may not see is 404 instead.
|
|
93
|
+
*
|
|
94
|
+
* @throws {@link ServiceUnavailableError} (server fault)
|
|
95
|
+
* A dependency is briefly unavailable, or the request's audit event could not be recorded; wait for
|
|
96
|
+
* `Retry-After` and try again.
|
|
97
|
+
*
|
|
98
|
+
* @throws {@link TooManyRequestsError} (client fault)
|
|
99
|
+
* Too many requests; wait for `Retry-After` and try again.
|
|
100
|
+
*
|
|
101
|
+
* @throws {@link UnauthenticatedError} (client fault)
|
|
102
|
+
* No credential was sent, or it is expired or not valid.
|
|
103
|
+
*
|
|
104
|
+
* @throws {@link ValidationError} (client fault)
|
|
105
|
+
* The request is malformed: a member is missing, the wrong type or out of range; it has a member,
|
|
106
|
+
* filter or sort field the operation does not define; or its cursor is not valid for this list.
|
|
107
|
+
*
|
|
108
|
+
* @throws {@link CaitlynServiceException}
|
|
109
|
+
* <p>Base exception class for all service exceptions from Caitlyn service.</p>
|
|
110
|
+
*
|
|
111
|
+
*
|
|
112
|
+
* @example Ask a question
|
|
113
|
+
* ```javascript
|
|
114
|
+
* // The answer arrives as a stream of events; the example shows only the request.
|
|
115
|
+
* const input = {
|
|
116
|
+
* conversationId: "0193a6f2-7c4e-7b1a-9d2e-3f5a8c1b0e47",
|
|
117
|
+
* message: "How much annual leave do part-time staff get?"
|
|
118
|
+
* };
|
|
119
|
+
* const command = new SendMessageCommand(input);
|
|
120
|
+
* const response = await client.send(command);
|
|
121
|
+
* // consume or destroy the stream to free the socket.
|
|
122
|
+
* const bytes = await response.events.transformToByteArray();
|
|
123
|
+
* // const str = await response.events.transformToString();
|
|
124
|
+
* // response.events.destroy(); // only applicable to Node.js Readable streams.
|
|
125
|
+
*
|
|
126
|
+
* /* response is
|
|
127
|
+
* { /* metadata only *\/ }
|
|
128
|
+
* *\/
|
|
129
|
+
* ```
|
|
130
|
+
*
|
|
131
|
+
* @example A conversation that does not exist, or that the caller may not see
|
|
132
|
+
* ```javascript
|
|
133
|
+
* //
|
|
134
|
+
* const input = {
|
|
135
|
+
* conversationId: "0193a6f2-0000-7000-8000-000000000000",
|
|
136
|
+
* message: "Hello"
|
|
137
|
+
* };
|
|
138
|
+
* const command = new SendMessageCommand(input);
|
|
139
|
+
* const response = await client.send(command);
|
|
140
|
+
* // consume or destroy the stream to free the socket.
|
|
141
|
+
* const bytes = await response.events.transformToByteArray();
|
|
142
|
+
* // const str = await response.events.transformToString();
|
|
143
|
+
* // response.events.destroy(); // only applicable to Node.js Readable streams.
|
|
144
|
+
*
|
|
145
|
+
* /* response is
|
|
146
|
+
* { /* metadata only *\/ }
|
|
147
|
+
* *\/
|
|
148
|
+
* ```
|
|
149
|
+
*
|
|
150
|
+
* @example An answer is already being written
|
|
151
|
+
* ```javascript
|
|
152
|
+
* //
|
|
153
|
+
* const input = {
|
|
154
|
+
* conversationId: "0193a6f2-7c4e-7b1a-9d2e-3f5a8c1b0e47",
|
|
155
|
+
* message: "And for casual staff?"
|
|
156
|
+
* };
|
|
157
|
+
* const command = new SendMessageCommand(input);
|
|
158
|
+
* const response = await client.send(command);
|
|
159
|
+
* // consume or destroy the stream to free the socket.
|
|
160
|
+
* const bytes = await response.events.transformToByteArray();
|
|
161
|
+
* // const str = await response.events.transformToString();
|
|
162
|
+
* // response.events.destroy(); // only applicable to Node.js Readable streams.
|
|
163
|
+
*
|
|
164
|
+
* /* response is
|
|
165
|
+
* { /* metadata only *\/ }
|
|
166
|
+
* *\/
|
|
167
|
+
* ```
|
|
168
|
+
*
|
|
169
|
+
* @public
|
|
170
|
+
*/
|
|
171
|
+
export declare class SendMessageCommand extends SendMessageCommand_base {
|
|
172
|
+
/** @internal type navigation helper, not in runtime. */
|
|
173
|
+
protected static __types: {
|
|
174
|
+
api: {
|
|
175
|
+
input: SendMessageInput;
|
|
176
|
+
output: SendMessageOutput;
|
|
177
|
+
};
|
|
178
|
+
sdk: {
|
|
179
|
+
input: SendMessageCommandInput;
|
|
180
|
+
output: SendMessageCommandOutput;
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
}
|