@d19n/youfibre-odin-sdk 2.0.338 → 2.0.340
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 +10 -2
- package/dist/EntityRegistry.d.ts +2 -0
- package/dist/EntityRegistry.js +2 -0
- package/dist/OdinApiClient.d.ts +4 -0
- package/dist/OdinApiClient.js +8 -0
- package/dist/OdinDbClient.d.ts +4 -0
- package/dist/OdinDbClient.js +8 -0
- package/dist/accessors-v2/AiRouteRequestAccessor.d.ts +112 -0
- package/dist/accessors-v2/AiRouteRequestAccessor.js +191 -0
- package/dist/accessors-v2/index.d.ts +1 -0
- package/dist/accessors-v2/index.js +5 -3
- package/dist/actions-v2/CreateAiRouteRequestDto.d.ts +165 -0
- package/dist/actions-v2/CreateAiRouteRequestDto.js +57 -0
- package/dist/actions-v2/CreateLeadSalesAppDto.d.ts +1 -1
- package/dist/actions-v2/UpdateAppointmentSalesAppDto.d.ts +129 -0
- package/dist/actions-v2/UpdateAppointmentSalesAppDto.js +56 -0
- package/dist/api-sdk-v2/AiRouteRequestApi.d.ts +45 -0
- package/dist/api-sdk-v2/AiRouteRequestApi.js +151 -0
- package/dist/db-accessors-v2/AiRouteRequestDbAccessor.d.ts +180 -0
- package/dist/db-accessors-v2/AiRouteRequestDbAccessor.js +265 -0
- package/dist/db-accessors-v2/index.d.ts +1 -0
- package/dist/db-accessors-v2/index.js +5 -3
- package/dist/db-sdk-v2/AiRouteRequestDb.d.ts +117 -0
- package/dist/db-sdk-v2/AiRouteRequestDb.js +200 -0
- package/dist/entities-v2/AiRouteRequest.d.ts +248 -0
- package/dist/entities-v2/AiRouteRequest.js +162 -0
- package/dist/entities-v2/Appointment.d.ts +16 -16
- package/dist/entities-v2/Appointment.js +4 -4
- package/dist/entities-v2/Lead.d.ts +2 -0
- package/dist/entities-v2/Lead.js +2 -0
- package/dist/entities-v2/Order.d.ts +23 -1
- package/dist/entities-v2/Order.js +18 -2
- package/dist/records-v2/AiRouteRequestRecord.d.ts +186 -0
- package/dist/records-v2/AiRouteRequestRecord.js +245 -0
- package/dist/records-v2/AppointmentRecord.d.ts +28 -0
- package/dist/records-v2/AppointmentRecord.js +40 -0
- package/dist/records-v2/index.d.ts +1 -0
- package/dist/records-v2/index.js +8 -4
- package/package.json +1 -1
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AiRouteRequestDb = void 0;
|
|
13
|
+
const db_provider_1 = require("@d19n/odin-sdk-generator/dist/db.provider");
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Use OdinDbClient.
|
|
16
|
+
*
|
|
17
|
+
* Migration:
|
|
18
|
+
* - Old: new AiRouteRequestApi(authParams).get(id)
|
|
19
|
+
* - New: new odin.airouterequest.get(id)
|
|
20
|
+
*
|
|
21
|
+
* The new OdinDbClient returns typed record wrappers with action methods.
|
|
22
|
+
*
|
|
23
|
+
* Supports separate query options and provider options:
|
|
24
|
+
* - Constructor level: new AiRouteRequestDb(principal, dbService, { omitPermissionsCheck: true })
|
|
25
|
+
* - Method level: await db.getByPrimaryKey(id, { entities: [] }, { omitPermissionsCheck: true })
|
|
26
|
+
*/
|
|
27
|
+
class AiRouteRequestDb extends db_provider_1.DbProvider {
|
|
28
|
+
// ============================================
|
|
29
|
+
// PRIVATE BACKING FIELDS (Lazy Loading)
|
|
30
|
+
// ============================================
|
|
31
|
+
constructor(principal, dbService, defaultOptions) {
|
|
32
|
+
super(principal, dbService, defaultOptions);
|
|
33
|
+
this.moduleName = 'SupportModule';
|
|
34
|
+
this.entityName = 'AiRouteRequest';
|
|
35
|
+
this.principal = principal;
|
|
36
|
+
this.dbService = dbService;
|
|
37
|
+
// Link managers are lazy-loaded on first access
|
|
38
|
+
}
|
|
39
|
+
// ============================================
|
|
40
|
+
// LAZY-LOADED LINK MANAGERS (Public Getters)
|
|
41
|
+
// ============================================
|
|
42
|
+
// Usage remains identical: db.address.list(recordId)
|
|
43
|
+
// ============================================
|
|
44
|
+
// STANDARD METHODS
|
|
45
|
+
// ============================================
|
|
46
|
+
// Methods support separate query options and provider options for clean API
|
|
47
|
+
setRecord(sourceRecord) {
|
|
48
|
+
this.sourceRecord = sourceRecord;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Search records with manual pagination control
|
|
52
|
+
* @param params - Search parameters
|
|
53
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
54
|
+
*/
|
|
55
|
+
searchRecords(params, providerOptions) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
return yield this._searchRecords(this.moduleName, this.entityName, params, providerOptions);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Search all records with automatic pagination
|
|
62
|
+
* @param params - Search parameters
|
|
63
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
64
|
+
*/
|
|
65
|
+
searchAllRecordsAndPaginate(params, providerOptions) {
|
|
66
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
return yield this._searchAllRecordsAndPaginate(this.moduleName, this.entityName, params, 0, providerOptions);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Get a single record by primary key
|
|
72
|
+
* @param aiRouteRequestId - Record ID
|
|
73
|
+
* @param queryOptions - Query options (WHAT: entities to include)
|
|
74
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* // Simple get
|
|
78
|
+
* const record = await db.getByPrimaryKey(id);
|
|
79
|
+
*
|
|
80
|
+
* // With related entities
|
|
81
|
+
* const record = await db.getByPrimaryKey(id, { entities: ['InvoiceItem', 'Transaction'] });
|
|
82
|
+
*
|
|
83
|
+
* // With permissions bypass
|
|
84
|
+
* const record = await db.getByPrimaryKey(id, {}, { omitPermissionsCheck: true });
|
|
85
|
+
*
|
|
86
|
+
* // Both options
|
|
87
|
+
* const record = await db.getByPrimaryKey(id, { entities: ['Invoice'] }, { omitPermissionsCheck: true });
|
|
88
|
+
*/
|
|
89
|
+
getByPrimaryKey(aiRouteRequestId, queryOptions, providerOptions) {
|
|
90
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
91
|
+
const res = yield this._getByPrimaryKey(this.moduleName, this.entityName, aiRouteRequestId, queryOptions, providerOptions);
|
|
92
|
+
if (res)
|
|
93
|
+
this.setRecord(res);
|
|
94
|
+
return res;
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Get multiple records by primary keys
|
|
99
|
+
* @param aiRouteRequestIds - Array of record IDs
|
|
100
|
+
* @param queryOptions - Query options (WHAT: entities to include)
|
|
101
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
102
|
+
*/
|
|
103
|
+
getManyByPrimaryKey(aiRouteRequestIds, queryOptions, providerOptions) {
|
|
104
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
105
|
+
return yield this._getManyByPrimaryKey(this.moduleName, this.entityName, aiRouteRequestIds, queryOptions, providerOptions);
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Upsert a single record
|
|
110
|
+
* @param upsertDto - Record to upsert
|
|
111
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
112
|
+
*/
|
|
113
|
+
upsert(upsertDto, providerOptions) {
|
|
114
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
115
|
+
const res = yield this._upsert(this.moduleName, this.entityName, [upsertDto], providerOptions);
|
|
116
|
+
return res[0];
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Upsert multiple records
|
|
121
|
+
* @param upsertDtos - Records to upsert
|
|
122
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
123
|
+
*/
|
|
124
|
+
upsertMany(upsertDtos, providerOptions) {
|
|
125
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
126
|
+
return yield this._upsert(this.moduleName, this.entityName, upsertDtos, providerOptions);
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Update a single record
|
|
131
|
+
* @param updateDto - Record to update
|
|
132
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
133
|
+
*/
|
|
134
|
+
update(updateDto, providerOptions) {
|
|
135
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
136
|
+
const res = yield this._update(this.moduleName, this.entityName, [updateDto], providerOptions);
|
|
137
|
+
return res[0];
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Update multiple records
|
|
142
|
+
* @param updateDtos - Records to update
|
|
143
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
144
|
+
*/
|
|
145
|
+
updateMany(updateDtos, providerOptions) {
|
|
146
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
147
|
+
return yield this._update(this.moduleName, this.entityName, updateDtos, providerOptions);
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Delete one or many records
|
|
152
|
+
* @param aiRouteRequestIds - Record IDs to delete
|
|
153
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
154
|
+
*/
|
|
155
|
+
delete(aiRouteRequestIds, providerOptions) {
|
|
156
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
157
|
+
return yield this._delete(this.moduleName, this.entityName, aiRouteRequestIds, providerOptions);
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Restore one or many deleted records
|
|
162
|
+
* @param aiRouteRequestIds - Record IDs to restore
|
|
163
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
164
|
+
*/
|
|
165
|
+
restore(aiRouteRequestIds, providerOptions) {
|
|
166
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
167
|
+
return yield this._restore(this.moduleName, this.entityName, aiRouteRequestIds, providerOptions);
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Apply an action to a record
|
|
172
|
+
* @param actionName - The action key
|
|
173
|
+
* @param dto - The action DTO
|
|
174
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
175
|
+
*/
|
|
176
|
+
applyAction(actionName, dto, providerOptions) {
|
|
177
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
178
|
+
return yield this._applyAction(this.moduleName, this.entityName, dto, providerOptions);
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Get version history for the current source record
|
|
183
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
184
|
+
*/
|
|
185
|
+
getVersions(providerOptions) {
|
|
186
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
187
|
+
return yield this._getVersions(this.moduleName, this.entityName, this.sourceRecord.id, providerOptions);
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Get revision timeline for the current source record
|
|
192
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
193
|
+
*/
|
|
194
|
+
getRevisionTimeline(providerOptions) {
|
|
195
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
196
|
+
return yield this._getRevisionTimeline(this.moduleName, this.entityName, this.sourceRecord.id, providerOptions);
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
exports.AiRouteRequestDb = AiRouteRequestDb;
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AiRouteRequest Entity Definition
|
|
3
|
+
*
|
|
4
|
+
* One AI request handled by the AI provider router: the feature, the model that answered (Qwen or Databricks), tries, latency and outcome. Written by youfibre-api-support after every routed request; read by the AI traffic dashboard. Not edited by people.
|
|
5
|
+
*
|
|
6
|
+
* @module SupportModule
|
|
7
|
+
* @entity AiRouteRequest
|
|
8
|
+
* @schemaId 6e672d1d-d7c4-401d-8bcc-042b208664d6
|
|
9
|
+
*
|
|
10
|
+
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
11
|
+
* Generated from Odin schema definition
|
|
12
|
+
*/
|
|
13
|
+
import { OdinRecord } from '@d19n/odin-types/dist/core';
|
|
14
|
+
/**
|
|
15
|
+
* Available types for AiRouteRequest records
|
|
16
|
+
*/
|
|
17
|
+
export declare enum AiRouteRequestEntityTypes {
|
|
18
|
+
/** This is the default record type */
|
|
19
|
+
DEFAULT = "DEFAULT"
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Valid values for AiRouteRequest.Feature
|
|
23
|
+
*
|
|
24
|
+
* Which AI feature made the request.
|
|
25
|
+
*
|
|
26
|
+
* @remarks Available options:
|
|
27
|
+
* - `CASE_SENTIMENT`
|
|
28
|
+
* - `CASE_TAGGING`
|
|
29
|
+
* - `CHAT_SUMMARY`
|
|
30
|
+
* - `CUSTOMER_CONTEXT_SUMMARY`
|
|
31
|
+
* - `MAGRATHEA_PORTING`
|
|
32
|
+
* - `QA_REPORT`
|
|
33
|
+
*/
|
|
34
|
+
export declare enum AiRouteRequestFeature {
|
|
35
|
+
CASE_SENTIMENT = "CASE_SENTIMENT",
|
|
36
|
+
CASE_TAGGING = "CASE_TAGGING",
|
|
37
|
+
CHAT_SUMMARY = "CHAT_SUMMARY",
|
|
38
|
+
CUSTOMER_CONTEXT_SUMMARY = "CUSTOMER_CONTEXT_SUMMARY",
|
|
39
|
+
MAGRATHEA_PORTING = "MAGRATHEA_PORTING",
|
|
40
|
+
QA_REPORT = "QA_REPORT"
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Valid values for AiRouteRequest.Provider
|
|
44
|
+
*
|
|
45
|
+
* The model that answered: qwen (Kattuz) or databricks.
|
|
46
|
+
*
|
|
47
|
+
* @remarks Available options:
|
|
48
|
+
* - `databricks`
|
|
49
|
+
* - `qwen`
|
|
50
|
+
*/
|
|
51
|
+
export declare enum AiRouteRequestProvider {
|
|
52
|
+
DATABRICKS = "databricks",
|
|
53
|
+
QWEN = "qwen"
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Valid values for AiRouteRequest.Outcome
|
|
57
|
+
*
|
|
58
|
+
* ok when the provider answered and the reply passed its check; failed after the last try.
|
|
59
|
+
*
|
|
60
|
+
* @remarks Available options:
|
|
61
|
+
* - `failed`
|
|
62
|
+
* - `ok`
|
|
63
|
+
*/
|
|
64
|
+
export declare enum AiRouteRequestOutcome {
|
|
65
|
+
FAILED = "failed",
|
|
66
|
+
OK = "ok"
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Valid values for AiRouteRequest.Reason
|
|
70
|
+
*
|
|
71
|
+
* split: the 50/50 counter chose. Otherwise why the split was skipped and Databricks answered: config-off, config-unreadable, redis-unavailable, too-large (prompt over the Qwen size guard).
|
|
72
|
+
*
|
|
73
|
+
* @remarks Available options:
|
|
74
|
+
* - `config-off`
|
|
75
|
+
* - `config-unreadable`
|
|
76
|
+
* - `redis-unavailable`
|
|
77
|
+
* - `split`
|
|
78
|
+
* - `too-large`
|
|
79
|
+
*/
|
|
80
|
+
export declare enum AiRouteRequestReason {
|
|
81
|
+
CONFIG_OFF = "config-off",
|
|
82
|
+
CONFIG_UNREADABLE = "config-unreadable",
|
|
83
|
+
REDIS_UNAVAILABLE = "redis-unavailable",
|
|
84
|
+
SPLIT = "split",
|
|
85
|
+
TOO_LARGE = "too-large"
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Property keys for AiRouteRequest
|
|
89
|
+
* Use these constants instead of string literals for type safety
|
|
90
|
+
*/
|
|
91
|
+
export declare enum AiRouteRequestPropertyKeys {
|
|
92
|
+
/** Which AI feature made the request. */
|
|
93
|
+
Feature = "Feature",
|
|
94
|
+
/** The model that answered: qwen (Kattuz) or databricks. */
|
|
95
|
+
Provider = "Provider",
|
|
96
|
+
/** ok when the provider answered and the reply passed its check; failed after the last try. */
|
|
97
|
+
Outcome = "Outcome",
|
|
98
|
+
/** split: the 50/50 counter chose. Otherwise why the split was skipped and Databricks answered: config-off, config-unreadable, redis-unavailable, too-large (prompt over the Qwen size guard). */
|
|
99
|
+
Reason = "Reason",
|
|
100
|
+
/** The per-feature counter value this request drew (odd = qwen, even = databricks). Empty when the split was skipped. */
|
|
101
|
+
Count = "Count",
|
|
102
|
+
/** 1 for Databricks; 1 to 6 for Qwen (one try plus up to five retries). */
|
|
103
|
+
Attempts = "Attempts",
|
|
104
|
+
/** Wall time of the whole request including retries, in milliseconds. */
|
|
105
|
+
LatencyMs = "LatencyMs",
|
|
106
|
+
/** true for a request a person is waiting for (one Qwen try); false for background work (retried). */
|
|
107
|
+
OnScreen = "OnScreen",
|
|
108
|
+
/** Characters sent to the model. Filled for Qwen turns; empty for Databricks turns until the proxy reports it. */
|
|
109
|
+
PromptChars = "PromptChars",
|
|
110
|
+
/** llm_endpoint_used from the result, e.g. Qwen3.8-27B-FP8 or system.ai.gpt-5-4-nano. Empty on failure. */
|
|
111
|
+
ModelUsed = "ModelUsed",
|
|
112
|
+
/** First 500 characters of the failure message. Empty on success. */
|
|
113
|
+
ErrorMessage = "ErrorMessage",
|
|
114
|
+
/** Case or Conversation. */
|
|
115
|
+
JourneyEntity = "JourneyEntity",
|
|
116
|
+
/** Id of the case or conversation the request was for. Links the row back to the record. */
|
|
117
|
+
JourneyId = "JourneyId",
|
|
118
|
+
/** When the router started the request. The record is written a few hundred milliseconds later. */
|
|
119
|
+
StartedAt = "StartedAt"
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Properties for AiRouteRequest records
|
|
123
|
+
*
|
|
124
|
+
* @see SupportModule:AiRouteRequest
|
|
125
|
+
*/
|
|
126
|
+
export interface AiRouteRequestProperties {
|
|
127
|
+
/** Which AI feature made the request.
|
|
128
|
+
*
|
|
129
|
+
* @type {ENUM}
|
|
130
|
+
* @default
|
|
131
|
+
* @enum {AiRouteRequestFeature}
|
|
132
|
+
*/
|
|
133
|
+
Feature: AiRouteRequestFeature;
|
|
134
|
+
/** The model that answered: qwen (Kattuz) or databricks.
|
|
135
|
+
*
|
|
136
|
+
* @type {ENUM}
|
|
137
|
+
* @default
|
|
138
|
+
* @enum {AiRouteRequestProvider}
|
|
139
|
+
*/
|
|
140
|
+
Provider: AiRouteRequestProvider;
|
|
141
|
+
/** ok when the provider answered and the reply passed its check; failed after the last try.
|
|
142
|
+
*
|
|
143
|
+
* @type {ENUM}
|
|
144
|
+
* @default
|
|
145
|
+
* @enum {AiRouteRequestOutcome}
|
|
146
|
+
*/
|
|
147
|
+
Outcome: AiRouteRequestOutcome;
|
|
148
|
+
/** split: the 50/50 counter chose. Otherwise why the split was skipped and Databricks answered: config-off, config-unreadable, redis-unavailable, too-large (prompt over the Qwen size guard).
|
|
149
|
+
*
|
|
150
|
+
* @type {ENUM}
|
|
151
|
+
* @default
|
|
152
|
+
* @enum {AiRouteRequestReason}
|
|
153
|
+
*/
|
|
154
|
+
Reason: AiRouteRequestReason;
|
|
155
|
+
/** The per-feature counter value this request drew (odd = qwen, even = databricks). Empty when the split was skipped.
|
|
156
|
+
*
|
|
157
|
+
* @type {NUMBER}
|
|
158
|
+
* @default
|
|
159
|
+
*/
|
|
160
|
+
Count: number;
|
|
161
|
+
/** 1 for Databricks; 1 to 6 for Qwen (one try plus up to five retries).
|
|
162
|
+
*
|
|
163
|
+
* @type {NUMBER}
|
|
164
|
+
* @default
|
|
165
|
+
*/
|
|
166
|
+
Attempts: number;
|
|
167
|
+
/** Wall time of the whole request including retries, in milliseconds.
|
|
168
|
+
*
|
|
169
|
+
* @type {NUMBER}
|
|
170
|
+
* @default
|
|
171
|
+
*/
|
|
172
|
+
LatencyMs: number;
|
|
173
|
+
/** true for a request a person is waiting for (one Qwen try); false for background work (retried).
|
|
174
|
+
*
|
|
175
|
+
* @type {BOOLEAN}
|
|
176
|
+
* @default
|
|
177
|
+
*/
|
|
178
|
+
OnScreen: boolean;
|
|
179
|
+
/** Characters sent to the model. Filled for Qwen turns; empty for Databricks turns until the proxy reports it.
|
|
180
|
+
*
|
|
181
|
+
* @type {NUMBER}
|
|
182
|
+
* @default
|
|
183
|
+
*/
|
|
184
|
+
PromptChars: number;
|
|
185
|
+
/** llm_endpoint_used from the result, e.g. Qwen3.8-27B-FP8 or system.ai.gpt-5-4-nano. Empty on failure.
|
|
186
|
+
*
|
|
187
|
+
* @type {TEXT}
|
|
188
|
+
* @default
|
|
189
|
+
*/
|
|
190
|
+
ModelUsed: string;
|
|
191
|
+
/** First 500 characters of the failure message. Empty on success.
|
|
192
|
+
*
|
|
193
|
+
* @type {TEXT}
|
|
194
|
+
* @default
|
|
195
|
+
*/
|
|
196
|
+
ErrorMessage: string;
|
|
197
|
+
/** Case or Conversation.
|
|
198
|
+
*
|
|
199
|
+
* @type {TEXT}
|
|
200
|
+
* @default
|
|
201
|
+
*/
|
|
202
|
+
JourneyEntity: string;
|
|
203
|
+
/** Id of the case or conversation the request was for. Links the row back to the record.
|
|
204
|
+
*
|
|
205
|
+
* @type {TEXT}
|
|
206
|
+
* @default
|
|
207
|
+
*/
|
|
208
|
+
JourneyId: string;
|
|
209
|
+
/** When the router started the request. The record is written a few hundred milliseconds later.
|
|
210
|
+
*
|
|
211
|
+
* @type {DATE_TIME}
|
|
212
|
+
* @default
|
|
213
|
+
*/
|
|
214
|
+
StartedAt: string;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* AiRouteRequest entity from SupportModule
|
|
218
|
+
*
|
|
219
|
+
* One AI request handled by the AI provider router: the feature, the model that answered (Qwen or Databricks), tries, latency and outcome. Written by youfibre-api-support after every routed request; read by the AI traffic dashboard. Not edited by people.
|
|
220
|
+
*
|
|
221
|
+
* @module SupportModule
|
|
222
|
+
* @entity AiRouteRequest
|
|
223
|
+
* @schemaId 6e672d1d-d7c4-401d-8bcc-042b208664d6
|
|
224
|
+
* @recordPrefix AIR
|
|
225
|
+
* @capabilities searchable, updateable, undeletable, triggerable
|
|
226
|
+
*/
|
|
227
|
+
export declare class AiRouteRequest extends OdinRecord<AiRouteRequestProperties> {
|
|
228
|
+
entity: 'SupportModule:AiRouteRequest';
|
|
229
|
+
type: AiRouteRequestEntityTypes;
|
|
230
|
+
schemaId: '6e672d1d-d7c4-401d-8bcc-042b208664d6';
|
|
231
|
+
properties: AiRouteRequestProperties;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* RabbitMQ routing keys for AiRouteRequest events
|
|
235
|
+
*/
|
|
236
|
+
export declare const ROUTING_KEY_AI_ROUTE_REQUEST_CREATED = "SupportModule.AiRouteRequest.SubDbRecordCreated";
|
|
237
|
+
export declare const ROUTING_KEY_AI_ROUTE_REQUEST_UPDATED = "SupportModule.AiRouteRequest.SubDbRecordUpdated";
|
|
238
|
+
export declare const ROUTING_KEY_AI_ROUTE_REQUEST_DELETED = "SupportModule.AiRouteRequest.SubDbRecordDeleted";
|
|
239
|
+
/**
|
|
240
|
+
* Type-specific routing keys for AiRouteRequest events
|
|
241
|
+
* Subscribe to these for events on specific entity types only
|
|
242
|
+
*/
|
|
243
|
+
/** This is the default record type created */
|
|
244
|
+
export declare const ROUTING_KEY_AI_ROUTE_REQUEST_DEFAULT_CREATED = "SupportModule.AiRouteRequest.DEFAULT.SubDbRecordCreated";
|
|
245
|
+
/** This is the default record type updated */
|
|
246
|
+
export declare const ROUTING_KEY_AI_ROUTE_REQUEST_DEFAULT_UPDATED = "SupportModule.AiRouteRequest.DEFAULT.SubDbRecordUpdated";
|
|
247
|
+
/** This is the default record type deleted */
|
|
248
|
+
export declare const ROUTING_KEY_AI_ROUTE_REQUEST_DEFAULT_DELETED = "SupportModule.AiRouteRequest.DEFAULT.SubDbRecordDeleted";
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* AiRouteRequest Entity Definition
|
|
4
|
+
*
|
|
5
|
+
* One AI request handled by the AI provider router: the feature, the model that answered (Qwen or Databricks), tries, latency and outcome. Written by youfibre-api-support after every routed request; read by the AI traffic dashboard. Not edited by people.
|
|
6
|
+
*
|
|
7
|
+
* @module SupportModule
|
|
8
|
+
* @entity AiRouteRequest
|
|
9
|
+
* @schemaId 6e672d1d-d7c4-401d-8bcc-042b208664d6
|
|
10
|
+
*
|
|
11
|
+
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
12
|
+
* Generated from Odin schema definition
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.ROUTING_KEY_AI_ROUTE_REQUEST_DEFAULT_DELETED = exports.ROUTING_KEY_AI_ROUTE_REQUEST_DEFAULT_UPDATED = exports.ROUTING_KEY_AI_ROUTE_REQUEST_DEFAULT_CREATED = exports.ROUTING_KEY_AI_ROUTE_REQUEST_DELETED = exports.ROUTING_KEY_AI_ROUTE_REQUEST_UPDATED = exports.ROUTING_KEY_AI_ROUTE_REQUEST_CREATED = exports.AiRouteRequest = exports.AiRouteRequestPropertyKeys = exports.AiRouteRequestReason = exports.AiRouteRequestOutcome = exports.AiRouteRequestProvider = exports.AiRouteRequestFeature = exports.AiRouteRequestEntityTypes = void 0;
|
|
16
|
+
const core_1 = require("@d19n/odin-types/dist/core");
|
|
17
|
+
/**
|
|
18
|
+
* Available types for AiRouteRequest records
|
|
19
|
+
*/
|
|
20
|
+
var AiRouteRequestEntityTypes;
|
|
21
|
+
(function (AiRouteRequestEntityTypes) {
|
|
22
|
+
/** This is the default record type */
|
|
23
|
+
AiRouteRequestEntityTypes["DEFAULT"] = "DEFAULT";
|
|
24
|
+
})(AiRouteRequestEntityTypes = exports.AiRouteRequestEntityTypes || (exports.AiRouteRequestEntityTypes = {}));
|
|
25
|
+
/**
|
|
26
|
+
* Valid values for AiRouteRequest.Feature
|
|
27
|
+
*
|
|
28
|
+
* Which AI feature made the request.
|
|
29
|
+
*
|
|
30
|
+
* @remarks Available options:
|
|
31
|
+
* - `CASE_SENTIMENT`
|
|
32
|
+
* - `CASE_TAGGING`
|
|
33
|
+
* - `CHAT_SUMMARY`
|
|
34
|
+
* - `CUSTOMER_CONTEXT_SUMMARY`
|
|
35
|
+
* - `MAGRATHEA_PORTING`
|
|
36
|
+
* - `QA_REPORT`
|
|
37
|
+
*/
|
|
38
|
+
var AiRouteRequestFeature;
|
|
39
|
+
(function (AiRouteRequestFeature) {
|
|
40
|
+
AiRouteRequestFeature["CASE_SENTIMENT"] = "CASE_SENTIMENT";
|
|
41
|
+
AiRouteRequestFeature["CASE_TAGGING"] = "CASE_TAGGING";
|
|
42
|
+
AiRouteRequestFeature["CHAT_SUMMARY"] = "CHAT_SUMMARY";
|
|
43
|
+
AiRouteRequestFeature["CUSTOMER_CONTEXT_SUMMARY"] = "CUSTOMER_CONTEXT_SUMMARY";
|
|
44
|
+
AiRouteRequestFeature["MAGRATHEA_PORTING"] = "MAGRATHEA_PORTING";
|
|
45
|
+
AiRouteRequestFeature["QA_REPORT"] = "QA_REPORT";
|
|
46
|
+
})(AiRouteRequestFeature = exports.AiRouteRequestFeature || (exports.AiRouteRequestFeature = {}));
|
|
47
|
+
/**
|
|
48
|
+
* Valid values for AiRouteRequest.Provider
|
|
49
|
+
*
|
|
50
|
+
* The model that answered: qwen (Kattuz) or databricks.
|
|
51
|
+
*
|
|
52
|
+
* @remarks Available options:
|
|
53
|
+
* - `databricks`
|
|
54
|
+
* - `qwen`
|
|
55
|
+
*/
|
|
56
|
+
var AiRouteRequestProvider;
|
|
57
|
+
(function (AiRouteRequestProvider) {
|
|
58
|
+
AiRouteRequestProvider["DATABRICKS"] = "databricks";
|
|
59
|
+
AiRouteRequestProvider["QWEN"] = "qwen";
|
|
60
|
+
})(AiRouteRequestProvider = exports.AiRouteRequestProvider || (exports.AiRouteRequestProvider = {}));
|
|
61
|
+
/**
|
|
62
|
+
* Valid values for AiRouteRequest.Outcome
|
|
63
|
+
*
|
|
64
|
+
* ok when the provider answered and the reply passed its check; failed after the last try.
|
|
65
|
+
*
|
|
66
|
+
* @remarks Available options:
|
|
67
|
+
* - `failed`
|
|
68
|
+
* - `ok`
|
|
69
|
+
*/
|
|
70
|
+
var AiRouteRequestOutcome;
|
|
71
|
+
(function (AiRouteRequestOutcome) {
|
|
72
|
+
AiRouteRequestOutcome["FAILED"] = "failed";
|
|
73
|
+
AiRouteRequestOutcome["OK"] = "ok";
|
|
74
|
+
})(AiRouteRequestOutcome = exports.AiRouteRequestOutcome || (exports.AiRouteRequestOutcome = {}));
|
|
75
|
+
/**
|
|
76
|
+
* Valid values for AiRouteRequest.Reason
|
|
77
|
+
*
|
|
78
|
+
* split: the 50/50 counter chose. Otherwise why the split was skipped and Databricks answered: config-off, config-unreadable, redis-unavailable, too-large (prompt over the Qwen size guard).
|
|
79
|
+
*
|
|
80
|
+
* @remarks Available options:
|
|
81
|
+
* - `config-off`
|
|
82
|
+
* - `config-unreadable`
|
|
83
|
+
* - `redis-unavailable`
|
|
84
|
+
* - `split`
|
|
85
|
+
* - `too-large`
|
|
86
|
+
*/
|
|
87
|
+
var AiRouteRequestReason;
|
|
88
|
+
(function (AiRouteRequestReason) {
|
|
89
|
+
AiRouteRequestReason["CONFIG_OFF"] = "config-off";
|
|
90
|
+
AiRouteRequestReason["CONFIG_UNREADABLE"] = "config-unreadable";
|
|
91
|
+
AiRouteRequestReason["REDIS_UNAVAILABLE"] = "redis-unavailable";
|
|
92
|
+
AiRouteRequestReason["SPLIT"] = "split";
|
|
93
|
+
AiRouteRequestReason["TOO_LARGE"] = "too-large";
|
|
94
|
+
})(AiRouteRequestReason = exports.AiRouteRequestReason || (exports.AiRouteRequestReason = {}));
|
|
95
|
+
/**
|
|
96
|
+
* Property keys for AiRouteRequest
|
|
97
|
+
* Use these constants instead of string literals for type safety
|
|
98
|
+
*/
|
|
99
|
+
var AiRouteRequestPropertyKeys;
|
|
100
|
+
(function (AiRouteRequestPropertyKeys) {
|
|
101
|
+
/** Which AI feature made the request. */
|
|
102
|
+
AiRouteRequestPropertyKeys["Feature"] = "Feature";
|
|
103
|
+
/** The model that answered: qwen (Kattuz) or databricks. */
|
|
104
|
+
AiRouteRequestPropertyKeys["Provider"] = "Provider";
|
|
105
|
+
/** ok when the provider answered and the reply passed its check; failed after the last try. */
|
|
106
|
+
AiRouteRequestPropertyKeys["Outcome"] = "Outcome";
|
|
107
|
+
/** split: the 50/50 counter chose. Otherwise why the split was skipped and Databricks answered: config-off, config-unreadable, redis-unavailable, too-large (prompt over the Qwen size guard). */
|
|
108
|
+
AiRouteRequestPropertyKeys["Reason"] = "Reason";
|
|
109
|
+
/** The per-feature counter value this request drew (odd = qwen, even = databricks). Empty when the split was skipped. */
|
|
110
|
+
AiRouteRequestPropertyKeys["Count"] = "Count";
|
|
111
|
+
/** 1 for Databricks; 1 to 6 for Qwen (one try plus up to five retries). */
|
|
112
|
+
AiRouteRequestPropertyKeys["Attempts"] = "Attempts";
|
|
113
|
+
/** Wall time of the whole request including retries, in milliseconds. */
|
|
114
|
+
AiRouteRequestPropertyKeys["LatencyMs"] = "LatencyMs";
|
|
115
|
+
/** true for a request a person is waiting for (one Qwen try); false for background work (retried). */
|
|
116
|
+
AiRouteRequestPropertyKeys["OnScreen"] = "OnScreen";
|
|
117
|
+
/** Characters sent to the model. Filled for Qwen turns; empty for Databricks turns until the proxy reports it. */
|
|
118
|
+
AiRouteRequestPropertyKeys["PromptChars"] = "PromptChars";
|
|
119
|
+
/** llm_endpoint_used from the result, e.g. Qwen3.8-27B-FP8 or system.ai.gpt-5-4-nano. Empty on failure. */
|
|
120
|
+
AiRouteRequestPropertyKeys["ModelUsed"] = "ModelUsed";
|
|
121
|
+
/** First 500 characters of the failure message. Empty on success. */
|
|
122
|
+
AiRouteRequestPropertyKeys["ErrorMessage"] = "ErrorMessage";
|
|
123
|
+
/** Case or Conversation. */
|
|
124
|
+
AiRouteRequestPropertyKeys["JourneyEntity"] = "JourneyEntity";
|
|
125
|
+
/** Id of the case or conversation the request was for. Links the row back to the record. */
|
|
126
|
+
AiRouteRequestPropertyKeys["JourneyId"] = "JourneyId";
|
|
127
|
+
/** When the router started the request. The record is written a few hundred milliseconds later. */
|
|
128
|
+
AiRouteRequestPropertyKeys["StartedAt"] = "StartedAt";
|
|
129
|
+
})(AiRouteRequestPropertyKeys = exports.AiRouteRequestPropertyKeys || (exports.AiRouteRequestPropertyKeys = {}));
|
|
130
|
+
/**
|
|
131
|
+
* AiRouteRequest entity from SupportModule
|
|
132
|
+
*
|
|
133
|
+
* One AI request handled by the AI provider router: the feature, the model that answered (Qwen or Databricks), tries, latency and outcome. Written by youfibre-api-support after every routed request; read by the AI traffic dashboard. Not edited by people.
|
|
134
|
+
*
|
|
135
|
+
* @module SupportModule
|
|
136
|
+
* @entity AiRouteRequest
|
|
137
|
+
* @schemaId 6e672d1d-d7c4-401d-8bcc-042b208664d6
|
|
138
|
+
* @recordPrefix AIR
|
|
139
|
+
* @capabilities searchable, updateable, undeletable, triggerable
|
|
140
|
+
*/
|
|
141
|
+
class AiRouteRequest extends core_1.OdinRecord {
|
|
142
|
+
}
|
|
143
|
+
exports.AiRouteRequest = AiRouteRequest;
|
|
144
|
+
// ============================================
|
|
145
|
+
// RABBITMQ EVENT ROUTING KEYS
|
|
146
|
+
// ============================================
|
|
147
|
+
/**
|
|
148
|
+
* RabbitMQ routing keys for AiRouteRequest events
|
|
149
|
+
*/
|
|
150
|
+
exports.ROUTING_KEY_AI_ROUTE_REQUEST_CREATED = 'SupportModule.AiRouteRequest.SubDbRecordCreated';
|
|
151
|
+
exports.ROUTING_KEY_AI_ROUTE_REQUEST_UPDATED = 'SupportModule.AiRouteRequest.SubDbRecordUpdated';
|
|
152
|
+
exports.ROUTING_KEY_AI_ROUTE_REQUEST_DELETED = 'SupportModule.AiRouteRequest.SubDbRecordDeleted';
|
|
153
|
+
/**
|
|
154
|
+
* Type-specific routing keys for AiRouteRequest events
|
|
155
|
+
* Subscribe to these for events on specific entity types only
|
|
156
|
+
*/
|
|
157
|
+
/** This is the default record type created */
|
|
158
|
+
exports.ROUTING_KEY_AI_ROUTE_REQUEST_DEFAULT_CREATED = 'SupportModule.AiRouteRequest.DEFAULT.SubDbRecordCreated';
|
|
159
|
+
/** This is the default record type updated */
|
|
160
|
+
exports.ROUTING_KEY_AI_ROUTE_REQUEST_DEFAULT_UPDATED = 'SupportModule.AiRouteRequest.DEFAULT.SubDbRecordUpdated';
|
|
161
|
+
/** This is the default record type deleted */
|
|
162
|
+
exports.ROUTING_KEY_AI_ROUTE_REQUEST_DEFAULT_DELETED = 'SupportModule.AiRouteRequest.DEFAULT.SubDbRecordDeleted';
|
|
@@ -47,8 +47,6 @@ export declare enum AppointmentPropertyKeys {
|
|
|
47
47
|
Longitude = "Longitude",
|
|
48
48
|
/** email address (Sales - Appointment) */
|
|
49
49
|
EmailAddress = "EmailAddress",
|
|
50
|
-
/** Contact information field for Appointment. Used by Sales team for communication. */
|
|
51
|
-
Address = "Address",
|
|
52
50
|
/** Reference identifier for Appointment relationships. Used for data integrity. */
|
|
53
51
|
AddressId = "AddressId",
|
|
54
52
|
/** Contact information field for Appointment. Used by Sales team for communication. */
|
|
@@ -59,8 +57,6 @@ export declare enum AppointmentPropertyKeys {
|
|
|
59
57
|
ImportId = "ImportId",
|
|
60
58
|
/** Date field for Appointment records. Used by Sales team. */
|
|
61
59
|
Date = "Date",
|
|
62
|
-
/** The title of the appointment (Sales - Appointment) */
|
|
63
|
-
MeetingTitle = "MeetingTitle",
|
|
64
60
|
/** Additional appointment information (Sales - Appointment) */
|
|
65
61
|
Comment = "Comment",
|
|
66
62
|
/** Display name/title for Appointment records. Primary identifier for Sales team. */
|
|
@@ -68,7 +64,11 @@ export declare enum AppointmentPropertyKeys {
|
|
|
68
64
|
/** Display name/title for Appointment records. Primary identifier for Sales team. */
|
|
69
65
|
LastName = "LastName",
|
|
70
66
|
/** Appointment type (Sales - Appointment) */
|
|
71
|
-
Type = "Type"
|
|
67
|
+
Type = "Type",
|
|
68
|
+
/** Contact information field for Appointment. Used by Sales team for communication. */
|
|
69
|
+
Address = "Address",
|
|
70
|
+
/** The title of the appointment (Sales - Appointment) */
|
|
71
|
+
MeetingTitle = "MeetingTitle"
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* Properties for Appointment records
|
|
@@ -88,12 +88,6 @@ export interface AppointmentProperties {
|
|
|
88
88
|
* @pii This field contains personally identifiable information
|
|
89
89
|
*/
|
|
90
90
|
EmailAddress: string;
|
|
91
|
-
/** Contact information field for Appointment. Used by Sales team for communication.
|
|
92
|
-
*
|
|
93
|
-
* @type {TEXT}
|
|
94
|
-
* @hidden This field is hidden in the UI
|
|
95
|
-
*/
|
|
96
|
-
Address: string;
|
|
97
91
|
/** Reference identifier for Appointment relationships. Used for data integrity.
|
|
98
92
|
*
|
|
99
93
|
* @type {LOOKUP}
|
|
@@ -124,11 +118,6 @@ export interface AppointmentProperties {
|
|
|
124
118
|
* @format DD/MM/YYYY HH:mm
|
|
125
119
|
*/
|
|
126
120
|
Date: string;
|
|
127
|
-
/** The title of the appointment (Sales - Appointment)
|
|
128
|
-
*
|
|
129
|
-
* @type {TEXT}
|
|
130
|
-
*/
|
|
131
|
-
MeetingTitle: string;
|
|
132
121
|
/** Additional appointment information (Sales - Appointment)
|
|
133
122
|
*
|
|
134
123
|
* @type {TEXT_LONG}
|
|
@@ -152,6 +141,17 @@ export interface AppointmentProperties {
|
|
|
152
141
|
* @enum {AppointmentType}
|
|
153
142
|
*/
|
|
154
143
|
Type: AppointmentType;
|
|
144
|
+
/** Contact information field for Appointment. Used by Sales team for communication.
|
|
145
|
+
*
|
|
146
|
+
* @type {TEXT}
|
|
147
|
+
* @hidden This field is hidden in the UI
|
|
148
|
+
*/
|
|
149
|
+
Address: string;
|
|
150
|
+
/** The title of the appointment (Sales - Appointment)
|
|
151
|
+
*
|
|
152
|
+
* @type {TEXT}
|
|
153
|
+
*/
|
|
154
|
+
MeetingTitle: string;
|
|
155
155
|
}
|
|
156
156
|
/**
|
|
157
157
|
* Appointment entity from CrmModule
|