@amigo-ai/platform-sdk 0.84.0 → 0.85.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/api.md +11 -0
- package/dist/index.cjs +69 -0
- package/dist/index.cjs.map +3 -3
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +69 -0
- package/dist/index.mjs.map +3 -3
- package/dist/resources/use-cases.js +58 -0
- package/dist/resources/use-cases.js.map +1 -0
- package/dist/types/generated/api.d.ts +216 -0
- package/dist/types/generated/api.d.ts.map +1 -1
- package/dist/types/index.d.cts +5 -0
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/resources/external-integrations.d.ts.map +1 -1
- package/dist/types/resources/intake.d.ts.map +1 -1
- package/dist/types/resources/integrations.d.ts.map +1 -1
- package/dist/types/resources/metrics.d.ts.map +1 -1
- package/dist/types/resources/operators.d.ts.map +1 -1
- package/dist/types/resources/services.d.ts.map +1 -1
- package/dist/types/resources/settings.d.ts.map +1 -1
- package/dist/types/resources/surfaces.d.ts.map +1 -1
- package/dist/types/resources/use-cases.d.ts +33 -0
- package/dist/types/resources/use-cases.d.ts.map +1 -0
- package/dist/types/resources/world.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { WorkspaceScopedResource, extractData } from './base.js';
|
|
2
|
+
/**
|
|
3
|
+
* Channel use cases — voice/email/SMS/iMessage channel setup, workspace
|
|
4
|
+
* ownership, and the service binding that activates a use case for runtime
|
|
5
|
+
* traffic.
|
|
6
|
+
*/
|
|
7
|
+
export class UseCasesResource extends WorkspaceScopedResource {
|
|
8
|
+
/** List use cases in the workspace, optionally filtered by entity/channel/setup. */
|
|
9
|
+
async list(params) {
|
|
10
|
+
return extractData(await this.client.GET('/v1/{workspace_id}/use-cases', {
|
|
11
|
+
params: { path: { workspace_id: this.workspaceId }, query: params },
|
|
12
|
+
}));
|
|
13
|
+
}
|
|
14
|
+
/** List channel-manager use case IDs owned by the current workspace. */
|
|
15
|
+
async listOwned() {
|
|
16
|
+
return extractData(await this.client.GET('/v1/{workspace_id}/use-cases/ownership', {
|
|
17
|
+
params: { path: { workspace_id: this.workspaceId } },
|
|
18
|
+
}));
|
|
19
|
+
}
|
|
20
|
+
/** Return this workspace's ownership record for a use case. Throws NotFoundError if unowned. */
|
|
21
|
+
async getOwnership(useCaseId) {
|
|
22
|
+
return extractData(await this.client.GET('/v1/{workspace_id}/use-cases/{use_case_id}/ownership', {
|
|
23
|
+
params: { path: { workspace_id: this.workspaceId, use_case_id: useCaseId } },
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
/** Claim ownership of a channel-manager use case for this workspace. */
|
|
27
|
+
async assignOwnership(useCaseId) {
|
|
28
|
+
return extractData(await this.client.PUT('/v1/{workspace_id}/use-cases/{use_case_id}/ownership', {
|
|
29
|
+
params: { path: { workspace_id: this.workspaceId, use_case_id: useCaseId } },
|
|
30
|
+
}));
|
|
31
|
+
}
|
|
32
|
+
/** Release this workspace's ownership of a use case after unbinding services. */
|
|
33
|
+
async releaseOwnership(useCaseId) {
|
|
34
|
+
await this.client.DELETE('/v1/{workspace_id}/use-cases/{use_case_id}/ownership', {
|
|
35
|
+
params: { path: { workspace_id: this.workspaceId, use_case_id: useCaseId } },
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/** Return the service currently bound to a use case. Throws NotFoundError if unbound. */
|
|
39
|
+
async getServiceBinding(useCaseId) {
|
|
40
|
+
return extractData(await this.client.GET('/v1/{workspace_id}/use-cases/{use_case_id}/service-binding', {
|
|
41
|
+
params: { path: { workspace_id: this.workspaceId, use_case_id: useCaseId } },
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
/** Bind or rebind a use case to the platform service that should handle its traffic. */
|
|
45
|
+
async bindToService(useCaseId, body) {
|
|
46
|
+
return extractData(await this.client.PUT('/v1/{workspace_id}/use-cases/{use_case_id}/service-binding', {
|
|
47
|
+
params: { path: { workspace_id: this.workspaceId, use_case_id: useCaseId } },
|
|
48
|
+
body,
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
/** Release a use case from its currently bound platform service. */
|
|
52
|
+
async unbindFromService(useCaseId) {
|
|
53
|
+
await this.client.DELETE('/v1/{workspace_id}/use-cases/{use_case_id}/service-binding', {
|
|
54
|
+
params: { path: { workspace_id: this.workspaceId, use_case_id: useCaseId } },
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=use-cases.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-cases.js","sourceRoot":"","sources":["../../src/resources/use-cases.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAYhE;;;;GAIG;AACH,MAAM,OAAO,gBAAiB,SAAQ,uBAAuB;IAC3D,oFAAoF;IACpF,KAAK,CAAC,IAAI,CAAC,MAA2B;QACpC,OAAO,WAAW,CAChB,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,8BAA8B,EAAE;YACpD,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,YAAY,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;SACpE,CAAC,CACH,CAAA;IACH,CAAC;IAED,wEAAwE;IACxE,KAAK,CAAC,SAAS;QACb,OAAO,WAAW,CAChB,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,wCAAwC,EAAE;YAC9D,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,YAAY,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE;SACrD,CAAC,CACH,CAAA;IACH,CAAC;IAED,gGAAgG;IAChG,KAAK,CAAC,YAAY,CAAC,SAAiB;QAClC,OAAO,WAAW,CAChB,MAAM,IAAI,CAAC,MAA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AE,EAAE;YAC5E,IAAI;SACL,CAAC,CACH,CAAA;IACH,CAAC;IAED,oEAAoE;IACpE,KAAK,CAAC,iBAAiB,CAAC,SAAiB;QACvC,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,4DAA4D,EAAE;YACrF,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,YAAY,EAAE,IAAI,CAAC,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE;SAC7E,CAAC,CAAA;IACJ,CAAC;CACF"}
|
|
@@ -6179,6 +6179,31 @@ export interface paths {
|
|
|
6179
6179
|
patch?: never;
|
|
6180
6180
|
trace?: never;
|
|
6181
6181
|
};
|
|
6182
|
+
"/v1/{workspace_id}/simulations/performance": {
|
|
6183
|
+
parameters: {
|
|
6184
|
+
query?: never;
|
|
6185
|
+
header?: never;
|
|
6186
|
+
path?: never;
|
|
6187
|
+
cookie?: never;
|
|
6188
|
+
};
|
|
6189
|
+
/**
|
|
6190
|
+
* Get Simulation Performance
|
|
6191
|
+
* @description Aggregate recent graded (case/suite) runs into the Simulations overview:
|
|
6192
|
+
* overall pass rate, per-metric trend series, and per-case / per-suite rollups
|
|
6193
|
+
* (each with its per-conversation verdicts).
|
|
6194
|
+
*
|
|
6195
|
+
* ``limit`` bounds how many recent runs are read (capped at 50). One request
|
|
6196
|
+
* replaces the console's former one-fetch-per-run fan-out.
|
|
6197
|
+
*/
|
|
6198
|
+
get: operations["get-simulation-performance"];
|
|
6199
|
+
put?: never;
|
|
6200
|
+
post?: never;
|
|
6201
|
+
delete?: never;
|
|
6202
|
+
options?: never;
|
|
6203
|
+
head?: never;
|
|
6204
|
+
patch?: never;
|
|
6205
|
+
trace?: never;
|
|
6206
|
+
};
|
|
6182
6207
|
"/v1/{workspace_id}/simulations/runs": {
|
|
6183
6208
|
parameters: {
|
|
6184
6209
|
query?: never;
|
|
@@ -21624,6 +21649,136 @@ export interface components {
|
|
|
21624
21649
|
*/
|
|
21625
21650
|
signal: string;
|
|
21626
21651
|
};
|
|
21652
|
+
/** SimCaseAssertionResponse */
|
|
21653
|
+
SimCaseAssertionResponse: {
|
|
21654
|
+
/** Eval Key */
|
|
21655
|
+
eval_key: string;
|
|
21656
|
+
/**
|
|
21657
|
+
* Eval Type
|
|
21658
|
+
* @enum {string}
|
|
21659
|
+
*/
|
|
21660
|
+
eval_type: "assertion" | "metric";
|
|
21661
|
+
/**
|
|
21662
|
+
* Failed
|
|
21663
|
+
* @default 0
|
|
21664
|
+
*/
|
|
21665
|
+
failed?: number;
|
|
21666
|
+
/** Pass Rate */
|
|
21667
|
+
pass_rate?: number | null;
|
|
21668
|
+
/**
|
|
21669
|
+
* Passed
|
|
21670
|
+
* @default 0
|
|
21671
|
+
*/
|
|
21672
|
+
passed?: number;
|
|
21673
|
+
/**
|
|
21674
|
+
* Pending
|
|
21675
|
+
* @default 0
|
|
21676
|
+
*/
|
|
21677
|
+
pending?: number;
|
|
21678
|
+
/** Results */
|
|
21679
|
+
results?: components["schemas"]["SimulationEvalResultResponse"][];
|
|
21680
|
+
};
|
|
21681
|
+
/** SimCasePerfResponse */
|
|
21682
|
+
SimCasePerfResponse: {
|
|
21683
|
+
/** Assertions */
|
|
21684
|
+
assertions?: components["schemas"]["SimCaseAssertionResponse"][];
|
|
21685
|
+
/** Case Id */
|
|
21686
|
+
case_id?: string | null;
|
|
21687
|
+
/** Case Name */
|
|
21688
|
+
case_name: string;
|
|
21689
|
+
/** Latest Run At */
|
|
21690
|
+
latest_run_at?: string | null;
|
|
21691
|
+
/**
|
|
21692
|
+
* Latest Run Id
|
|
21693
|
+
* Format: uuid
|
|
21694
|
+
*/
|
|
21695
|
+
latest_run_id: string;
|
|
21696
|
+
/**
|
|
21697
|
+
* Measured
|
|
21698
|
+
* @default 0
|
|
21699
|
+
*/
|
|
21700
|
+
measured?: number;
|
|
21701
|
+
/** Pass Rate */
|
|
21702
|
+
pass_rate?: number | null;
|
|
21703
|
+
/**
|
|
21704
|
+
* Passed
|
|
21705
|
+
* @default 0
|
|
21706
|
+
*/
|
|
21707
|
+
passed?: number;
|
|
21708
|
+
};
|
|
21709
|
+
/** SimMetricPerfResponse */
|
|
21710
|
+
SimMetricPerfResponse: {
|
|
21711
|
+
/** Label */
|
|
21712
|
+
label: string;
|
|
21713
|
+
/** Metric Key */
|
|
21714
|
+
metric_key: string;
|
|
21715
|
+
/** Per Run */
|
|
21716
|
+
per_run?: components["schemas"]["SimMetricRunPointResponse"][];
|
|
21717
|
+
};
|
|
21718
|
+
/**
|
|
21719
|
+
* SimMetricRunPointResponse
|
|
21720
|
+
* @description One run's contribution to a metric: the mean value that run (null for
|
|
21721
|
+
* non-numeric metrics) plus how many conversations passed / were measured.
|
|
21722
|
+
*/
|
|
21723
|
+
SimMetricRunPointResponse: {
|
|
21724
|
+
/** At */
|
|
21725
|
+
at?: string | null;
|
|
21726
|
+
/**
|
|
21727
|
+
* Measured
|
|
21728
|
+
* @default 0
|
|
21729
|
+
*/
|
|
21730
|
+
measured?: number;
|
|
21731
|
+
/**
|
|
21732
|
+
* Passed
|
|
21733
|
+
* @default 0
|
|
21734
|
+
*/
|
|
21735
|
+
passed?: number;
|
|
21736
|
+
/** Value */
|
|
21737
|
+
value?: number | null;
|
|
21738
|
+
};
|
|
21739
|
+
/** SimPerformanceOverviewResponse */
|
|
21740
|
+
SimPerformanceOverviewResponse: {
|
|
21741
|
+
/**
|
|
21742
|
+
* Evals Run
|
|
21743
|
+
* @default 0
|
|
21744
|
+
*/
|
|
21745
|
+
evals_run?: number;
|
|
21746
|
+
/**
|
|
21747
|
+
* Needs Attention Count
|
|
21748
|
+
* @default 0
|
|
21749
|
+
*/
|
|
21750
|
+
needs_attention_count?: number;
|
|
21751
|
+
/** Overall Pass Rate */
|
|
21752
|
+
overall_pass_rate?: number | null;
|
|
21753
|
+
/**
|
|
21754
|
+
* Runs Analyzed
|
|
21755
|
+
* @default 0
|
|
21756
|
+
*/
|
|
21757
|
+
runs_analyzed?: number;
|
|
21758
|
+
};
|
|
21759
|
+
/** SimSuitePerfResponse */
|
|
21760
|
+
SimSuitePerfResponse: {
|
|
21761
|
+
/** Cases */
|
|
21762
|
+
cases?: components["schemas"]["SimCasePerfResponse"][];
|
|
21763
|
+
/** Latest Run At */
|
|
21764
|
+
latest_run_at?: string | null;
|
|
21765
|
+
/**
|
|
21766
|
+
* Measured
|
|
21767
|
+
* @default 0
|
|
21768
|
+
*/
|
|
21769
|
+
measured?: number;
|
|
21770
|
+
/** Pass Rate */
|
|
21771
|
+
pass_rate?: number | null;
|
|
21772
|
+
/**
|
|
21773
|
+
* Passed
|
|
21774
|
+
* @default 0
|
|
21775
|
+
*/
|
|
21776
|
+
passed?: number;
|
|
21777
|
+
/** Suite Id */
|
|
21778
|
+
suite_id?: string | null;
|
|
21779
|
+
/** Suite Name */
|
|
21780
|
+
suite_name: string;
|
|
21781
|
+
};
|
|
21627
21782
|
/** SimulationBenchmarkAggregateSummary */
|
|
21628
21783
|
SimulationBenchmarkAggregateSummary: {
|
|
21629
21784
|
/** Average Score */
|
|
@@ -22089,6 +22244,20 @@ export interface components {
|
|
|
22089
22244
|
*/
|
|
22090
22245
|
tools_called?: string[];
|
|
22091
22246
|
};
|
|
22247
|
+
/**
|
|
22248
|
+
* SimulationPerformanceResponse
|
|
22249
|
+
* @description Aggregated Simulations overview: one request in place of the console's
|
|
22250
|
+
* former one-detail-fetch-per-run fan-out.
|
|
22251
|
+
*/
|
|
22252
|
+
SimulationPerformanceResponse: {
|
|
22253
|
+
/** By Case */
|
|
22254
|
+
by_case?: components["schemas"]["SimCasePerfResponse"][];
|
|
22255
|
+
/** By Suite */
|
|
22256
|
+
by_suite?: components["schemas"]["SimSuitePerfResponse"][];
|
|
22257
|
+
/** Metrics */
|
|
22258
|
+
metrics?: components["schemas"]["SimMetricPerfResponse"][];
|
|
22259
|
+
overview: components["schemas"]["SimPerformanceOverviewResponse"];
|
|
22260
|
+
};
|
|
22092
22261
|
/**
|
|
22093
22262
|
* SimulationRunResponse
|
|
22094
22263
|
* @description Full run payload — used by GET /runs/{run_id} for replay flows.
|
|
@@ -26036,6 +26205,18 @@ export interface components {
|
|
|
26036
26205
|
};
|
|
26037
26206
|
/** Usage */
|
|
26038
26207
|
Usage: {
|
|
26208
|
+
/**
|
|
26209
|
+
* Cache Creation Tokens
|
|
26210
|
+
* @description Cache-WRITE input tokens (Anthropic cache_creation_input_tokens; 0 on providers without it).
|
|
26211
|
+
* @default 0
|
|
26212
|
+
*/
|
|
26213
|
+
cache_creation_tokens?: number;
|
|
26214
|
+
/**
|
|
26215
|
+
* Cached Tokens
|
|
26216
|
+
* @description Cache-READ input tokens (billed at the provider's cache-hit rate).
|
|
26217
|
+
* @default 0
|
|
26218
|
+
*/
|
|
26219
|
+
cached_tokens?: number;
|
|
26039
26220
|
/**
|
|
26040
26221
|
* Input Tokens
|
|
26041
26222
|
* @default 0
|
|
@@ -35989,6 +36170,7 @@ export interface operations {
|
|
|
35989
36170
|
sort_by?: string;
|
|
35990
36171
|
status?: components["schemas"]["_FileStatus"] | null;
|
|
35991
36172
|
search?: string | null;
|
|
36173
|
+
include_withdrawn?: boolean;
|
|
35992
36174
|
};
|
|
35993
36175
|
header?: never;
|
|
35994
36176
|
path: {
|
|
@@ -42727,6 +42909,40 @@ export interface operations {
|
|
|
42727
42909
|
};
|
|
42728
42910
|
};
|
|
42729
42911
|
};
|
|
42912
|
+
"get-simulation-performance": {
|
|
42913
|
+
parameters: {
|
|
42914
|
+
query?: {
|
|
42915
|
+
service_id?: string | null;
|
|
42916
|
+
limit?: number;
|
|
42917
|
+
};
|
|
42918
|
+
header?: never;
|
|
42919
|
+
path: {
|
|
42920
|
+
workspace_id: string;
|
|
42921
|
+
};
|
|
42922
|
+
cookie?: never;
|
|
42923
|
+
};
|
|
42924
|
+
requestBody?: never;
|
|
42925
|
+
responses: {
|
|
42926
|
+
/** @description Successful Response */
|
|
42927
|
+
200: {
|
|
42928
|
+
headers: {
|
|
42929
|
+
[name: string]: unknown;
|
|
42930
|
+
};
|
|
42931
|
+
content: {
|
|
42932
|
+
"application/json": components["schemas"]["SimulationPerformanceResponse"];
|
|
42933
|
+
};
|
|
42934
|
+
};
|
|
42935
|
+
/** @description Validation Error */
|
|
42936
|
+
422: {
|
|
42937
|
+
headers: {
|
|
42938
|
+
[name: string]: unknown;
|
|
42939
|
+
};
|
|
42940
|
+
content: {
|
|
42941
|
+
"application/json": components["schemas"]["HTTPValidationError"];
|
|
42942
|
+
};
|
|
42943
|
+
};
|
|
42944
|
+
};
|
|
42945
|
+
};
|
|
42730
42946
|
"list-simulation-runs": {
|
|
42731
42947
|
parameters: {
|
|
42732
42948
|
query?: {
|