parlant-client 3.0.1 → 3.3.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/package.json +1 -1
- package/src/Client.d.ts +7 -0
- package/src/Client.js +97 -0
- package/src/api/index.d.ts +1 -1
- package/src/api/index.js +1 -1
- package/src/api/resources/agents/client/Client.d.ts +5 -2
- package/src/api/resources/agents/client/Client.js +5 -2
- package/src/api/resources/agents/client/requests/AgentCreationParams.d.ts +4 -0
- package/src/api/resources/agents/client/requests/AgentUpdateParams.d.ts +3 -1
- package/src/api/resources/cannedResponses/client/Client.d.ts +14 -2
- package/src/api/resources/cannedResponses/client/Client.js +14 -2
- package/src/api/resources/cannedResponses/client/requests/CannedResponseCreationParams.d.ts +10 -1
- package/src/api/resources/cannedResponses/client/requests/CannedResponseUpdateParams.d.ts +9 -1
- package/src/api/resources/customers/client/Client.d.ts +17 -4
- package/src/api/resources/customers/client/Client.js +41 -11
- package/src/api/resources/customers/client/requests/CustomerCreationParams.d.ts +2 -0
- package/src/api/resources/customers/client/requests/CustomersListRequest.d.ts +16 -0
- package/src/api/resources/customers/client/requests/index.d.ts +1 -0
- package/src/api/resources/customers/index.d.ts +1 -0
- package/src/api/resources/customers/index.js +1 -0
- package/src/api/resources/customers/types/CustomersListResponse.d.ts +5 -0
- package/src/api/resources/customers/types/index.d.ts +1 -0
- package/src/api/resources/customers/types/index.js +17 -0
- package/src/api/resources/glossary/client/requests/TermCreationParams.d.ts +1 -0
- package/src/api/resources/guidelines/client/Client.d.ts +14 -2
- package/src/api/resources/guidelines/client/Client.js +14 -2
- package/src/api/resources/guidelines/client/requests/GuidelineCreationParams.d.ts +14 -1
- package/src/api/resources/guidelines/client/requests/GuidelineUpdateParams.d.ts +14 -1
- package/src/api/resources/index.d.ts +4 -2
- package/src/api/resources/index.js +5 -3
- package/src/api/resources/journeys/client/Client.d.ts +4 -2
- package/src/api/resources/journeys/client/Client.js +4 -2
- package/src/api/resources/journeys/client/requests/JourneyCreationParams.d.ts +10 -1
- package/src/api/resources/journeys/client/requests/JourneyUpdateParams.d.ts +3 -0
- package/src/api/resources/sessions/client/Client.d.ts +96 -9
- package/src/api/resources/sessions/client/Client.js +232 -13
- package/src/api/resources/sessions/client/requests/EventCreationParams.d.ts +3 -1
- package/src/api/resources/sessions/client/requests/EventUpdateParams.d.ts +20 -0
- package/src/api/resources/sessions/client/requests/SessionCreationParams.d.ts +10 -1
- package/src/api/resources/sessions/client/requests/SessionUpdateParams.d.ts +16 -1
- package/src/api/resources/sessions/client/requests/SessionsListEventsRequest.d.ts +3 -0
- package/src/api/resources/sessions/client/requests/SessionsListRequest.d.ts +8 -1
- package/src/api/resources/sessions/client/requests/SessionsReadEventRequest.d.ts +12 -0
- package/src/api/resources/sessions/client/requests/index.d.ts +2 -0
- package/src/api/resources/sessions/index.d.ts +1 -0
- package/src/api/resources/sessions/index.js +1 -0
- package/src/api/resources/sessions/types/SessionsListResponse.d.ts +5 -0
- package/src/api/resources/sessions/types/index.d.ts +1 -0
- package/src/api/resources/sessions/types/index.js +17 -0
- package/src/api/resources/tags/client/Client.d.ts +6 -3
- package/src/api/resources/tags/client/Client.js +22 -8
- package/src/api/resources/tags/client/requests/TagsListRequest.d.ts +13 -0
- package/src/api/resources/tags/client/requests/index.d.ts +1 -0
- package/src/api/types/Agent.d.ts +1 -0
- package/src/api/types/CannedResponse.d.ts +4 -0
- package/src/api/types/CannedResponseMetadataUpdateParams.d.ts +12 -0
- package/src/api/types/CriticalityDto.d.ts +12 -0
- package/src/api/types/CriticalityDto.js +11 -0
- package/src/api/types/Event.d.ts +4 -0
- package/src/api/types/Guideline.d.ts +10 -0
- package/src/api/types/GuidelineLabelsUpdateParams.d.ts +12 -0
- package/src/api/types/Journey.d.ts +5 -0
- package/src/api/types/JourneyLabelsUpdateParams.d.ts +12 -0
- package/src/api/types/MessageOutputModeDto.d.ts +15 -0
- package/src/api/types/MessageOutputModeDto.js +10 -0
- package/src/api/types/{Moderation.d.ts → ModerationDto.d.ts} +2 -2
- package/src/api/types/{Moderation.js → ModerationDto.js} +2 -2
- package/src/api/types/PaginatedCustomers.d.ts +13 -0
- package/src/api/types/Session.d.ts +4 -0
- package/src/api/types/SessionLabelsUpdateParams.d.ts +12 -0
- package/src/api/types/SessionListing.d.ts +13 -0
- package/src/api/types/SessionMetadataUpdateParams.d.ts +12 -0
- package/src/api/types/SortDirectionDto.d.ts +11 -0
- package/src/api/types/SortDirectionDto.js +10 -0
- package/src/api/types/ToolServiceKindDto.d.ts +2 -2
- package/src/api/types/ValidationError.d.ts +2 -0
- package/src/api/types/index.d.ts +11 -27
- package/src/api/types/index.js +11 -27
- package/src/serialization/client/healthCheckHealthzGet.d.ts +9 -0
- package/src/serialization/{resources/sessions/client/list.js → client/healthCheckHealthzGet.js} +2 -3
- package/src/serialization/client/index.d.ts +1 -0
- package/src/serialization/client/index.js +37 -0
- package/src/serialization/index.d.ts +2 -1
- package/src/serialization/index.js +2 -1
- package/src/serialization/resources/agents/client/requests/AgentCreationParams.d.ts +3 -0
- package/src/serialization/resources/agents/client/requests/AgentCreationParams.js +3 -0
- package/src/serialization/resources/agents/client/requests/AgentUpdateParams.d.ts +2 -0
- package/src/serialization/resources/agents/client/requests/AgentUpdateParams.js +2 -0
- package/src/serialization/resources/cannedResponses/client/requests/CannedResponseCreationParams.d.ts +2 -0
- package/src/serialization/resources/cannedResponses/client/requests/CannedResponseCreationParams.js +2 -0
- package/src/serialization/resources/cannedResponses/client/requests/CannedResponseUpdateParams.d.ts +2 -0
- package/src/serialization/resources/cannedResponses/client/requests/CannedResponseUpdateParams.js +2 -0
- package/src/serialization/resources/customers/client/index.d.ts +0 -1
- package/src/serialization/resources/customers/client/index.js +0 -24
- package/src/serialization/resources/customers/client/requests/CustomerCreationParams.d.ts +1 -0
- package/src/serialization/resources/customers/client/requests/CustomerCreationParams.js +1 -0
- package/src/serialization/resources/customers/index.d.ts +1 -0
- package/src/serialization/resources/customers/index.js +1 -0
- package/src/serialization/resources/customers/types/CustomersListResponse.d.ts +12 -0
- package/src/serialization/resources/customers/{client/list.js → types/CustomersListResponse.js} +3 -2
- package/src/serialization/resources/customers/types/index.d.ts +1 -0
- package/src/serialization/resources/customers/types/index.js +17 -0
- package/src/serialization/resources/glossary/client/requests/TermCreationParams.d.ts +1 -0
- package/src/serialization/resources/glossary/client/requests/TermCreationParams.js +1 -0
- package/src/serialization/resources/guidelines/client/requests/GuidelineCreationParams.d.ts +9 -0
- package/src/serialization/resources/guidelines/client/requests/GuidelineCreationParams.js +9 -0
- package/src/serialization/resources/guidelines/client/requests/GuidelineUpdateParams.d.ts +8 -0
- package/src/serialization/resources/guidelines/client/requests/GuidelineUpdateParams.js +8 -0
- package/src/serialization/resources/index.d.ts +4 -2
- package/src/serialization/resources/index.js +5 -3
- package/src/serialization/resources/journeys/client/requests/JourneyCreationParams.d.ts +5 -0
- package/src/serialization/resources/journeys/client/requests/JourneyCreationParams.js +5 -0
- package/src/serialization/resources/journeys/client/requests/JourneyUpdateParams.d.ts +5 -0
- package/src/serialization/resources/journeys/client/requests/JourneyUpdateParams.js +5 -0
- package/src/serialization/resources/sessions/client/index.d.ts +0 -1
- package/src/serialization/resources/sessions/client/index.js +1 -2
- package/src/serialization/resources/sessions/client/requests/EventCreationParams.d.ts +1 -0
- package/src/serialization/resources/sessions/client/requests/EventCreationParams.js +1 -0
- package/src/serialization/resources/sessions/client/requests/EventUpdateParams.d.ts +13 -0
- package/src/serialization/resources/sessions/client/requests/EventUpdateParams.js +44 -0
- package/src/serialization/resources/sessions/client/requests/SessionCreationParams.d.ts +2 -0
- package/src/serialization/resources/sessions/client/requests/SessionCreationParams.js +2 -0
- package/src/serialization/resources/sessions/client/requests/SessionUpdateParams.d.ts +6 -0
- package/src/serialization/resources/sessions/client/requests/SessionUpdateParams.js +6 -0
- package/src/serialization/resources/sessions/client/requests/index.d.ts +1 -0
- package/src/serialization/resources/sessions/client/requests/index.js +3 -1
- package/src/serialization/resources/sessions/index.d.ts +1 -0
- package/src/serialization/resources/sessions/index.js +1 -0
- package/src/serialization/resources/sessions/types/SessionsListResponse.d.ts +12 -0
- package/src/serialization/resources/sessions/types/SessionsListResponse.js +43 -0
- package/src/serialization/resources/sessions/types/index.d.ts +1 -0
- package/src/serialization/resources/sessions/types/index.js +17 -0
- package/src/serialization/types/Agent.d.ts +2 -0
- package/src/serialization/types/Agent.js +2 -0
- package/src/serialization/types/CannedResponse.d.ts +2 -0
- package/src/serialization/types/CannedResponse.js +2 -0
- package/src/serialization/types/CannedResponseMetadataUpdateParams.d.ts +13 -0
- package/src/serialization/types/CannedResponseMetadataUpdateParams.js +44 -0
- package/src/serialization/types/CriticalityDto.d.ts +10 -0
- package/src/serialization/types/{ConnectionPropositionKindDto.js → CriticalityDto.js} +2 -2
- package/src/serialization/types/Event.d.ts +2 -0
- package/src/serialization/types/Event.js +2 -0
- package/src/serialization/types/Guideline.d.ts +8 -0
- package/src/serialization/types/Guideline.js +8 -0
- package/src/serialization/types/GuidelineLabelsUpdateParams.d.ts +13 -0
- package/src/serialization/types/{LegacyGuideline.js → GuidelineLabelsUpdateParams.js} +4 -6
- package/src/serialization/types/Journey.d.ts +4 -0
- package/src/serialization/types/Journey.js +4 -0
- package/src/serialization/types/JourneyLabelsUpdateParams.d.ts +13 -0
- package/src/serialization/types/{LegacyGuidelineConnectionAddition.js → JourneyLabelsUpdateParams.js} +4 -4
- package/src/serialization/types/MessageOutputModeDto.d.ts +10 -0
- package/src/serialization/types/{CoherenceCheckKindDto.js → MessageOutputModeDto.js} +2 -5
- package/src/serialization/types/{Moderation.d.ts → ModerationDto.d.ts} +2 -2
- package/src/serialization/types/ModerationDto.js +41 -0
- package/src/serialization/types/PaginatedCustomers.d.ts +16 -0
- package/src/serialization/types/{ConnectionProposition.js → PaginatedCustomers.js} +7 -7
- package/src/serialization/types/Session.d.ts +2 -0
- package/src/serialization/types/Session.js +2 -0
- package/src/serialization/types/SessionLabelsUpdateParams.d.ts +13 -0
- package/src/serialization/types/{LegacyGuidelineCreationParams.js → SessionLabelsUpdateParams.js} +4 -4
- package/src/serialization/types/SessionListing.d.ts +16 -0
- package/src/serialization/types/{LegacyEvaluationCreationParams.js → SessionListing.js} +7 -5
- package/src/serialization/types/SessionMetadataUpdateParams.d.ts +13 -0
- package/src/serialization/types/{LegacyInvoiceData.js → SessionMetadataUpdateParams.js} +4 -4
- package/src/serialization/types/SortDirectionDto.d.ts +10 -0
- package/src/serialization/types/{Moderation.js → SortDirectionDto.js} +2 -2
- package/src/serialization/types/ValidationError.d.ts +2 -0
- package/src/serialization/types/ValidationError.js +2 -0
- package/src/serialization/types/index.d.ts +11 -27
- package/src/serialization/types/index.js +11 -27
- package/src/api/types/CoherenceCheck.d.ts +0 -16
- package/src/api/types/CoherenceCheckKindDto.d.ts +0 -11
- package/src/api/types/CoherenceCheckKindDto.js +0 -10
- package/src/api/types/ConnectionProposition.d.ts +0 -12
- package/src/api/types/ConnectionPropositionKindDto.d.ts +0 -11
- package/src/api/types/ConnectionPropositionKindDto.js +0 -10
- package/src/api/types/LegacyContextVariable.d.ts +0 -22
- package/src/api/types/LegacyContextVariableCreationParams.d.ts +0 -16
- package/src/api/types/LegacyContextVariableReadResult.d.ts +0 -12
- package/src/api/types/LegacyContextVariableUpdateParams.d.ts +0 -16
- package/src/api/types/LegacyEvaluation.d.ts +0 -19
- package/src/api/types/LegacyEvaluationCreationParams.d.ts +0 -12
- package/src/api/types/LegacyGuideline.d.ts +0 -16
- package/src/api/types/LegacyGuidelineConnection.d.ts +0 -15
- package/src/api/types/LegacyGuidelineConnectionAddition.d.ts +0 -12
- package/src/api/types/LegacyGuidelineConnectionUpdateParams.d.ts +0 -14
- package/src/api/types/LegacyGuidelineCreationParams.d.ts +0 -10
- package/src/api/types/LegacyGuidelineCreationResult.d.ts +0 -10
- package/src/api/types/LegacyGuidelineCreationResult.js +0 -5
- package/src/api/types/LegacyGuidelineInvoiceData.d.ts +0 -11
- package/src/api/types/LegacyGuidelineInvoiceData.js +0 -5
- package/src/api/types/LegacyGuidelinePayload.d.ts +0 -17
- package/src/api/types/LegacyGuidelinePayload.js +0 -5
- package/src/api/types/LegacyGuidelineUpdateParams.d.ts +0 -12
- package/src/api/types/LegacyGuidelineUpdateParams.js +0 -5
- package/src/api/types/LegacyGuidelineWithConnectionsAndToolAssociations.d.ts +0 -12
- package/src/api/types/LegacyGuidelineWithConnectionsAndToolAssociations.js +0 -5
- package/src/api/types/LegacyInvoice.d.ts +0 -19
- package/src/api/types/LegacyInvoice.js +0 -5
- package/src/api/types/LegacyInvoiceData.d.ts +0 -12
- package/src/api/types/LegacyInvoiceData.js +0 -5
- package/src/api/types/LegacyPayload.d.ts +0 -13
- package/src/api/types/LegacyPayload.js +0 -5
- package/src/api/types/LegacyTerm.d.ts +0 -18
- package/src/api/types/LegacyTerm.js +0 -5
- package/src/api/types/LegacyTermCreationParams.d.ts +0 -16
- package/src/api/types/LegacyTermCreationParams.js +0 -5
- package/src/api/types/LegacyTermUpdateParams.d.ts +0 -16
- package/src/api/types/LegacyTermUpdateParams.js +0 -5
- package/src/serialization/resources/customers/client/list.d.ts +0 -11
- package/src/serialization/resources/sessions/client/list.d.ts +0 -11
- package/src/serialization/types/CoherenceCheck.d.ts +0 -18
- package/src/serialization/types/CoherenceCheck.js +0 -49
- package/src/serialization/types/CoherenceCheckKindDto.d.ts +0 -10
- package/src/serialization/types/ConnectionProposition.d.ts +0 -16
- package/src/serialization/types/ConnectionPropositionKindDto.d.ts +0 -10
- package/src/serialization/types/LegacyContextVariable.d.ts +0 -17
- package/src/serialization/types/LegacyContextVariable.js +0 -48
- package/src/serialization/types/LegacyContextVariableCreationParams.d.ts +0 -16
- package/src/serialization/types/LegacyContextVariableCreationParams.js +0 -47
- package/src/serialization/types/LegacyContextVariableReadResult.d.ts +0 -15
- package/src/serialization/types/LegacyContextVariableReadResult.js +0 -46
- package/src/serialization/types/LegacyContextVariableUpdateParams.d.ts +0 -16
- package/src/serialization/types/LegacyContextVariableUpdateParams.js +0 -47
- package/src/serialization/types/LegacyEvaluation.d.ts +0 -19
- package/src/serialization/types/LegacyEvaluation.js +0 -50
- package/src/serialization/types/LegacyEvaluationCreationParams.d.ts +0 -14
- package/src/serialization/types/LegacyGuideline.d.ts +0 -15
- package/src/serialization/types/LegacyGuidelineConnection.d.ts +0 -16
- package/src/serialization/types/LegacyGuidelineConnection.js +0 -47
- package/src/serialization/types/LegacyGuidelineConnectionAddition.d.ts +0 -13
- package/src/serialization/types/LegacyGuidelineConnectionUpdateParams.d.ts +0 -14
- package/src/serialization/types/LegacyGuidelineConnectionUpdateParams.js +0 -45
- package/src/serialization/types/LegacyGuidelineCreationParams.d.ts +0 -13
- package/src/serialization/types/LegacyGuidelineCreationResult.d.ts +0 -13
- package/src/serialization/types/LegacyGuidelineCreationResult.js +0 -44
- package/src/serialization/types/LegacyGuidelineInvoiceData.d.ts +0 -15
- package/src/serialization/types/LegacyGuidelineInvoiceData.js +0 -46
- package/src/serialization/types/LegacyGuidelinePayload.d.ts +0 -18
- package/src/serialization/types/LegacyGuidelinePayload.js +0 -49
- package/src/serialization/types/LegacyGuidelineUpdateParams.d.ts +0 -16
- package/src/serialization/types/LegacyGuidelineUpdateParams.js +0 -47
- package/src/serialization/types/LegacyGuidelineWithConnectionsAndToolAssociations.d.ts +0 -17
- package/src/serialization/types/LegacyGuidelineWithConnectionsAndToolAssociations.js +0 -48
- package/src/serialization/types/LegacyInvoice.d.ts +0 -18
- package/src/serialization/types/LegacyInvoice.js +0 -49
- package/src/serialization/types/LegacyInvoiceData.d.ts +0 -13
- package/src/serialization/types/LegacyPayload.d.ts +0 -15
- package/src/serialization/types/LegacyPayload.js +0 -46
- package/src/serialization/types/LegacyTerm.d.ts +0 -15
- package/src/serialization/types/LegacyTerm.js +0 -46
- package/src/serialization/types/LegacyTermCreationParams.d.ts +0 -14
- package/src/serialization/types/LegacyTermCreationParams.js +0 -45
- package/src/serialization/types/LegacyTermUpdateParams.d.ts +0 -14
- package/src/serialization/types/LegacyTermUpdateParams.js +0 -45
- /package/src/api/{types/CoherenceCheck.js → resources/customers/client/requests/CustomersListRequest.js} +0 -0
- /package/src/api/{types/ConnectionProposition.js → resources/customers/types/CustomersListResponse.js} +0 -0
- /package/src/api/{types/LegacyContextVariable.js → resources/sessions/client/requests/EventUpdateParams.js} +0 -0
- /package/src/api/{types/LegacyContextVariableCreationParams.js → resources/sessions/client/requests/SessionsReadEventRequest.js} +0 -0
- /package/src/api/{types/LegacyContextVariableReadResult.js → resources/sessions/types/SessionsListResponse.js} +0 -0
- /package/src/api/{types/LegacyContextVariableUpdateParams.js → resources/tags/client/requests/TagsListRequest.js} +0 -0
- /package/src/api/types/{LegacyEvaluation.js → CannedResponseMetadataUpdateParams.js} +0 -0
- /package/src/api/types/{LegacyEvaluationCreationParams.js → GuidelineLabelsUpdateParams.js} +0 -0
- /package/src/api/types/{LegacyGuideline.js → JourneyLabelsUpdateParams.js} +0 -0
- /package/src/api/types/{LegacyGuidelineConnection.js → PaginatedCustomers.js} +0 -0
- /package/src/api/types/{LegacyGuidelineConnectionAddition.js → SessionLabelsUpdateParams.js} +0 -0
- /package/src/api/types/{LegacyGuidelineConnectionUpdateParams.js → SessionListing.js} +0 -0
- /package/src/api/types/{LegacyGuidelineCreationParams.js → SessionMetadataUpdateParams.js} +0 -0
|
@@ -62,18 +62,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
62
62
|
exports.Sessions = void 0;
|
|
63
63
|
const core = __importStar(require("../../../../core"));
|
|
64
64
|
const Parlant = __importStar(require("../../../index"));
|
|
65
|
-
const url_join_1 = __importDefault(require("url-join"));
|
|
66
65
|
const serializers = __importStar(require("../../../../serialization/index"));
|
|
66
|
+
const url_join_1 = __importDefault(require("url-join"));
|
|
67
67
|
const errors = __importStar(require("../../../../errors/index"));
|
|
68
68
|
class Sessions {
|
|
69
69
|
constructor(_options) {
|
|
70
70
|
this._options = _options;
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
|
-
* Lists all sessions matching the specified filters.
|
|
73
|
+
* Lists all sessions matching the specified filters with pagination support.
|
|
74
74
|
*
|
|
75
|
-
* Can filter by agent_id and/or customer_id.
|
|
76
|
-
*
|
|
75
|
+
* Can filter by agent_id and/or customer_id. Supports cursor-based pagination
|
|
76
|
+
* with configurable sort direction.
|
|
77
77
|
*
|
|
78
78
|
* @param {Parlant.SessionsListRequest} request
|
|
79
79
|
* @param {Sessions.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -83,13 +83,15 @@ class Sessions {
|
|
|
83
83
|
* @example
|
|
84
84
|
* await client.sessions.list({
|
|
85
85
|
* agentId: "ag_123xyz",
|
|
86
|
-
* customerId: "cust_123xy"
|
|
86
|
+
* customerId: "cust_123xy",
|
|
87
|
+
* limit: 10,
|
|
88
|
+
* cursor: "AAABjnBU9gBl/0BQt1axI0VniQI="
|
|
87
89
|
* })
|
|
88
90
|
*/
|
|
89
91
|
list() {
|
|
90
92
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
91
93
|
var _a;
|
|
92
|
-
const { agentId, customerId } = request;
|
|
94
|
+
const { agentId, customerId, labels, limit, cursor, sort } = request;
|
|
93
95
|
const _queryParams = {};
|
|
94
96
|
if (agentId != null) {
|
|
95
97
|
_queryParams["agent_id"] = agentId;
|
|
@@ -97,6 +99,23 @@ class Sessions {
|
|
|
97
99
|
if (customerId != null) {
|
|
98
100
|
_queryParams["customer_id"] = customerId;
|
|
99
101
|
}
|
|
102
|
+
if (labels != null) {
|
|
103
|
+
if (Array.isArray(labels)) {
|
|
104
|
+
_queryParams["labels"] = labels.map((item) => item);
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
_queryParams["labels"] = labels;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (limit != null) {
|
|
111
|
+
_queryParams["limit"] = limit.toString();
|
|
112
|
+
}
|
|
113
|
+
if (cursor != null) {
|
|
114
|
+
_queryParams["cursor"] = cursor;
|
|
115
|
+
}
|
|
116
|
+
if (sort != null) {
|
|
117
|
+
_queryParams["sort"] = serializers.SortDirectionDto.jsonOrThrow(sort, { unrecognizedObjectKeys: "strip" });
|
|
118
|
+
}
|
|
100
119
|
const _response = yield core.fetcher({
|
|
101
120
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment)), "sessions"),
|
|
102
121
|
method: "GET",
|
|
@@ -109,7 +128,7 @@ class Sessions {
|
|
|
109
128
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
110
129
|
});
|
|
111
130
|
if (_response.ok) {
|
|
112
|
-
return serializers.
|
|
131
|
+
return serializers.SessionsListResponse.parseOrThrow(_response.body, {
|
|
113
132
|
unrecognizedObjectKeys: "passthrough",
|
|
114
133
|
allowUnrecognizedUnionMembers: true,
|
|
115
134
|
allowUnrecognizedEnumValues: true,
|
|
@@ -157,7 +176,12 @@ class Sessions {
|
|
|
157
176
|
* await client.sessions.create({
|
|
158
177
|
* agentId: "ag_123xyz",
|
|
159
178
|
* customerId: "cust_123xy",
|
|
160
|
-
* title: "Product inquiry session"
|
|
179
|
+
* title: "Product inquiry session",
|
|
180
|
+
* metadata: {
|
|
181
|
+
* "priority": "high",
|
|
182
|
+
* "project": "demo"
|
|
183
|
+
* },
|
|
184
|
+
* labels: ["vip", "priority"]
|
|
161
185
|
* })
|
|
162
186
|
*/
|
|
163
187
|
create(request, requestOptions) {
|
|
@@ -418,7 +442,18 @@ class Sessions {
|
|
|
418
442
|
* consumptionOffsets: {
|
|
419
443
|
* client: 42
|
|
420
444
|
* },
|
|
421
|
-
* title: "Updated session title"
|
|
445
|
+
* title: "Updated session title",
|
|
446
|
+
* metadata: {
|
|
447
|
+
* set: {
|
|
448
|
+
* "priority": "low",
|
|
449
|
+
* "simulation": true
|
|
450
|
+
* },
|
|
451
|
+
* unset: ["old_project"]
|
|
452
|
+
* },
|
|
453
|
+
* labels: {
|
|
454
|
+
* upsert: ["vip", "priority"],
|
|
455
|
+
* remove: ["old_label"]
|
|
456
|
+
* }
|
|
422
457
|
* })
|
|
423
458
|
*/
|
|
424
459
|
update(sessionId_1) {
|
|
@@ -475,12 +510,13 @@ class Sessions {
|
|
|
475
510
|
* Lists events from a session with optional filtering and waiting capabilities.
|
|
476
511
|
*
|
|
477
512
|
* This endpoint retrieves events from a specified session and can:
|
|
478
|
-
* 1. Filter events by their offset, source, type, and
|
|
513
|
+
* 1. Filter events by their offset, source, type, and trace ID
|
|
479
514
|
* 2. Wait for new events to arrive if requested
|
|
480
515
|
* 3. Return events in chronological order based on their offset
|
|
516
|
+
* 4. Stream events via Server-Sent Events (SSE) when sse=true
|
|
481
517
|
*
|
|
482
518
|
* Notes:
|
|
483
|
-
* Long Polling Behavior:
|
|
519
|
+
* Long Polling Behavior (when sse=false):
|
|
484
520
|
* - When wait_for_data = 0:
|
|
485
521
|
* Returns immediately with any existing events that match the criteria
|
|
486
522
|
* - When wait_for_data > 0:
|
|
@@ -488,6 +524,11 @@ class Sessions {
|
|
|
488
524
|
* - If no new events arrive before timeout, raises 504 Gateway Timeout
|
|
489
525
|
* - If matching events already exist, returns immediately with those events
|
|
490
526
|
*
|
|
527
|
+
* SSE Mode (when sse=true):
|
|
528
|
+
* - Returns a text/event-stream response
|
|
529
|
+
* - Continuously sends events as they arrive
|
|
530
|
+
* - wait_for_data is used as the timeout between events before closing the stream
|
|
531
|
+
*
|
|
491
532
|
* @param {string} sessionId - Unique identifier for the session
|
|
492
533
|
* @param {Parlant.SessionsListEventsRequest} request
|
|
493
534
|
* @param {Sessions.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -500,13 +541,14 @@ class Sessions {
|
|
|
500
541
|
* await client.sessions.listEvents("sess_123yz", {
|
|
501
542
|
* minOffset: 0,
|
|
502
543
|
* correlationId: "corr_13xyz",
|
|
544
|
+
* traceId: "corr_13xyz",
|
|
503
545
|
* kinds: "message,tool"
|
|
504
546
|
* })
|
|
505
547
|
*/
|
|
506
548
|
listEvents(sessionId_1) {
|
|
507
549
|
return __awaiter(this, arguments, void 0, function* (sessionId, request = {}, requestOptions) {
|
|
508
550
|
var _a;
|
|
509
|
-
const { minOffset, source, correlationId, kinds, waitForData } = request;
|
|
551
|
+
const { minOffset, source, correlationId, traceId, kinds, waitForData, sse } = request;
|
|
510
552
|
const _queryParams = {};
|
|
511
553
|
if (minOffset != null) {
|
|
512
554
|
_queryParams["min_offset"] = minOffset.toString();
|
|
@@ -519,12 +561,18 @@ class Sessions {
|
|
|
519
561
|
if (correlationId != null) {
|
|
520
562
|
_queryParams["correlation_id"] = correlationId;
|
|
521
563
|
}
|
|
564
|
+
if (traceId != null) {
|
|
565
|
+
_queryParams["trace_id"] = traceId;
|
|
566
|
+
}
|
|
522
567
|
if (kinds != null) {
|
|
523
568
|
_queryParams["kinds"] = kinds;
|
|
524
569
|
}
|
|
525
570
|
if (waitForData != null) {
|
|
526
571
|
_queryParams["wait_for_data"] = waitForData.toString();
|
|
527
572
|
}
|
|
573
|
+
if (sse != null) {
|
|
574
|
+
_queryParams["sse"] = sse.toString();
|
|
575
|
+
}
|
|
528
576
|
const _response = yield core.fetcher({
|
|
529
577
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment)), `sessions/${encodeURIComponent(sessionId)}/events`),
|
|
530
578
|
method: "GET",
|
|
@@ -599,7 +647,7 @@ class Sessions {
|
|
|
599
647
|
const { moderation } = request, _body = __rest(request, ["moderation"]);
|
|
600
648
|
const _queryParams = {};
|
|
601
649
|
if (moderation != null) {
|
|
602
|
-
_queryParams["moderation"] = serializers.
|
|
650
|
+
_queryParams["moderation"] = serializers.ModerationDto.jsonOrThrow(moderation, {
|
|
603
651
|
unrecognizedObjectKeys: "strip",
|
|
604
652
|
});
|
|
605
653
|
}
|
|
@@ -716,5 +764,176 @@ class Sessions {
|
|
|
716
764
|
}
|
|
717
765
|
});
|
|
718
766
|
}
|
|
767
|
+
/**
|
|
768
|
+
* Reads a single event from a session.
|
|
769
|
+
*
|
|
770
|
+
* This endpoint retrieves a specific event by its ID and optionally waits
|
|
771
|
+
* for the event to complete (useful for streaming messages).
|
|
772
|
+
*
|
|
773
|
+
* Args:
|
|
774
|
+
* wait_for_completion: If true, wait for the event to complete (for streaming events,
|
|
775
|
+
* this means waiting until chunks contains None terminator)
|
|
776
|
+
* wait_for_data: Timeout in seconds for wait_for_completion
|
|
777
|
+
* sse: If true, stream event updates via Server-Sent Events until completion
|
|
778
|
+
*
|
|
779
|
+
* Notes:
|
|
780
|
+
* For streaming message events (events with 'chunks' property):
|
|
781
|
+
* - The event is considered complete when chunks contains a None terminator
|
|
782
|
+
* - Use wait_for_completion=true to wait for the full message
|
|
783
|
+
* - Use sse=true to stream updates as chunks are added
|
|
784
|
+
*
|
|
785
|
+
* SSE Mode (when sse=true):
|
|
786
|
+
* - Returns a text/event-stream response
|
|
787
|
+
* - Sends the event each time it's updated
|
|
788
|
+
* - Closes when the event is complete (chunks ends with None)
|
|
789
|
+
*
|
|
790
|
+
* @param {string} sessionId - Unique identifier for the session
|
|
791
|
+
* @param {string} eventId - Unique identifier for the event
|
|
792
|
+
* @param {Parlant.SessionsReadEventRequest} request
|
|
793
|
+
* @param {Sessions.RequestOptions} requestOptions - Request-specific configuration.
|
|
794
|
+
*
|
|
795
|
+
* @throws {@link Parlant.NotFoundError}
|
|
796
|
+
* @throws {@link Parlant.UnprocessableEntityError}
|
|
797
|
+
*
|
|
798
|
+
* @example
|
|
799
|
+
* await client.sessions.readEvent("sess_123yz", "evt_123xyz")
|
|
800
|
+
*/
|
|
801
|
+
readEvent(sessionId_1, eventId_1) {
|
|
802
|
+
return __awaiter(this, arguments, void 0, function* (sessionId, eventId, request = {}, requestOptions) {
|
|
803
|
+
var _a;
|
|
804
|
+
const { waitForCompletion, waitForData, sse } = request;
|
|
805
|
+
const _queryParams = {};
|
|
806
|
+
if (waitForCompletion != null) {
|
|
807
|
+
_queryParams["wait_for_completion"] = waitForCompletion.toString();
|
|
808
|
+
}
|
|
809
|
+
if (waitForData != null) {
|
|
810
|
+
_queryParams["wait_for_data"] = waitForData.toString();
|
|
811
|
+
}
|
|
812
|
+
if (sse != null) {
|
|
813
|
+
_queryParams["sse"] = sse.toString();
|
|
814
|
+
}
|
|
815
|
+
const _response = yield core.fetcher({
|
|
816
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment)), `sessions/${encodeURIComponent(sessionId)}/events/${encodeURIComponent(eventId)}`),
|
|
817
|
+
method: "GET",
|
|
818
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
819
|
+
contentType: "application/json",
|
|
820
|
+
queryParameters: _queryParams,
|
|
821
|
+
requestType: "json",
|
|
822
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
823
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
824
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
825
|
+
});
|
|
826
|
+
if (_response.ok) {
|
|
827
|
+
return serializers.Event.parseOrThrow(_response.body, {
|
|
828
|
+
unrecognizedObjectKeys: "passthrough",
|
|
829
|
+
allowUnrecognizedUnionMembers: true,
|
|
830
|
+
allowUnrecognizedEnumValues: true,
|
|
831
|
+
breadcrumbsPrefix: ["response"],
|
|
832
|
+
});
|
|
833
|
+
}
|
|
834
|
+
if (_response.error.reason === "status-code") {
|
|
835
|
+
switch (_response.error.statusCode) {
|
|
836
|
+
case 404:
|
|
837
|
+
throw new Parlant.NotFoundError(_response.error.body);
|
|
838
|
+
case 422:
|
|
839
|
+
throw new Parlant.UnprocessableEntityError(_response.error.body);
|
|
840
|
+
default:
|
|
841
|
+
throw new errors.ParlantError({
|
|
842
|
+
statusCode: _response.error.statusCode,
|
|
843
|
+
body: _response.error.body,
|
|
844
|
+
});
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
switch (_response.error.reason) {
|
|
848
|
+
case "non-json":
|
|
849
|
+
throw new errors.ParlantError({
|
|
850
|
+
statusCode: _response.error.statusCode,
|
|
851
|
+
body: _response.error.rawBody,
|
|
852
|
+
});
|
|
853
|
+
case "timeout":
|
|
854
|
+
throw new errors.ParlantTimeoutError("Timeout exceeded when calling GET /sessions/{session_id}/events/{event_id}.");
|
|
855
|
+
case "unknown":
|
|
856
|
+
throw new errors.ParlantError({
|
|
857
|
+
message: _response.error.errorMessage,
|
|
858
|
+
});
|
|
859
|
+
}
|
|
860
|
+
});
|
|
861
|
+
}
|
|
862
|
+
/**
|
|
863
|
+
* Updates an event's properties.
|
|
864
|
+
*
|
|
865
|
+
* Currently only supports updating metadata. Other event properties cannot be modified.
|
|
866
|
+
* This API is designed to be extensible for future event property updates.
|
|
867
|
+
*
|
|
868
|
+
* @param {string} sessionId - Unique identifier for the session
|
|
869
|
+
* @param {string} eventId - Unique identifier for the event
|
|
870
|
+
* @param {Parlant.EventUpdateParams} request
|
|
871
|
+
* @param {Sessions.RequestOptions} requestOptions - Request-specific configuration.
|
|
872
|
+
*
|
|
873
|
+
* @throws {@link Parlant.NotFoundError}
|
|
874
|
+
* @throws {@link Parlant.UnprocessableEntityError}
|
|
875
|
+
*
|
|
876
|
+
* @example
|
|
877
|
+
* await client.sessions.updateEvent("sess_123yz", "evt_123xyz", {
|
|
878
|
+
* metadata: {
|
|
879
|
+
* set: {
|
|
880
|
+
* "agent_id": "agent_123",
|
|
881
|
+
* "category": "support",
|
|
882
|
+
* "priority": "high"
|
|
883
|
+
* },
|
|
884
|
+
* unset: ["old_priority"]
|
|
885
|
+
* }
|
|
886
|
+
* })
|
|
887
|
+
*/
|
|
888
|
+
updateEvent(sessionId_1, eventId_1) {
|
|
889
|
+
return __awaiter(this, arguments, void 0, function* (sessionId, eventId, request = {}, requestOptions) {
|
|
890
|
+
var _a;
|
|
891
|
+
const _response = yield core.fetcher({
|
|
892
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment)), `sessions/${encodeURIComponent(sessionId)}/events/${encodeURIComponent(eventId)}`),
|
|
893
|
+
method: "PATCH",
|
|
894
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
895
|
+
contentType: "application/json",
|
|
896
|
+
requestType: "json",
|
|
897
|
+
body: serializers.EventUpdateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
898
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
899
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
900
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
901
|
+
});
|
|
902
|
+
if (_response.ok) {
|
|
903
|
+
return serializers.Event.parseOrThrow(_response.body, {
|
|
904
|
+
unrecognizedObjectKeys: "passthrough",
|
|
905
|
+
allowUnrecognizedUnionMembers: true,
|
|
906
|
+
allowUnrecognizedEnumValues: true,
|
|
907
|
+
breadcrumbsPrefix: ["response"],
|
|
908
|
+
});
|
|
909
|
+
}
|
|
910
|
+
if (_response.error.reason === "status-code") {
|
|
911
|
+
switch (_response.error.statusCode) {
|
|
912
|
+
case 404:
|
|
913
|
+
throw new Parlant.NotFoundError(_response.error.body);
|
|
914
|
+
case 422:
|
|
915
|
+
throw new Parlant.UnprocessableEntityError(_response.error.body);
|
|
916
|
+
default:
|
|
917
|
+
throw new errors.ParlantError({
|
|
918
|
+
statusCode: _response.error.statusCode,
|
|
919
|
+
body: _response.error.body,
|
|
920
|
+
});
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
switch (_response.error.reason) {
|
|
924
|
+
case "non-json":
|
|
925
|
+
throw new errors.ParlantError({
|
|
926
|
+
statusCode: _response.error.statusCode,
|
|
927
|
+
body: _response.error.rawBody,
|
|
928
|
+
});
|
|
929
|
+
case "timeout":
|
|
930
|
+
throw new errors.ParlantTimeoutError("Timeout exceeded when calling PATCH /sessions/{session_id}/events/{event_id}.");
|
|
931
|
+
case "unknown":
|
|
932
|
+
throw new errors.ParlantError({
|
|
933
|
+
message: _response.error.errorMessage,
|
|
934
|
+
});
|
|
935
|
+
}
|
|
936
|
+
});
|
|
937
|
+
}
|
|
719
938
|
}
|
|
720
939
|
exports.Sessions = Sessions;
|
|
@@ -14,12 +14,14 @@ export interface EventCreationParams {
|
|
|
14
14
|
/**
|
|
15
15
|
* Content moderation level for the event
|
|
16
16
|
*/
|
|
17
|
-
moderation?: Parlant.
|
|
17
|
+
moderation?: Parlant.ModerationDto;
|
|
18
18
|
kind: Parlant.EventKindDto;
|
|
19
19
|
source: Parlant.EventSourceDto;
|
|
20
20
|
/** Event payload data, format depends on kind */
|
|
21
21
|
message?: string;
|
|
22
22
|
data?: unknown;
|
|
23
|
+
/** Metadata associated with the event */
|
|
24
|
+
metadata?: Record<string, unknown>;
|
|
23
25
|
guidelines?: Parlant.AgentMessageGuideline[];
|
|
24
26
|
participant?: Parlant.Participant;
|
|
25
27
|
status?: Parlant.SessionStatusDto;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Parlant from "../../../../index";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* metadata: {
|
|
9
|
+
* set: {
|
|
10
|
+
* "agent_id": "agent_123",
|
|
11
|
+
* "category": "support",
|
|
12
|
+
* "priority": "high"
|
|
13
|
+
* },
|
|
14
|
+
* unset: ["old_priority"]
|
|
15
|
+
* }
|
|
16
|
+
* }
|
|
17
|
+
*/
|
|
18
|
+
export interface EventUpdateParams {
|
|
19
|
+
metadata?: Parlant.SessionMetadataUpdateParams;
|
|
20
|
+
}
|
|
@@ -6,7 +6,12 @@
|
|
|
6
6
|
* {
|
|
7
7
|
* agentId: "ag_123xyz",
|
|
8
8
|
* customerId: "cust_123xy",
|
|
9
|
-
* title: "Product inquiry session"
|
|
9
|
+
* title: "Product inquiry session",
|
|
10
|
+
* metadata: {
|
|
11
|
+
* "priority": "high",
|
|
12
|
+
* "project": "demo"
|
|
13
|
+
* },
|
|
14
|
+
* labels: ["vip", "priority"]
|
|
10
15
|
* }
|
|
11
16
|
*/
|
|
12
17
|
export interface SessionCreationParams {
|
|
@@ -20,4 +25,8 @@ export interface SessionCreationParams {
|
|
|
20
25
|
customerId?: string;
|
|
21
26
|
/** Descriptive title for the session */
|
|
22
27
|
title?: string;
|
|
28
|
+
/** Metadata for the session */
|
|
29
|
+
metadata?: Record<string, unknown>;
|
|
30
|
+
/** Labels associated with the session */
|
|
31
|
+
labels?: string[];
|
|
23
32
|
}
|
|
@@ -8,7 +8,18 @@ import * as Parlant from "../../../../index";
|
|
|
8
8
|
* consumptionOffsets: {
|
|
9
9
|
* client: 42
|
|
10
10
|
* },
|
|
11
|
-
* title: "Updated session title"
|
|
11
|
+
* title: "Updated session title",
|
|
12
|
+
* metadata: {
|
|
13
|
+
* set: {
|
|
14
|
+
* "priority": "low",
|
|
15
|
+
* "simulation": true
|
|
16
|
+
* },
|
|
17
|
+
* unset: ["old_project"]
|
|
18
|
+
* },
|
|
19
|
+
* labels: {
|
|
20
|
+
* upsert: ["vip", "priority"],
|
|
21
|
+
* remove: ["old_label"]
|
|
22
|
+
* }
|
|
12
23
|
* }
|
|
13
24
|
*/
|
|
14
25
|
export interface SessionUpdateParams {
|
|
@@ -17,4 +28,8 @@ export interface SessionUpdateParams {
|
|
|
17
28
|
title?: string;
|
|
18
29
|
/** The mode of the session, either 'auto' or 'manual'. In manual mode, events added to a session will not be responded to automatically by the agent. */
|
|
19
30
|
mode?: Parlant.SessionModeDto;
|
|
31
|
+
customerId?: string;
|
|
32
|
+
agentId?: string;
|
|
33
|
+
metadata?: Parlant.SessionMetadataUpdateParams;
|
|
34
|
+
labels?: Parlant.SessionLabelsUpdateParams;
|
|
20
35
|
}
|
|
@@ -7,6 +7,7 @@ import * as Parlant from "../../../../index";
|
|
|
7
7
|
* {
|
|
8
8
|
* minOffset: 0,
|
|
9
9
|
* correlationId: "corr_13xyz",
|
|
10
|
+
* traceId: "corr_13xyz",
|
|
10
11
|
* kinds: "message,tool"
|
|
11
12
|
* }
|
|
12
13
|
*/
|
|
@@ -14,6 +15,8 @@ export interface SessionsListEventsRequest {
|
|
|
14
15
|
minOffset?: number;
|
|
15
16
|
source?: Parlant.EventSourceDto;
|
|
16
17
|
correlationId?: string;
|
|
18
|
+
traceId?: string;
|
|
17
19
|
kinds?: string;
|
|
18
20
|
waitForData?: number;
|
|
21
|
+
sse?: boolean;
|
|
19
22
|
}
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
+
import * as Parlant from "../../../../index";
|
|
4
5
|
/**
|
|
5
6
|
* @example
|
|
6
7
|
* {
|
|
7
8
|
* agentId: "ag_123xyz",
|
|
8
|
-
* customerId: "cust_123xy"
|
|
9
|
+
* customerId: "cust_123xy",
|
|
10
|
+
* limit: 10,
|
|
11
|
+
* cursor: "AAABjnBU9gBl/0BQt1axI0VniQI="
|
|
9
12
|
* }
|
|
10
13
|
*/
|
|
11
14
|
export interface SessionsListRequest {
|
|
12
15
|
agentId?: string;
|
|
13
16
|
customerId?: string;
|
|
17
|
+
labels?: string | string[];
|
|
18
|
+
limit?: number;
|
|
19
|
+
cursor?: string;
|
|
20
|
+
sort?: Parlant.SortDirectionDto;
|
|
14
21
|
}
|
|
@@ -5,3 +5,5 @@ export { type SessionUpdateParams } from "./SessionUpdateParams";
|
|
|
5
5
|
export { type SessionsListEventsRequest } from "./SessionsListEventsRequest";
|
|
6
6
|
export { type EventCreationParams } from "./EventCreationParams";
|
|
7
7
|
export { type SessionsDeleteEventsRequest } from "./SessionsDeleteEventsRequest";
|
|
8
|
+
export { type SessionsReadEventRequest } from "./SessionsReadEventRequest";
|
|
9
|
+
export { type EventUpdateParams } from "./EventUpdateParams";
|
|
@@ -14,4 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types"), exports);
|
|
17
18
|
__exportStar(require("./client"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./SessionsListResponse";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./SessionsListResponse"), exports);
|
|
@@ -24,17 +24,20 @@ export declare class Tags {
|
|
|
24
24
|
protected readonly _options: Tags.Options;
|
|
25
25
|
constructor(_options: Tags.Options);
|
|
26
26
|
/**
|
|
27
|
-
* Lists all tags in the system.
|
|
27
|
+
* Lists all tags in the system, optionally filtered by name.
|
|
28
28
|
*
|
|
29
|
-
* Returns an empty list if no tags exist.
|
|
29
|
+
* Returns an empty list if no tags exist or none match the filter.
|
|
30
30
|
* Tags are returned in no particular order.
|
|
31
31
|
*
|
|
32
|
+
* @param {Parlant.TagsListRequest} request
|
|
32
33
|
* @param {Tags.RequestOptions} requestOptions - Request-specific configuration.
|
|
33
34
|
*
|
|
35
|
+
* @throws {@link Parlant.UnprocessableEntityError}
|
|
36
|
+
*
|
|
34
37
|
* @example
|
|
35
38
|
* await client.tags.list()
|
|
36
39
|
*/
|
|
37
|
-
list(requestOptions?: Tags.RequestOptions): Promise<Parlant.Tag[]>;
|
|
40
|
+
list(request?: Parlant.TagsListRequest, requestOptions?: Tags.RequestOptions): Promise<Parlant.Tag[]>;
|
|
38
41
|
/**
|
|
39
42
|
* Creates a new tag with the specified name.
|
|
40
43
|
*
|
|
@@ -59,24 +59,33 @@ class Tags {
|
|
|
59
59
|
this._options = _options;
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
|
-
* Lists all tags in the system.
|
|
62
|
+
* Lists all tags in the system, optionally filtered by name.
|
|
63
63
|
*
|
|
64
|
-
* Returns an empty list if no tags exist.
|
|
64
|
+
* Returns an empty list if no tags exist or none match the filter.
|
|
65
65
|
* Tags are returned in no particular order.
|
|
66
66
|
*
|
|
67
|
+
* @param {Parlant.TagsListRequest} request
|
|
67
68
|
* @param {Tags.RequestOptions} requestOptions - Request-specific configuration.
|
|
68
69
|
*
|
|
70
|
+
* @throws {@link Parlant.UnprocessableEntityError}
|
|
71
|
+
*
|
|
69
72
|
* @example
|
|
70
73
|
* await client.tags.list()
|
|
71
74
|
*/
|
|
72
|
-
list(
|
|
73
|
-
return __awaiter(this,
|
|
75
|
+
list() {
|
|
76
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
74
77
|
var _a;
|
|
78
|
+
const { name } = request;
|
|
79
|
+
const _queryParams = {};
|
|
80
|
+
if (name != null) {
|
|
81
|
+
_queryParams["name"] = name;
|
|
82
|
+
}
|
|
75
83
|
const _response = yield core.fetcher({
|
|
76
84
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment)), "tags"),
|
|
77
85
|
method: "GET",
|
|
78
86
|
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
79
87
|
contentType: "application/json",
|
|
88
|
+
queryParameters: _queryParams,
|
|
80
89
|
requestType: "json",
|
|
81
90
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
82
91
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -91,10 +100,15 @@ class Tags {
|
|
|
91
100
|
});
|
|
92
101
|
}
|
|
93
102
|
if (_response.error.reason === "status-code") {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
103
|
+
switch (_response.error.statusCode) {
|
|
104
|
+
case 422:
|
|
105
|
+
throw new Parlant.UnprocessableEntityError(_response.error.body);
|
|
106
|
+
default:
|
|
107
|
+
throw new errors.ParlantError({
|
|
108
|
+
statusCode: _response.error.statusCode,
|
|
109
|
+
body: _response.error.body,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
98
112
|
}
|
|
99
113
|
switch (_response.error.reason) {
|
|
100
114
|
case "non-json":
|
package/src/api/types/Agent.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export interface Agent {
|
|
|
20
20
|
/** Maximum number of processing iterations the agent can perform per request */
|
|
21
21
|
maxEngineIterations?: number;
|
|
22
22
|
compositionMode: Parlant.CompositionModeDto;
|
|
23
|
+
messageOutputMode: Parlant.MessageOutputModeDto;
|
|
23
24
|
/** List of tag IDs associated with the agent */
|
|
24
25
|
tags?: string[];
|
|
25
26
|
}
|