@orq-ai/node 4.4.0-rc.9 → 4.5.0-rc.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/README.md +34 -54
- package/examples/package-lock.json +1 -1
- package/funcs/{conversationsRetrieve.d.ts → annotationsCreate.d.ts} +4 -8
- package/funcs/annotationsCreate.d.ts.map +1 -0
- package/funcs/{conversationsCreate.js → annotationsCreate.js} +21 -13
- package/funcs/annotationsCreate.js.map +1 -0
- package/funcs/{conversationsDelete.d.ts → annotationsDelete.d.ts} +4 -7
- package/funcs/annotationsDelete.d.ts.map +1 -0
- package/funcs/{conversationsCreateConversationResponse.js → annotationsDelete.js} +15 -25
- package/funcs/annotationsDelete.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/models/components/agentstartedstreamingevent.d.ts +9 -0
- package/models/components/agentstartedstreamingevent.d.ts.map +1 -1
- package/models/components/agentstartedstreamingevent.js +11 -1
- package/models/components/agentstartedstreamingevent.js.map +1 -1
- package/models/components/index.d.ts +0 -4
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +0 -4
- package/models/components/index.js.map +1 -1
- package/models/components/invokedeploymentrequest.d.ts +6 -6
- package/models/components/invokedeploymentrequest.d.ts.map +1 -1
- package/models/components/invokedeploymentrequest.js +6 -7
- package/models/components/invokedeploymentrequest.js.map +1 -1
- package/models/components/partdoneevent.js +1 -1
- package/models/components/reasoningpart.js +1 -1
- package/models/errors/index.d.ts +0 -4
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +0 -4
- package/models/errors/index.js.map +1 -1
- package/models/operations/createagentrequest.d.ts +1 -1
- package/models/operations/createagentrequest.d.ts.map +1 -1
- package/models/operations/createagentrequest.js +1 -1
- package/models/operations/createagentrequest.js.map +1 -1
- package/models/operations/createannotation.d.ts +71 -0
- package/models/operations/createannotation.d.ts.map +1 -0
- package/models/operations/createannotation.js +91 -0
- package/models/operations/createannotation.js.map +1 -0
- package/models/operations/createcontact.js +1 -1
- package/models/operations/createdataset.js +1 -1
- package/models/operations/createdatasetitem.js +4 -4
- package/models/operations/createdatasource.js +1 -1
- package/models/operations/createeval.d.ts +587 -186
- package/models/operations/createeval.d.ts.map +1 -1
- package/models/operations/createeval.js +673 -240
- package/models/operations/createeval.js.map +1 -1
- package/models/operations/createidentity.js +1 -1
- package/models/operations/createresponse.d.ts +3 -3
- package/models/operations/createresponse.d.ts.map +1 -1
- package/models/operations/createresponse.js +5 -5
- package/models/operations/createresponse.js.map +1 -1
- package/models/operations/createtool.js +6 -6
- package/models/operations/deleteannotation.d.ts +32 -0
- package/models/operations/deleteannotation.d.ts.map +1 -0
- package/models/operations/{deleteconversation.js → deleteannotation.js} +21 -8
- package/models/operations/deleteannotation.js.map +1 -0
- package/models/operations/fileget.js +1 -1
- package/models/operations/filelist.js +1 -1
- package/models/operations/fileupload.js +1 -1
- package/models/operations/getalltools.js +6 -6
- package/models/operations/getevals.d.ts +265 -104
- package/models/operations/getevals.d.ts.map +1 -1
- package/models/operations/getevals.js +389 -166
- package/models/operations/getevals.js.map +1 -1
- package/models/operations/index.d.ts +2 -7
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +2 -7
- package/models/operations/index.js.map +1 -1
- package/models/operations/invokeeval.d.ts +35 -0
- package/models/operations/invokeeval.d.ts.map +1 -1
- package/models/operations/invokeeval.js +54 -1
- package/models/operations/invokeeval.js.map +1 -1
- package/models/operations/listagents.d.ts +1 -1
- package/models/operations/listagents.d.ts.map +1 -1
- package/models/operations/listagents.js +1 -1
- package/models/operations/listagents.js.map +1 -1
- package/models/operations/listdatasetdatapoints.js +4 -4
- package/models/operations/listdatasets.js +1 -1
- package/models/operations/listdatasources.js +1 -1
- package/models/operations/listidentities.js +1 -1
- package/models/operations/retrieveagentrequest.d.ts +1 -1
- package/models/operations/retrieveagentrequest.d.ts.map +1 -1
- package/models/operations/retrieveagentrequest.js +1 -1
- package/models/operations/retrieveagentrequest.js.map +1 -1
- package/models/operations/retrievedatapoint.js +4 -4
- package/models/operations/retrievedataset.js +1 -1
- package/models/operations/retrievedatasource.js +1 -1
- package/models/operations/retrieveidentity.js +1 -1
- package/models/operations/retrievetool.js +6 -6
- package/models/operations/runagent.js +1 -1
- package/models/operations/streamrunagent.js +1 -1
- package/models/operations/updateagent.d.ts +1 -1
- package/models/operations/updateagent.d.ts.map +1 -1
- package/models/operations/updateagent.js +1 -1
- package/models/operations/updateagent.js.map +1 -1
- package/models/operations/updatedatapoint.js +4 -4
- package/models/operations/updatedataset.js +1 -1
- package/models/operations/updatedatasource.js +1 -1
- package/models/operations/updateeval.d.ts +349 -81
- package/models/operations/updateeval.d.ts.map +1 -1
- package/models/operations/updateeval.js +459 -143
- package/models/operations/updateeval.js.map +1 -1
- package/models/operations/updateidentity.js +1 -1
- package/models/operations/updatetool.js +7 -7
- package/package.json +1 -1
- package/sdk/annotations.d.ts +13 -0
- package/sdk/annotations.d.ts.map +1 -0
- package/sdk/annotations.js +26 -0
- package/sdk/annotations.js.map +1 -0
- package/sdk/sdk.d.ts +3 -6
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +4 -8
- package/sdk/sdk.js.map +1 -1
- package/src/funcs/{conversationsCreate.ts → annotationsCreate.ts} +28 -18
- package/src/funcs/{conversationsDelete.ts → annotationsDelete.ts} +23 -32
- package/src/lib/config.ts +3 -3
- package/src/models/components/agentstartedstreamingevent.ts +14 -0
- package/src/models/components/index.ts +0 -4
- package/src/models/components/invokedeploymentrequest.ts +10 -17
- package/src/models/components/partdoneevent.ts +1 -1
- package/src/models/components/reasoningpart.ts +1 -1
- package/src/models/errors/index.ts +0 -4
- package/src/models/operations/createagentrequest.ts +2 -2
- package/src/models/operations/createannotation.ts +162 -0
- package/src/models/operations/createcontact.ts +1 -1
- package/src/models/operations/createdataset.ts +1 -1
- package/src/models/operations/createdatasetitem.ts +4 -4
- package/src/models/operations/createdatasource.ts +1 -1
- package/src/models/operations/createeval.ts +1699 -657
- package/src/models/operations/createidentity.ts +1 -1
- package/src/models/operations/createresponse.ts +7 -7
- package/src/models/operations/createtool.ts +6 -6
- package/src/models/operations/deleteannotation.ts +79 -0
- package/src/models/operations/fileget.ts +1 -1
- package/src/models/operations/filelist.ts +1 -1
- package/src/models/operations/fileupload.ts +1 -1
- package/src/models/operations/getalltools.ts +6 -6
- package/src/models/operations/getevals.ts +1017 -505
- package/src/models/operations/index.ts +2 -7
- package/src/models/operations/invokeeval.ts +124 -0
- package/src/models/operations/listagents.ts +2 -2
- package/src/models/operations/listdatasetdatapoints.ts +4 -4
- package/src/models/operations/listdatasets.ts +1 -1
- package/src/models/operations/listdatasources.ts +1 -1
- package/src/models/operations/listidentities.ts +1 -1
- package/src/models/operations/retrieveagentrequest.ts +2 -2
- package/src/models/operations/retrievedatapoint.ts +4 -4
- package/src/models/operations/retrievedataset.ts +1 -1
- package/src/models/operations/retrievedatasource.ts +1 -1
- package/src/models/operations/retrieveidentity.ts +1 -1
- package/src/models/operations/retrievetool.ts +6 -6
- package/src/models/operations/runagent.ts +1 -1
- package/src/models/operations/streamrunagent.ts +1 -1
- package/src/models/operations/updateagent.ts +2 -2
- package/src/models/operations/updatedatapoint.ts +4 -4
- package/src/models/operations/updatedataset.ts +1 -1
- package/src/models/operations/updatedatasource.ts +1 -1
- package/src/models/operations/updateeval.ts +1092 -329
- package/src/models/operations/updateidentity.ts +1 -1
- package/src/models/operations/updatetool.ts +7 -7
- package/src/sdk/annotations.ts +39 -0
- package/src/sdk/sdk.ts +6 -12
- package/funcs/conversationsCreate.d.ts +0 -17
- package/funcs/conversationsCreate.d.ts.map +0 -1
- package/funcs/conversationsCreate.js.map +0 -1
- package/funcs/conversationsCreateConversationResponse.d.ts +0 -18
- package/funcs/conversationsCreateConversationResponse.d.ts.map +0 -1
- package/funcs/conversationsCreateConversationResponse.js.map +0 -1
- package/funcs/conversationsDelete.d.ts.map +0 -1
- package/funcs/conversationsDelete.js +0 -127
- package/funcs/conversationsDelete.js.map +0 -1
- package/funcs/conversationsGenerateName.d.ts +0 -18
- package/funcs/conversationsGenerateName.d.ts.map +0 -1
- package/funcs/conversationsGenerateName.js +0 -128
- package/funcs/conversationsGenerateName.js.map +0 -1
- package/funcs/conversationsList.d.ts +0 -17
- package/funcs/conversationsList.d.ts.map +0 -1
- package/funcs/conversationsList.js +0 -126
- package/funcs/conversationsList.js.map +0 -1
- package/funcs/conversationsRetrieve.d.ts.map +0 -1
- package/funcs/conversationsRetrieve.js +0 -127
- package/funcs/conversationsRetrieve.js.map +0 -1
- package/funcs/conversationsUpdate.d.ts +0 -18
- package/funcs/conversationsUpdate.d.ts.map +0 -1
- package/funcs/conversationsUpdate.js +0 -128
- package/funcs/conversationsUpdate.js.map +0 -1
- package/models/components/conversationresponse.d.ts +0 -74
- package/models/components/conversationresponse.d.ts.map +0 -1
- package/models/components/conversationresponse.js +0 -80
- package/models/components/conversationresponse.js.map +0 -1
- package/models/components/conversationwithmessagesresponse.d.ts +0 -79
- package/models/components/conversationwithmessagesresponse.d.ts.map +0 -1
- package/models/components/conversationwithmessagesresponse.js +0 -83
- package/models/components/conversationwithmessagesresponse.js.map +0 -1
- package/models/components/messageresponse.d.ts +0 -58
- package/models/components/messageresponse.d.ts.map +0 -1
- package/models/components/messageresponse.js +0 -89
- package/models/components/messageresponse.js.map +0 -1
- package/models/components/usermessagerequest.d.ts +0 -54
- package/models/components/usermessagerequest.d.ts.map +0 -1
- package/models/components/usermessagerequest.js +0 -79
- package/models/components/usermessagerequest.js.map +0 -1
- package/models/errors/deleteconversation.d.ts +0 -23
- package/models/errors/deleteconversation.d.ts.map +0 -1
- package/models/errors/deleteconversation.js +0 -68
- package/models/errors/deleteconversation.js.map +0 -1
- package/models/errors/generateconversationname.d.ts +0 -43
- package/models/errors/generateconversationname.d.ts.map +0 -1
- package/models/errors/generateconversationname.js +0 -94
- package/models/errors/generateconversationname.js.map +0 -1
- package/models/errors/retrieveconversation.d.ts +0 -23
- package/models/errors/retrieveconversation.d.ts.map +0 -1
- package/models/errors/retrieveconversation.js +0 -68
- package/models/errors/retrieveconversation.js.map +0 -1
- package/models/errors/updateconversation.d.ts +0 -23
- package/models/errors/updateconversation.d.ts.map +0 -1
- package/models/errors/updateconversation.js +0 -68
- package/models/errors/updateconversation.js.map +0 -1
- package/models/operations/createconversation.d.ts +0 -126
- package/models/operations/createconversation.d.ts.map +0 -1
- package/models/operations/createconversation.js +0 -101
- package/models/operations/createconversation.js.map +0 -1
- package/models/operations/createconversationresponse.d.ts +0 -209
- package/models/operations/createconversationresponse.d.ts.map +0 -1
- package/models/operations/createconversationresponse.js +0 -217
- package/models/operations/createconversationresponse.js.map +0 -1
- package/models/operations/deleteconversation.d.ts +0 -15
- package/models/operations/deleteconversation.d.ts.map +0 -1
- package/models/operations/deleteconversation.js.map +0 -1
- package/models/operations/generateconversationname.d.ts +0 -105
- package/models/operations/generateconversationname.d.ts.map +0 -1
- package/models/operations/generateconversationname.js +0 -103
- package/models/operations/generateconversationname.js.map +0 -1
- package/models/operations/listconversations.d.ts +0 -51
- package/models/operations/listconversations.d.ts.map +0 -1
- package/models/operations/listconversations.js +0 -74
- package/models/operations/listconversations.js.map +0 -1
- package/models/operations/retrieveconversation.d.ts +0 -15
- package/models/operations/retrieveconversation.d.ts.map +0 -1
- package/models/operations/retrieveconversation.js +0 -54
- package/models/operations/retrieveconversation.js.map +0 -1
- package/models/operations/updateconversation.d.ts +0 -131
- package/models/operations/updateconversation.d.ts.map +0 -1
- package/models/operations/updateconversation.js +0 -113
- package/models/operations/updateconversation.js.map +0 -1
- package/sdk/conversations.d.ts +0 -56
- package/sdk/conversations.d.ts.map +0 -1
- package/sdk/conversations.js +0 -82
- package/sdk/conversations.js.map +0 -1
- package/sdk/internal.d.ts +0 -13
- package/sdk/internal.d.ts.map +0 -1
- package/sdk/internal.js +0 -22
- package/sdk/internal.js.map +0 -1
- package/src/funcs/conversationsCreateConversationResponse.ts +0 -186
- package/src/funcs/conversationsGenerateName.ts +0 -194
- package/src/funcs/conversationsList.ts +0 -186
- package/src/funcs/conversationsRetrieve.ts +0 -181
- package/src/funcs/conversationsUpdate.ts +0 -184
- package/src/models/components/conversationresponse.ts +0 -132
- package/src/models/components/conversationwithmessagesresponse.ts +0 -149
- package/src/models/components/messageresponse.ts +0 -127
- package/src/models/components/usermessagerequest.ts +0 -136
- package/src/models/errors/deleteconversation.ts +0 -51
- package/src/models/errors/generateconversationname.ts +0 -99
- package/src/models/errors/retrieveconversation.ts +0 -51
- package/src/models/errors/updateconversation.ts +0 -51
- package/src/models/operations/createconversation.ts +0 -227
- package/src/models/operations/createconversationresponse.ts +0 -498
- package/src/models/operations/deleteconversation.ts +0 -39
- package/src/models/operations/generateconversationname.ts +0 -207
- package/src/models/operations/listconversations.ts +0 -104
- package/src/models/operations/retrieveconversation.ts +0 -41
- package/src/models/operations/updateconversation.ts +0 -252
- package/src/sdk/conversations.ts +0 -147
- package/src/sdk/internal.ts +0 -28
package/sdk/conversations.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Conversations = void 0;
|
|
7
|
-
const conversationsCreate_js_1 = require("../funcs/conversationsCreate.js");
|
|
8
|
-
const conversationsCreateConversationResponse_js_1 = require("../funcs/conversationsCreateConversationResponse.js");
|
|
9
|
-
const conversationsDelete_js_1 = require("../funcs/conversationsDelete.js");
|
|
10
|
-
const conversationsGenerateName_js_1 = require("../funcs/conversationsGenerateName.js");
|
|
11
|
-
const conversationsList_js_1 = require("../funcs/conversationsList.js");
|
|
12
|
-
const conversationsRetrieve_js_1 = require("../funcs/conversationsRetrieve.js");
|
|
13
|
-
const conversationsUpdate_js_1 = require("../funcs/conversationsUpdate.js");
|
|
14
|
-
const sdks_js_1 = require("../lib/sdks.js");
|
|
15
|
-
const fp_js_1 = require("../types/fp.js");
|
|
16
|
-
class Conversations extends sdks_js_1.ClientSDK {
|
|
17
|
-
/**
|
|
18
|
-
* List conversations
|
|
19
|
-
*
|
|
20
|
-
* @remarks
|
|
21
|
-
* Retrieves a paginated list of conversations in your workspace. Conversations are returned sorted by creation date (newest first). Use pagination parameters to efficiently navigate through large collections.
|
|
22
|
-
*/
|
|
23
|
-
async list(limit, startingAfter, endingBefore, entityId, options) {
|
|
24
|
-
return (0, fp_js_1.unwrapAsync)((0, conversationsList_js_1.conversationsList)(this, limit, startingAfter, endingBefore, entityId, options));
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Create conversation
|
|
28
|
-
*
|
|
29
|
-
* @remarks
|
|
30
|
-
* Creates a new conversation in the workspace. Conversations serve as containers for organizing related messages and interactions. Each conversation is assigned a unique identifier and timestamps for tracking.
|
|
31
|
-
*/
|
|
32
|
-
async create(request, options) {
|
|
33
|
-
return (0, fp_js_1.unwrapAsync)((0, conversationsCreate_js_1.conversationsCreate)(this, request, options));
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Generate conversation name
|
|
37
|
-
*
|
|
38
|
-
* @remarks
|
|
39
|
-
* Generates a display name for a conversation using AI based on the provided context. Updates the conversation with the generated name and sets generatingTitle to false.
|
|
40
|
-
*/
|
|
41
|
-
async generateName(requestBody, conversationId, options) {
|
|
42
|
-
return (0, fp_js_1.unwrapAsync)((0, conversationsGenerateName_js_1.conversationsGenerateName)(this, requestBody, conversationId, options));
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Retrieve conversation
|
|
46
|
-
*
|
|
47
|
-
* @remarks
|
|
48
|
-
* Retrieves detailed information about a specific conversation identified by its unique ID. Returns the complete conversation object including metadata and timestamps.
|
|
49
|
-
*/
|
|
50
|
-
async retrieve(conversationId, options) {
|
|
51
|
-
return (0, fp_js_1.unwrapAsync)((0, conversationsRetrieve_js_1.conversationsRetrieve)(this, conversationId, options));
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Update conversation
|
|
55
|
-
*
|
|
56
|
-
* @remarks
|
|
57
|
-
* Modifies an existing conversation's properties. Only the fields provided in the request body will be updated; all other fields remain unchanged. Changes are applied immediately.
|
|
58
|
-
*/
|
|
59
|
-
async update(requestBody, conversationId, options) {
|
|
60
|
-
return (0, fp_js_1.unwrapAsync)((0, conversationsUpdate_js_1.conversationsUpdate)(this, requestBody, conversationId, options));
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Delete conversation
|
|
64
|
-
*
|
|
65
|
-
* @remarks
|
|
66
|
-
* Permanently removes a conversation from the workspace
|
|
67
|
-
*/
|
|
68
|
-
async delete(conversationId, options) {
|
|
69
|
-
return (0, fp_js_1.unwrapAsync)((0, conversationsDelete_js_1.conversationsDelete)(this, conversationId, options));
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Create internal response
|
|
73
|
-
*
|
|
74
|
-
* @remarks
|
|
75
|
-
* Creates a response for a freeform conversation without an agent. Uses a default model for generation.
|
|
76
|
-
*/
|
|
77
|
-
async createConversationResponse(request, options) {
|
|
78
|
-
return (0, fp_js_1.unwrapAsync)((0, conversationsCreateConversationResponse_js_1.conversationsCreateConversationResponse)(this, request, options));
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
exports.Conversations = Conversations;
|
|
82
|
-
//# sourceMappingURL=conversations.js.map
|
package/sdk/conversations.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"conversations.js","sourceRoot":"","sources":["../src/sdk/conversations.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,4EAAsE;AACtE,oHAA8G;AAC9G,4EAAsE;AACtE,wFAAkF;AAClF,wEAAkE;AAClE,gFAA0E;AAC1E,4EAAsE;AAEtE,4CAA2D;AAG3D,0CAA6C;AAE7C,MAAa,aAAc,SAAQ,mBAAS;IAC1C;;;;;OAKG;IACH,KAAK,CAAC,IAAI,CACR,KAA0B,EAC1B,aAAkC,EAClC,YAAiC,EACjC,QAA6B,EAC7B,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,wCAAiB,EAClC,IAAI,EACJ,KAAK,EACL,aAAa,EACb,YAAY,EACZ,QAAQ,EACR,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CACV,OAAiD,EACjD,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,4CAAmB,EACpC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,YAAY,CAChB,WAA2D,EAC3D,cAAsB,EACtB,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,wDAAyB,EAC1C,IAAI,EACJ,WAAW,EACX,cAAc,EACd,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,QAAQ,CACZ,cAAsB,EACtB,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,gDAAqB,EACtC,IAAI,EACJ,cAAc,EACd,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CACV,WAAqD,EACrD,cAAsB,EACtB,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,4CAAmB,EACpC,IAAI,EACJ,WAAW,EACX,cAAc,EACd,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CACV,cAAsB,EACtB,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,4CAAmB,EACpC,IAAI,EACJ,cAAc,EACd,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,0BAA0B,CAC9B,OAAqD,EACrD,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,oFAAuC,EACxD,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF;AAjID,sCAiIC"}
|
package/sdk/internal.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { EventStream } from "../lib/event-streams.js";
|
|
2
|
-
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
3
|
-
import * as operations from "../models/operations/index.js";
|
|
4
|
-
export declare class Internal extends ClientSDK {
|
|
5
|
-
/**
|
|
6
|
-
* Create internal response
|
|
7
|
-
*
|
|
8
|
-
* @remarks
|
|
9
|
-
* Creates a response for a freeform conversation without an agent. Uses a default model for generation.
|
|
10
|
-
*/
|
|
11
|
-
createConversationResponse(request: operations.CreateConversationResponseRequest, options?: RequestOptions): Promise<EventStream<operations.CreateConversationResponseResponseBody>>;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=internal.d.ts.map
|
package/sdk/internal.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/sdk/internal.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,QAAS,SAAQ,SAAS;IACrC;;;;;OAKG;IACG,0BAA0B,CAC9B,OAAO,EAAE,UAAU,CAAC,iCAAiC,EACrD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,sCAAsC,CAAC,CAAC;CAO3E"}
|
package/sdk/internal.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Internal = void 0;
|
|
7
|
-
const conversationsCreateConversationResponse_js_1 = require("../funcs/conversationsCreateConversationResponse.js");
|
|
8
|
-
const sdks_js_1 = require("../lib/sdks.js");
|
|
9
|
-
const fp_js_1 = require("../types/fp.js");
|
|
10
|
-
class Internal extends sdks_js_1.ClientSDK {
|
|
11
|
-
/**
|
|
12
|
-
* Create internal response
|
|
13
|
-
*
|
|
14
|
-
* @remarks
|
|
15
|
-
* Creates a response for a freeform conversation without an agent. Uses a default model for generation.
|
|
16
|
-
*/
|
|
17
|
-
async createConversationResponse(request, options) {
|
|
18
|
-
return (0, fp_js_1.unwrapAsync)((0, conversationsCreateConversationResponse_js_1.conversationsCreateConversationResponse)(this, request, options));
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
exports.Internal = Internal;
|
|
22
|
-
//# sourceMappingURL=internal.js.map
|
package/sdk/internal.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/sdk/internal.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,oHAA8G;AAE9G,4CAA2D;AAE3D,0CAA6C;AAE7C,MAAa,QAAS,SAAQ,mBAAS;IACrC;;;;;OAKG;IACH,KAAK,CAAC,0BAA0B,CAC9B,OAAqD,EACrD,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,oFAAuC,EACxD,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF;AAjBD,4BAiBC"}
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as z from "zod/v3";
|
|
6
|
-
import { OrqCore } from "../core.js";
|
|
7
|
-
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
8
|
-
import { EventStream } from "../lib/event-streams.js";
|
|
9
|
-
import * as M from "../lib/matchers.js";
|
|
10
|
-
import { compactMap } from "../lib/primitives.js";
|
|
11
|
-
import { safeParse } from "../lib/schemas.js";
|
|
12
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
13
|
-
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
14
|
-
import { pathToFunc } from "../lib/url.js";
|
|
15
|
-
import {
|
|
16
|
-
ConnectionError,
|
|
17
|
-
InvalidRequestError,
|
|
18
|
-
RequestAbortedError,
|
|
19
|
-
RequestTimeoutError,
|
|
20
|
-
UnexpectedClientError,
|
|
21
|
-
} from "../models/errors/httpclienterrors.js";
|
|
22
|
-
import { OrqError } from "../models/errors/orqerror.js";
|
|
23
|
-
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
-
import * as operations from "../models/operations/index.js";
|
|
26
|
-
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
-
import { Result } from "../types/fp.js";
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Create internal response
|
|
31
|
-
*
|
|
32
|
-
* @remarks
|
|
33
|
-
* Creates a response for a freeform conversation without an agent. Uses a default model for generation.
|
|
34
|
-
*/
|
|
35
|
-
export function conversationsCreateConversationResponse(
|
|
36
|
-
client: OrqCore,
|
|
37
|
-
request: operations.CreateConversationResponseRequest,
|
|
38
|
-
options?: RequestOptions,
|
|
39
|
-
): APIPromise<
|
|
40
|
-
Result<
|
|
41
|
-
EventStream<operations.CreateConversationResponseResponseBody>,
|
|
42
|
-
| OrqError
|
|
43
|
-
| ResponseValidationError
|
|
44
|
-
| ConnectionError
|
|
45
|
-
| RequestAbortedError
|
|
46
|
-
| RequestTimeoutError
|
|
47
|
-
| InvalidRequestError
|
|
48
|
-
| UnexpectedClientError
|
|
49
|
-
| SDKValidationError
|
|
50
|
-
>
|
|
51
|
-
> {
|
|
52
|
-
return new APIPromise($do(
|
|
53
|
-
client,
|
|
54
|
-
request,
|
|
55
|
-
options,
|
|
56
|
-
));
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
async function $do(
|
|
60
|
-
client: OrqCore,
|
|
61
|
-
request: operations.CreateConversationResponseRequest,
|
|
62
|
-
options?: RequestOptions,
|
|
63
|
-
): Promise<
|
|
64
|
-
[
|
|
65
|
-
Result<
|
|
66
|
-
EventStream<operations.CreateConversationResponseResponseBody>,
|
|
67
|
-
| OrqError
|
|
68
|
-
| ResponseValidationError
|
|
69
|
-
| ConnectionError
|
|
70
|
-
| RequestAbortedError
|
|
71
|
-
| RequestTimeoutError
|
|
72
|
-
| InvalidRequestError
|
|
73
|
-
| UnexpectedClientError
|
|
74
|
-
| SDKValidationError
|
|
75
|
-
>,
|
|
76
|
-
APICall,
|
|
77
|
-
]
|
|
78
|
-
> {
|
|
79
|
-
const parsed = safeParse(
|
|
80
|
-
request,
|
|
81
|
-
(value) =>
|
|
82
|
-
operations.CreateConversationResponseRequest$outboundSchema.parse(value),
|
|
83
|
-
"Input validation failed",
|
|
84
|
-
);
|
|
85
|
-
if (!parsed.ok) {
|
|
86
|
-
return [parsed, { status: "invalid" }];
|
|
87
|
-
}
|
|
88
|
-
const payload = parsed.value;
|
|
89
|
-
const body = encodeJSON("body", payload.RequestBody, { explode: true });
|
|
90
|
-
|
|
91
|
-
const pathParams = {
|
|
92
|
-
conversation_id: encodeSimple("conversation_id", payload.conversation_id, {
|
|
93
|
-
explode: false,
|
|
94
|
-
charEncoding: "percent",
|
|
95
|
-
}),
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
const path = pathToFunc("/v2/conversations/{conversation_id}/responses")(
|
|
99
|
-
pathParams,
|
|
100
|
-
);
|
|
101
|
-
|
|
102
|
-
const headers = new Headers(compactMap({
|
|
103
|
-
"Content-Type": "application/json",
|
|
104
|
-
Accept: "text/event-stream",
|
|
105
|
-
}));
|
|
106
|
-
|
|
107
|
-
const secConfig = await extractSecurity(client._options.apiKey);
|
|
108
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
109
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
110
|
-
|
|
111
|
-
const context = {
|
|
112
|
-
options: client._options,
|
|
113
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
114
|
-
operationID: "CreateConversationResponse",
|
|
115
|
-
oAuth2Scopes: null,
|
|
116
|
-
|
|
117
|
-
resolvedSecurity: requestSecurity,
|
|
118
|
-
|
|
119
|
-
securitySource: client._options.apiKey,
|
|
120
|
-
retryConfig: options?.retries
|
|
121
|
-
|| client._options.retryConfig
|
|
122
|
-
|| { strategy: "none" },
|
|
123
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
const requestRes = client._createRequest(context, {
|
|
127
|
-
security: requestSecurity,
|
|
128
|
-
method: "POST",
|
|
129
|
-
baseURL: options?.serverURL,
|
|
130
|
-
path: path,
|
|
131
|
-
headers: headers,
|
|
132
|
-
body: body,
|
|
133
|
-
userAgent: client._options.userAgent,
|
|
134
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
135
|
-
}, options);
|
|
136
|
-
if (!requestRes.ok) {
|
|
137
|
-
return [requestRes, { status: "invalid" }];
|
|
138
|
-
}
|
|
139
|
-
const req = requestRes.value;
|
|
140
|
-
|
|
141
|
-
const doResult = await client._do(req, {
|
|
142
|
-
context,
|
|
143
|
-
errorCodes: ["4XX", "5XX"],
|
|
144
|
-
retryConfig: context.retryConfig,
|
|
145
|
-
retryCodes: context.retryCodes,
|
|
146
|
-
});
|
|
147
|
-
if (!doResult.ok) {
|
|
148
|
-
return [doResult, { status: "request-error", request: req }];
|
|
149
|
-
}
|
|
150
|
-
const response = doResult.value;
|
|
151
|
-
|
|
152
|
-
const [result] = await M.match<
|
|
153
|
-
EventStream<operations.CreateConversationResponseResponseBody>,
|
|
154
|
-
| OrqError
|
|
155
|
-
| ResponseValidationError
|
|
156
|
-
| ConnectionError
|
|
157
|
-
| RequestAbortedError
|
|
158
|
-
| RequestTimeoutError
|
|
159
|
-
| InvalidRequestError
|
|
160
|
-
| UnexpectedClientError
|
|
161
|
-
| SDKValidationError
|
|
162
|
-
>(
|
|
163
|
-
M.sse(
|
|
164
|
-
200,
|
|
165
|
-
z.instanceof(ReadableStream<Uint8Array>)
|
|
166
|
-
.transform(stream => {
|
|
167
|
-
return new EventStream(stream, rawEvent => {
|
|
168
|
-
if (rawEvent.data === "[DONE]") return { done: true };
|
|
169
|
-
return {
|
|
170
|
-
value: operations
|
|
171
|
-
.CreateConversationResponseResponseBody$inboundSchema.parse(
|
|
172
|
-
rawEvent,
|
|
173
|
-
),
|
|
174
|
-
};
|
|
175
|
-
});
|
|
176
|
-
}),
|
|
177
|
-
),
|
|
178
|
-
M.fail("4XX"),
|
|
179
|
-
M.fail("5XX"),
|
|
180
|
-
)(response, req);
|
|
181
|
-
if (!result.ok) {
|
|
182
|
-
return [result, { status: "complete", request: req, response }];
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
return [result, { status: "complete", request: req, response }];
|
|
186
|
-
}
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { OrqCore } from "../core.js";
|
|
6
|
-
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
-
import * as M from "../lib/matchers.js";
|
|
8
|
-
import { compactMap } from "../lib/primitives.js";
|
|
9
|
-
import { safeParse } from "../lib/schemas.js";
|
|
10
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
-
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
-
import { pathToFunc } from "../lib/url.js";
|
|
13
|
-
import {
|
|
14
|
-
ConnectionError,
|
|
15
|
-
InvalidRequestError,
|
|
16
|
-
RequestAbortedError,
|
|
17
|
-
RequestTimeoutError,
|
|
18
|
-
UnexpectedClientError,
|
|
19
|
-
} from "../models/errors/httpclienterrors.js";
|
|
20
|
-
import * as errors from "../models/errors/index.js";
|
|
21
|
-
import { OrqError } from "../models/errors/orqerror.js";
|
|
22
|
-
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
23
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
-
import * as operations from "../models/operations/index.js";
|
|
25
|
-
import { APICall, APIPromise } from "../types/async.js";
|
|
26
|
-
import { Result } from "../types/fp.js";
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Generate conversation name
|
|
30
|
-
*
|
|
31
|
-
* @remarks
|
|
32
|
-
* Generates a display name for a conversation using AI based on the provided context. Updates the conversation with the generated name and sets generatingTitle to false.
|
|
33
|
-
*/
|
|
34
|
-
export function conversationsGenerateName(
|
|
35
|
-
client: OrqCore,
|
|
36
|
-
requestBody: operations.GenerateConversationNameRequestBody,
|
|
37
|
-
conversationId: string,
|
|
38
|
-
options?: RequestOptions,
|
|
39
|
-
): APIPromise<
|
|
40
|
-
Result<
|
|
41
|
-
operations.GenerateConversationNameResponseBody,
|
|
42
|
-
| errors.GenerateConversationNameResponseBody
|
|
43
|
-
| errors.GenerateConversationNameConversationsResponseBody
|
|
44
|
-
| OrqError
|
|
45
|
-
| ResponseValidationError
|
|
46
|
-
| ConnectionError
|
|
47
|
-
| RequestAbortedError
|
|
48
|
-
| RequestTimeoutError
|
|
49
|
-
| InvalidRequestError
|
|
50
|
-
| UnexpectedClientError
|
|
51
|
-
| SDKValidationError
|
|
52
|
-
>
|
|
53
|
-
> {
|
|
54
|
-
return new APIPromise($do(
|
|
55
|
-
client,
|
|
56
|
-
requestBody,
|
|
57
|
-
conversationId,
|
|
58
|
-
options,
|
|
59
|
-
));
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
async function $do(
|
|
63
|
-
client: OrqCore,
|
|
64
|
-
requestBody: operations.GenerateConversationNameRequestBody,
|
|
65
|
-
conversationId: string,
|
|
66
|
-
options?: RequestOptions,
|
|
67
|
-
): Promise<
|
|
68
|
-
[
|
|
69
|
-
Result<
|
|
70
|
-
operations.GenerateConversationNameResponseBody,
|
|
71
|
-
| errors.GenerateConversationNameResponseBody
|
|
72
|
-
| errors.GenerateConversationNameConversationsResponseBody
|
|
73
|
-
| OrqError
|
|
74
|
-
| ResponseValidationError
|
|
75
|
-
| ConnectionError
|
|
76
|
-
| RequestAbortedError
|
|
77
|
-
| RequestTimeoutError
|
|
78
|
-
| InvalidRequestError
|
|
79
|
-
| UnexpectedClientError
|
|
80
|
-
| SDKValidationError
|
|
81
|
-
>,
|
|
82
|
-
APICall,
|
|
83
|
-
]
|
|
84
|
-
> {
|
|
85
|
-
const input: operations.GenerateConversationNameRequest = {
|
|
86
|
-
requestBody: requestBody,
|
|
87
|
-
conversationId: conversationId,
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
const parsed = safeParse(
|
|
91
|
-
input,
|
|
92
|
-
(value) =>
|
|
93
|
-
operations.GenerateConversationNameRequest$outboundSchema.parse(value),
|
|
94
|
-
"Input validation failed",
|
|
95
|
-
);
|
|
96
|
-
if (!parsed.ok) {
|
|
97
|
-
return [parsed, { status: "invalid" }];
|
|
98
|
-
}
|
|
99
|
-
const payload = parsed.value;
|
|
100
|
-
const body = encodeJSON("body", payload.RequestBody, { explode: true });
|
|
101
|
-
|
|
102
|
-
const pathParams = {
|
|
103
|
-
conversation_id: encodeSimple("conversation_id", payload.conversation_id, {
|
|
104
|
-
explode: false,
|
|
105
|
-
charEncoding: "percent",
|
|
106
|
-
}),
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
const path = pathToFunc("/v2/conversations/{conversation_id}/generate-name")(
|
|
110
|
-
pathParams,
|
|
111
|
-
);
|
|
112
|
-
|
|
113
|
-
const headers = new Headers(compactMap({
|
|
114
|
-
"Content-Type": "application/json",
|
|
115
|
-
Accept: "application/json",
|
|
116
|
-
}));
|
|
117
|
-
|
|
118
|
-
const secConfig = await extractSecurity(client._options.apiKey);
|
|
119
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
120
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
121
|
-
|
|
122
|
-
const context = {
|
|
123
|
-
options: client._options,
|
|
124
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
125
|
-
operationID: "GenerateConversationName",
|
|
126
|
-
oAuth2Scopes: null,
|
|
127
|
-
|
|
128
|
-
resolvedSecurity: requestSecurity,
|
|
129
|
-
|
|
130
|
-
securitySource: client._options.apiKey,
|
|
131
|
-
retryConfig: options?.retries
|
|
132
|
-
|| client._options.retryConfig
|
|
133
|
-
|| { strategy: "none" },
|
|
134
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
const requestRes = client._createRequest(context, {
|
|
138
|
-
security: requestSecurity,
|
|
139
|
-
method: "POST",
|
|
140
|
-
baseURL: options?.serverURL,
|
|
141
|
-
path: path,
|
|
142
|
-
headers: headers,
|
|
143
|
-
body: body,
|
|
144
|
-
userAgent: client._options.userAgent,
|
|
145
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
146
|
-
}, options);
|
|
147
|
-
if (!requestRes.ok) {
|
|
148
|
-
return [requestRes, { status: "invalid" }];
|
|
149
|
-
}
|
|
150
|
-
const req = requestRes.value;
|
|
151
|
-
|
|
152
|
-
const doResult = await client._do(req, {
|
|
153
|
-
context,
|
|
154
|
-
errorCodes: ["400", "404", "4XX", "5XX"],
|
|
155
|
-
retryConfig: context.retryConfig,
|
|
156
|
-
retryCodes: context.retryCodes,
|
|
157
|
-
});
|
|
158
|
-
if (!doResult.ok) {
|
|
159
|
-
return [doResult, { status: "request-error", request: req }];
|
|
160
|
-
}
|
|
161
|
-
const response = doResult.value;
|
|
162
|
-
|
|
163
|
-
const responseFields = {
|
|
164
|
-
HttpMeta: { Response: response, Request: req },
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
const [result] = await M.match<
|
|
168
|
-
operations.GenerateConversationNameResponseBody,
|
|
169
|
-
| errors.GenerateConversationNameResponseBody
|
|
170
|
-
| errors.GenerateConversationNameConversationsResponseBody
|
|
171
|
-
| OrqError
|
|
172
|
-
| ResponseValidationError
|
|
173
|
-
| ConnectionError
|
|
174
|
-
| RequestAbortedError
|
|
175
|
-
| RequestTimeoutError
|
|
176
|
-
| InvalidRequestError
|
|
177
|
-
| UnexpectedClientError
|
|
178
|
-
| SDKValidationError
|
|
179
|
-
>(
|
|
180
|
-
M.json(200, operations.GenerateConversationNameResponseBody$inboundSchema),
|
|
181
|
-
M.jsonErr(400, errors.GenerateConversationNameResponseBody$inboundSchema),
|
|
182
|
-
M.jsonErr(
|
|
183
|
-
404,
|
|
184
|
-
errors.GenerateConversationNameConversationsResponseBody$inboundSchema,
|
|
185
|
-
),
|
|
186
|
-
M.fail("4XX"),
|
|
187
|
-
M.fail("5XX"),
|
|
188
|
-
)(response, req, { extraFields: responseFields });
|
|
189
|
-
if (!result.ok) {
|
|
190
|
-
return [result, { status: "complete", request: req, response }];
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
return [result, { status: "complete", request: req, response }];
|
|
194
|
-
}
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { OrqCore } from "../core.js";
|
|
6
|
-
import { encodeFormQuery } from "../lib/encodings.js";
|
|
7
|
-
import * as M from "../lib/matchers.js";
|
|
8
|
-
import { compactMap } from "../lib/primitives.js";
|
|
9
|
-
import { safeParse } from "../lib/schemas.js";
|
|
10
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
-
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
-
import { pathToFunc } from "../lib/url.js";
|
|
13
|
-
import {
|
|
14
|
-
ConnectionError,
|
|
15
|
-
InvalidRequestError,
|
|
16
|
-
RequestAbortedError,
|
|
17
|
-
RequestTimeoutError,
|
|
18
|
-
UnexpectedClientError,
|
|
19
|
-
} from "../models/errors/httpclienterrors.js";
|
|
20
|
-
import { OrqError } from "../models/errors/orqerror.js";
|
|
21
|
-
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
22
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
|
-
import * as operations from "../models/operations/index.js";
|
|
24
|
-
import { APICall, APIPromise } from "../types/async.js";
|
|
25
|
-
import { Result } from "../types/fp.js";
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* List conversations
|
|
29
|
-
*
|
|
30
|
-
* @remarks
|
|
31
|
-
* Retrieves a paginated list of conversations in your workspace. Conversations are returned sorted by creation date (newest first). Use pagination parameters to efficiently navigate through large collections.
|
|
32
|
-
*/
|
|
33
|
-
export function conversationsList(
|
|
34
|
-
client: OrqCore,
|
|
35
|
-
limit?: number | undefined,
|
|
36
|
-
startingAfter?: string | undefined,
|
|
37
|
-
endingBefore?: string | undefined,
|
|
38
|
-
entityId?: string | undefined,
|
|
39
|
-
options?: RequestOptions,
|
|
40
|
-
): APIPromise<
|
|
41
|
-
Result<
|
|
42
|
-
operations.ListConversationsResponseBody,
|
|
43
|
-
| OrqError
|
|
44
|
-
| ResponseValidationError
|
|
45
|
-
| ConnectionError
|
|
46
|
-
| RequestAbortedError
|
|
47
|
-
| RequestTimeoutError
|
|
48
|
-
| InvalidRequestError
|
|
49
|
-
| UnexpectedClientError
|
|
50
|
-
| SDKValidationError
|
|
51
|
-
>
|
|
52
|
-
> {
|
|
53
|
-
return new APIPromise($do(
|
|
54
|
-
client,
|
|
55
|
-
limit,
|
|
56
|
-
startingAfter,
|
|
57
|
-
endingBefore,
|
|
58
|
-
entityId,
|
|
59
|
-
options,
|
|
60
|
-
));
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
async function $do(
|
|
64
|
-
client: OrqCore,
|
|
65
|
-
limit?: number | undefined,
|
|
66
|
-
startingAfter?: string | undefined,
|
|
67
|
-
endingBefore?: string | undefined,
|
|
68
|
-
entityId?: string | undefined,
|
|
69
|
-
options?: RequestOptions,
|
|
70
|
-
): Promise<
|
|
71
|
-
[
|
|
72
|
-
Result<
|
|
73
|
-
operations.ListConversationsResponseBody,
|
|
74
|
-
| OrqError
|
|
75
|
-
| ResponseValidationError
|
|
76
|
-
| ConnectionError
|
|
77
|
-
| RequestAbortedError
|
|
78
|
-
| RequestTimeoutError
|
|
79
|
-
| InvalidRequestError
|
|
80
|
-
| UnexpectedClientError
|
|
81
|
-
| SDKValidationError
|
|
82
|
-
>,
|
|
83
|
-
APICall,
|
|
84
|
-
]
|
|
85
|
-
> {
|
|
86
|
-
const input: operations.ListConversationsRequest | undefined = {
|
|
87
|
-
limit: limit,
|
|
88
|
-
startingAfter: startingAfter,
|
|
89
|
-
endingBefore: endingBefore,
|
|
90
|
-
entityId: entityId,
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
const parsed = safeParse(
|
|
94
|
-
input,
|
|
95
|
-
(value) =>
|
|
96
|
-
operations.ListConversationsRequest$outboundSchema.optional().parse(
|
|
97
|
-
value,
|
|
98
|
-
),
|
|
99
|
-
"Input validation failed",
|
|
100
|
-
);
|
|
101
|
-
if (!parsed.ok) {
|
|
102
|
-
return [parsed, { status: "invalid" }];
|
|
103
|
-
}
|
|
104
|
-
const payload = parsed.value;
|
|
105
|
-
const body = null;
|
|
106
|
-
|
|
107
|
-
const path = pathToFunc("/v2/conversations/")();
|
|
108
|
-
|
|
109
|
-
const query = encodeFormQuery({
|
|
110
|
-
"endingBefore": payload?.endingBefore,
|
|
111
|
-
"entityId": payload?.entityId,
|
|
112
|
-
"limit": payload?.limit,
|
|
113
|
-
"startingAfter": payload?.startingAfter,
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
const headers = new Headers(compactMap({
|
|
117
|
-
Accept: "application/json",
|
|
118
|
-
}));
|
|
119
|
-
|
|
120
|
-
const secConfig = await extractSecurity(client._options.apiKey);
|
|
121
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
122
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
123
|
-
|
|
124
|
-
const context = {
|
|
125
|
-
options: client._options,
|
|
126
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
127
|
-
operationID: "ListConversations",
|
|
128
|
-
oAuth2Scopes: null,
|
|
129
|
-
|
|
130
|
-
resolvedSecurity: requestSecurity,
|
|
131
|
-
|
|
132
|
-
securitySource: client._options.apiKey,
|
|
133
|
-
retryConfig: options?.retries
|
|
134
|
-
|| client._options.retryConfig
|
|
135
|
-
|| { strategy: "none" },
|
|
136
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
const requestRes = client._createRequest(context, {
|
|
140
|
-
security: requestSecurity,
|
|
141
|
-
method: "GET",
|
|
142
|
-
baseURL: options?.serverURL,
|
|
143
|
-
path: path,
|
|
144
|
-
headers: headers,
|
|
145
|
-
query: query,
|
|
146
|
-
body: body,
|
|
147
|
-
userAgent: client._options.userAgent,
|
|
148
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
149
|
-
}, options);
|
|
150
|
-
if (!requestRes.ok) {
|
|
151
|
-
return [requestRes, { status: "invalid" }];
|
|
152
|
-
}
|
|
153
|
-
const req = requestRes.value;
|
|
154
|
-
|
|
155
|
-
const doResult = await client._do(req, {
|
|
156
|
-
context,
|
|
157
|
-
errorCodes: ["4XX", "5XX"],
|
|
158
|
-
retryConfig: context.retryConfig,
|
|
159
|
-
retryCodes: context.retryCodes,
|
|
160
|
-
});
|
|
161
|
-
if (!doResult.ok) {
|
|
162
|
-
return [doResult, { status: "request-error", request: req }];
|
|
163
|
-
}
|
|
164
|
-
const response = doResult.value;
|
|
165
|
-
|
|
166
|
-
const [result] = await M.match<
|
|
167
|
-
operations.ListConversationsResponseBody,
|
|
168
|
-
| OrqError
|
|
169
|
-
| ResponseValidationError
|
|
170
|
-
| ConnectionError
|
|
171
|
-
| RequestAbortedError
|
|
172
|
-
| RequestTimeoutError
|
|
173
|
-
| InvalidRequestError
|
|
174
|
-
| UnexpectedClientError
|
|
175
|
-
| SDKValidationError
|
|
176
|
-
>(
|
|
177
|
-
M.json(200, operations.ListConversationsResponseBody$inboundSchema),
|
|
178
|
-
M.fail("4XX"),
|
|
179
|
-
M.fail("5XX"),
|
|
180
|
-
)(response, req);
|
|
181
|
-
if (!result.ok) {
|
|
182
|
-
return [result, { status: "complete", request: req, response }];
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
return [result, { status: "complete", request: req, response }];
|
|
186
|
-
}
|