@applica-software-guru/persona-sdk 0.1.102 → 0.1.104
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/dist/bundle.cjs.js +1 -1
- package/dist/bundle.cjs.js.map +1 -1
- package/dist/bundle.es.js +60 -25
- package/dist/bundle.es.js.map +1 -1
- package/dist/index.d.ts +86 -53
- package/package.json +1 -1
- package/src/agents/types.ts +12 -28
- package/src/index.ts +5 -5
- package/src/markup-rules/markup-rules-api.ts +38 -0
- package/src/markup-rules/types.ts +5 -0
- package/src/persona-sdk.ts +12 -5
- package/src/providers/providers-api.ts +55 -0
- package/src/providers/types.ts +23 -0
- package/src/service-prices/types.ts +0 -1
- package/src/sessions/types.ts +2 -0
- package/src/values/values-api.ts +0 -4
- package/src/known-models/known-models-api.ts +0 -33
- package/src/known-models/types.ts +0 -7
package/dist/index.d.ts
CHANGED
|
@@ -29,8 +29,7 @@ export declare interface Agent {
|
|
|
29
29
|
network?: NetworkConfiguration;
|
|
30
30
|
features?: Feature[];
|
|
31
31
|
toolkit?: ToolkitConfiguration;
|
|
32
|
-
|
|
33
|
-
contextManagement?: ContextManagementConfiguration;
|
|
32
|
+
compaction?: CompactionConfiguration;
|
|
34
33
|
attachmentsPreprocessor?: AttachmentsPreprocessorConfiguration;
|
|
35
34
|
responseSchema?: Record<string, unknown>;
|
|
36
35
|
verboseErrors?: boolean;
|
|
@@ -64,8 +63,7 @@ export declare interface AgentCreateRequest {
|
|
|
64
63
|
network?: NetworkConfiguration;
|
|
65
64
|
features?: Feature[];
|
|
66
65
|
toolkit?: ToolkitConfiguration;
|
|
67
|
-
|
|
68
|
-
contextManagement?: ContextManagementConfiguration;
|
|
66
|
+
compaction?: CompactionConfiguration;
|
|
69
67
|
attachmentsPreprocessor?: AttachmentsPreprocessorConfiguration;
|
|
70
68
|
responseSchema?: Record<string, unknown>;
|
|
71
69
|
verboseErrors?: boolean;
|
|
@@ -260,6 +258,17 @@ export declare interface CommittedUsage {
|
|
|
260
258
|
details?: UsageCost[];
|
|
261
259
|
}
|
|
262
260
|
|
|
261
|
+
export declare interface CompactionConfiguration {
|
|
262
|
+
/** Enable automatic context compaction. Default: true. */
|
|
263
|
+
enabled?: boolean;
|
|
264
|
+
/** Headroom kept free below the context window. Default: 16384. */
|
|
265
|
+
reserveTokens?: number;
|
|
266
|
+
/** Token budget of recent conversation never summarized. Default: 20000. */
|
|
267
|
+
keepRecentTokens?: number;
|
|
268
|
+
/** Model used to generate the summary. Defaults to the agent's main model. */
|
|
269
|
+
model?: ModelConfiguration;
|
|
270
|
+
}
|
|
271
|
+
|
|
263
272
|
export declare interface Connection {
|
|
264
273
|
id?: string;
|
|
265
274
|
sourceId?: string;
|
|
@@ -282,20 +291,6 @@ export declare interface ContentValue {
|
|
|
282
291
|
content?: ContentItem[];
|
|
283
292
|
}
|
|
284
293
|
|
|
285
|
-
export declare interface ContextManagementConfiguration {
|
|
286
|
-
enabled?: boolean;
|
|
287
|
-
maxContextTokens?: number;
|
|
288
|
-
summarizationThreshold?: number;
|
|
289
|
-
keepLastNIterations?: number;
|
|
290
|
-
keepFirstMessage?: boolean;
|
|
291
|
-
maxToolCallsBeforeCompaction?: number;
|
|
292
|
-
useLlmCompaction?: boolean;
|
|
293
|
-
maxSummaryWords?: number;
|
|
294
|
-
truncationEnabled?: boolean;
|
|
295
|
-
maxObservationTokens?: number;
|
|
296
|
-
compactionModel?: ModelConfiguration;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
294
|
export declare interface CreateCustomerRequest {
|
|
300
295
|
owner?: string;
|
|
301
296
|
name?: string;
|
|
@@ -656,23 +651,6 @@ export declare interface KnowledgeConfiguration {
|
|
|
656
651
|
|
|
657
652
|
export declare type KnowledgeType = 'multi_hop' | 'simple';
|
|
658
653
|
|
|
659
|
-
export declare interface KnownModel {
|
|
660
|
-
id?: string;
|
|
661
|
-
provider?: string;
|
|
662
|
-
modelName?: string;
|
|
663
|
-
label?: string;
|
|
664
|
-
deprecated?: boolean;
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
export declare class KnownModelsApi extends HttpApi {
|
|
668
|
-
constructor(baseUrl: string, auth: string | AuthenticationProvider);
|
|
669
|
-
list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<KnownModel>>;
|
|
670
|
-
get(id: string): Promise<KnownModel>;
|
|
671
|
-
create(knownModel: KnownModel): Promise<KnownModel>;
|
|
672
|
-
update(id: string, knownModel: KnownModel): Promise<KnownModel>;
|
|
673
|
-
remove(id: string): Promise<void>;
|
|
674
|
-
}
|
|
675
|
-
|
|
676
654
|
export declare type LanguageCode = 'en-US' | 'it-IT' | 'es-ES' | 'fr-FR' | 'de-DE' | 'pt-BR';
|
|
677
655
|
|
|
678
656
|
export declare interface LineItem {
|
|
@@ -684,6 +662,26 @@ export declare interface LineItem {
|
|
|
684
662
|
periodEnd?: string;
|
|
685
663
|
}
|
|
686
664
|
|
|
665
|
+
export declare interface MarkupRule {
|
|
666
|
+
id?: string;
|
|
667
|
+
pattern?: string;
|
|
668
|
+
percentage?: number;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
/**
|
|
672
|
+
* Global markup rules (super admin only). Markup no longer lives on the
|
|
673
|
+
* ServicePrice: there is a single platform-wide list of {pattern, percentage}
|
|
674
|
+
* rules matched against usage service codes (most-specific-wins, "*" fallback).
|
|
675
|
+
*/
|
|
676
|
+
export declare class MarkupRulesApi extends HttpApi {
|
|
677
|
+
constructor(baseUrl: string, auth: string | AuthenticationProvider);
|
|
678
|
+
list(keyword?: string | null, page?: number, size?: number): Promise<Paginated<MarkupRule>>;
|
|
679
|
+
get(id: string): Promise<MarkupRule>;
|
|
680
|
+
create(markupRule: MarkupRule): Promise<MarkupRule>;
|
|
681
|
+
update(id: string, markupRule: MarkupRule): Promise<MarkupRule>;
|
|
682
|
+
remove(id: string): Promise<void>;
|
|
683
|
+
}
|
|
684
|
+
|
|
687
685
|
export declare interface McpServerConfiguration {
|
|
688
686
|
type?: string;
|
|
689
687
|
name?: string;
|
|
@@ -717,6 +715,8 @@ export declare interface Message {
|
|
|
717
715
|
task?: Record<string, unknown>;
|
|
718
716
|
sender?: string;
|
|
719
717
|
thought?: boolean;
|
|
718
|
+
/** True when this message is a context-compaction summary (injected by compaction). */
|
|
719
|
+
isCompactionSummary?: boolean;
|
|
720
720
|
}
|
|
721
721
|
|
|
722
722
|
export declare interface Mission {
|
|
@@ -760,6 +760,8 @@ export declare interface ModelConfiguration {
|
|
|
760
760
|
reasoningEffort?: ReasoningEffort;
|
|
761
761
|
/** Maximum number of output tokens to generate. Undefined = provider default. */
|
|
762
762
|
maxOutputTokens?: number;
|
|
763
|
+
/** Total context window (input) of the model, in tokens. Used by compaction. Undefined = default (128000). */
|
|
764
|
+
contextWindow?: number;
|
|
763
765
|
/** Override the per-provider default API key (env var) when set. */
|
|
764
766
|
apiKey?: string;
|
|
765
767
|
/** Override the per-provider default base URL when set. */
|
|
@@ -886,8 +888,10 @@ export declare class PersonaSdk {
|
|
|
886
888
|
triggers(authProvider: AuthenticationProvider): TriggersApi;
|
|
887
889
|
servicePrices(apiKey: string): ServicePricesApi;
|
|
888
890
|
servicePrices(authProvider: AuthenticationProvider): ServicePricesApi;
|
|
889
|
-
|
|
890
|
-
|
|
891
|
+
markupRules(apiKey: string): MarkupRulesApi;
|
|
892
|
+
markupRules(authProvider: AuthenticationProvider): MarkupRulesApi;
|
|
893
|
+
providers(apiKey: string): ProvidersApi;
|
|
894
|
+
providers(authProvider: AuthenticationProvider): ProvidersApi;
|
|
891
895
|
sessions(apiKey: string): SessionsApi;
|
|
892
896
|
sessions(authProvider: AuthenticationProvider): SessionsApi;
|
|
893
897
|
missions(apiKey: string): MissionsApi;
|
|
@@ -961,6 +965,51 @@ export declare interface ProjectUpdateRequest {
|
|
|
961
965
|
tag?: string;
|
|
962
966
|
}
|
|
963
967
|
|
|
968
|
+
export declare interface Provider {
|
|
969
|
+
id?: string;
|
|
970
|
+
/** litellm provider name, e.g. "openai", "anthropic", "vertex_ai". */
|
|
971
|
+
name?: string;
|
|
972
|
+
/** null/undefined => global; set => per-project override. */
|
|
973
|
+
projectId?: string | null;
|
|
974
|
+
/** Write-only; returned masked ("********") on reads. */
|
|
975
|
+
apiKey?: string;
|
|
976
|
+
baseUrl?: string;
|
|
977
|
+
/** Provider-specific extras (e.g. vertexProject, vertexLocation, vertexCredentials). */
|
|
978
|
+
config?: Record<string, unknown>;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
/** A model suggestion for a provider, with litellm capability flags. */
|
|
982
|
+
export declare interface ProviderModel {
|
|
983
|
+
id: string;
|
|
984
|
+
contextWindow?: number;
|
|
985
|
+
supportsVision?: boolean;
|
|
986
|
+
supportsFunctionCalling?: boolean;
|
|
987
|
+
supportsAudioInput?: boolean;
|
|
988
|
+
supportsPdfInput?: boolean;
|
|
989
|
+
supportsReasoning?: boolean;
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
/**
|
|
993
|
+
* Managed LLM providers (super admin only). Providers bind a litellm provider
|
|
994
|
+
* name to its credentials; global or per-project (override). API keys are stored
|
|
995
|
+
* encrypted and returned masked.
|
|
996
|
+
*/
|
|
997
|
+
export declare class ProvidersApi extends HttpApi {
|
|
998
|
+
constructor(baseUrl: string, auth: string | AuthenticationProvider);
|
|
999
|
+
list(projectId?: string | null, keyword?: string | null, page?: number, size?: number): Promise<Paginated<Provider>>;
|
|
1000
|
+
get(id: string): Promise<Provider>;
|
|
1001
|
+
create(provider: Provider): Promise<Provider>;
|
|
1002
|
+
update(id: string, provider: Provider): Promise<Provider>;
|
|
1003
|
+
remove(id: string): Promise<void>;
|
|
1004
|
+
/** Provider names litellm supports (for the "add provider" picker). Admin. */
|
|
1005
|
+
available(): Promise<string[]>;
|
|
1006
|
+
/** Names of providers configured for the caller (global + their project), no
|
|
1007
|
+
* credentials. Authenticated (not admin) — for the model selector. */
|
|
1008
|
+
names(): Promise<string[]>;
|
|
1009
|
+
/** Model suggestions (chat, with capabilities) for a provider, from litellm. */
|
|
1010
|
+
models(provider: string): Promise<ProviderModel[]>;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
964
1013
|
export declare type ReasoningEffort = 'minimal' | 'low' | 'medium' | 'high';
|
|
965
1014
|
|
|
966
1015
|
export declare interface Ref {
|
|
@@ -1004,7 +1053,6 @@ export declare interface ServicePrice {
|
|
|
1004
1053
|
service?: string;
|
|
1005
1054
|
cost?: number;
|
|
1006
1055
|
unit?: string;
|
|
1007
|
-
markupPercentage?: number;
|
|
1008
1056
|
fixedPrice?: number;
|
|
1009
1057
|
}
|
|
1010
1058
|
|
|
@@ -1134,20 +1182,6 @@ export declare interface Step {
|
|
|
1134
1182
|
output?: Record<string, unknown>;
|
|
1135
1183
|
}
|
|
1136
1184
|
|
|
1137
|
-
export declare interface StmConfiguration {
|
|
1138
|
-
type?: StmType;
|
|
1139
|
-
maxMessages?: number;
|
|
1140
|
-
includeToolCalls?: boolean;
|
|
1141
|
-
model?: ModelConfiguration;
|
|
1142
|
-
maxNumberOfWords?: number;
|
|
1143
|
-
keepLastNObservations?: number;
|
|
1144
|
-
maskingThreshold?: number;
|
|
1145
|
-
summaryThreshold?: number;
|
|
1146
|
-
maxContextTokens?: number;
|
|
1147
|
-
}
|
|
1148
|
-
|
|
1149
|
-
export declare type StmType = 'simple' | 'summary' | 'compact';
|
|
1150
|
-
|
|
1151
1185
|
export declare interface Subscription {
|
|
1152
1186
|
id?: string;
|
|
1153
1187
|
projectId?: string;
|
|
@@ -1390,7 +1424,6 @@ export declare class ValuesApi extends HttpApi {
|
|
|
1390
1424
|
getTranscriberNames(): Promise<string[]>;
|
|
1391
1425
|
getSynthesizerNames(): Promise<string[]>;
|
|
1392
1426
|
getSynthesizerVoices(synthesizerName: string): Promise<string[]>;
|
|
1393
|
-
getStmTypes(): Promise<string[]>;
|
|
1394
1427
|
getDocumentExtractors(): Promise<string[]>;
|
|
1395
1428
|
getEmbeddingModels(): Promise<string[]>;
|
|
1396
1429
|
getQualityOptions(): Promise<string[]>;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@applica-software-guru/persona-sdk",
|
|
3
3
|
"description": "Official TypeScript SDK for the Persona API — manage agents, sessions, projects, knowledge bases, workflows, triggers and more.",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.104",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"dev": "vite",
|
package/src/agents/types.ts
CHANGED
|
@@ -9,7 +9,6 @@ export type SynthesizerName = 'gcloud' | 'elevenlabs' | 'gtts' | 'openai';
|
|
|
9
9
|
|
|
10
10
|
export type TranscriberName = 'gcloud' | 'deepgram' | 'vosk';
|
|
11
11
|
|
|
12
|
-
export type StmType = 'simple' | 'summary' | 'compact';
|
|
13
12
|
|
|
14
13
|
export type ToolType = 'remote' | 'local';
|
|
15
14
|
|
|
@@ -43,6 +42,8 @@ export interface ModelConfiguration {
|
|
|
43
42
|
reasoningEffort?: ReasoningEffort;
|
|
44
43
|
/** Maximum number of output tokens to generate. Undefined = provider default. */
|
|
45
44
|
maxOutputTokens?: number;
|
|
45
|
+
/** Total context window (input) of the model, in tokens. Used by compaction. Undefined = default (128000). */
|
|
46
|
+
contextWindow?: number;
|
|
46
47
|
/** Override the per-provider default API key (env var) when set. */
|
|
47
48
|
apiKey?: string;
|
|
48
49
|
/** Override the per-provider default base URL when set. */
|
|
@@ -245,30 +246,15 @@ export interface ToolkitConfiguration {
|
|
|
245
246
|
tools?: Tool[];
|
|
246
247
|
}
|
|
247
248
|
|
|
248
|
-
export interface
|
|
249
|
-
|
|
250
|
-
maxMessages?: number;
|
|
251
|
-
includeToolCalls?: boolean;
|
|
252
|
-
model?: ModelConfiguration;
|
|
253
|
-
maxNumberOfWords?: number;
|
|
254
|
-
keepLastNObservations?: number;
|
|
255
|
-
maskingThreshold?: number;
|
|
256
|
-
summaryThreshold?: number;
|
|
257
|
-
maxContextTokens?: number;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
export interface ContextManagementConfiguration {
|
|
249
|
+
export interface CompactionConfiguration {
|
|
250
|
+
/** Enable automatic context compaction. Default: true. */
|
|
261
251
|
enabled?: boolean;
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
maxSummaryWords?: number;
|
|
269
|
-
truncationEnabled?: boolean;
|
|
270
|
-
maxObservationTokens?: number;
|
|
271
|
-
compactionModel?: ModelConfiguration;
|
|
252
|
+
/** Headroom kept free below the context window. Default: 16384. */
|
|
253
|
+
reserveTokens?: number;
|
|
254
|
+
/** Token budget of recent conversation never summarized. Default: 20000. */
|
|
255
|
+
keepRecentTokens?: number;
|
|
256
|
+
/** Model used to generate the summary. Defaults to the agent's main model. */
|
|
257
|
+
model?: ModelConfiguration;
|
|
272
258
|
}
|
|
273
259
|
|
|
274
260
|
export interface Revision {
|
|
@@ -307,8 +293,7 @@ export interface Agent {
|
|
|
307
293
|
network?: NetworkConfiguration;
|
|
308
294
|
features?: Feature[];
|
|
309
295
|
toolkit?: ToolkitConfiguration;
|
|
310
|
-
|
|
311
|
-
contextManagement?: ContextManagementConfiguration;
|
|
296
|
+
compaction?: CompactionConfiguration;
|
|
312
297
|
attachmentsPreprocessor?: AttachmentsPreprocessorConfiguration;
|
|
313
298
|
responseSchema?: Record<string, unknown>;
|
|
314
299
|
verboseErrors?: boolean;
|
|
@@ -339,8 +324,7 @@ export interface AgentCreateRequest {
|
|
|
339
324
|
network?: NetworkConfiguration;
|
|
340
325
|
features?: Feature[];
|
|
341
326
|
toolkit?: ToolkitConfiguration;
|
|
342
|
-
|
|
343
|
-
contextManagement?: ContextManagementConfiguration;
|
|
327
|
+
compaction?: CompactionConfiguration;
|
|
344
328
|
attachmentsPreprocessor?: AttachmentsPreprocessorConfiguration;
|
|
345
329
|
responseSchema?: Record<string, unknown>;
|
|
346
330
|
verboseErrors?: boolean;
|
package/src/index.ts
CHANGED
|
@@ -47,14 +47,12 @@ export type {
|
|
|
47
47
|
ToolRemoteConfig,
|
|
48
48
|
ToolDefinition,
|
|
49
49
|
ToolkitConfiguration,
|
|
50
|
-
|
|
51
|
-
StmType,
|
|
50
|
+
CompactionConfiguration,
|
|
52
51
|
Revision,
|
|
53
52
|
AgentType,
|
|
54
53
|
ReasoningEffort,
|
|
55
54
|
ModelProvider,
|
|
56
55
|
CollaborationMode,
|
|
57
|
-
ContextManagementConfiguration,
|
|
58
56
|
AttachmentsPreprocessorConfiguration,
|
|
59
57
|
AttachmentsPreprocessorImageHandling,
|
|
60
58
|
} from './agents/types';
|
|
@@ -154,8 +152,10 @@ export { MissionsApi } from './missions/missions-api';
|
|
|
154
152
|
export type { Mission, MissionStatus } from './missions/types';
|
|
155
153
|
export { ServicePricesApi } from './service-prices/service-prices-api';
|
|
156
154
|
export type { ServicePrice } from './service-prices/types';
|
|
157
|
-
export {
|
|
158
|
-
export type {
|
|
155
|
+
export { MarkupRulesApi } from './markup-rules/markup-rules-api';
|
|
156
|
+
export type { MarkupRule } from './markup-rules/types';
|
|
157
|
+
export { ProvidersApi } from './providers/providers-api';
|
|
158
|
+
export type { Provider, ProviderModel } from './providers/types';
|
|
159
159
|
export type { Revision as RevisionType } from './revisions/types';
|
|
160
160
|
export { BillingClient } from './billing/billing-client';
|
|
161
161
|
export { ValuesApi } from './values/values-api';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { HttpApi } from '../http-api';
|
|
2
|
+
import { Paginated } from '../paginated';
|
|
3
|
+
import { AuthenticationProvider } from '../auth/authentication-provider';
|
|
4
|
+
import { MarkupRule } from './types';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Global markup rules (super admin only). Markup no longer lives on the
|
|
8
|
+
* ServicePrice: there is a single platform-wide list of {pattern, percentage}
|
|
9
|
+
* rules matched against usage service codes (most-specific-wins, "*" fallback).
|
|
10
|
+
*/
|
|
11
|
+
export class MarkupRulesApi extends HttpApi {
|
|
12
|
+
constructor(baseUrl: string, auth: string | AuthenticationProvider) {
|
|
13
|
+
super(baseUrl, auth);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
async list(keyword?: string | null, page?: number, size?: number): Promise<Paginated<MarkupRule>> {
|
|
17
|
+
const { page: p, size: s } = this.normalizePageParams(page, size);
|
|
18
|
+
const params: Record<string, unknown> = { page: p, size: s };
|
|
19
|
+
if (keyword) params.keyword = keyword;
|
|
20
|
+
return this.httpGet<Paginated<MarkupRule>>('/markup-rules', params);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async get(id: string): Promise<MarkupRule> {
|
|
24
|
+
return this.httpGet<MarkupRule>('/markup-rules/' + id);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async create(markupRule: MarkupRule): Promise<MarkupRule> {
|
|
28
|
+
return this.httpPost<MarkupRule>('/markup-rules', markupRule);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async update(id: string, markupRule: MarkupRule): Promise<MarkupRule> {
|
|
32
|
+
return this.httpPut<MarkupRule>('/markup-rules/' + id, markupRule);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async remove(id: string): Promise<void> {
|
|
36
|
+
await this.httpDelete('/markup-rules/' + id);
|
|
37
|
+
}
|
|
38
|
+
}
|
package/src/persona-sdk.ts
CHANGED
|
@@ -7,7 +7,8 @@ import { CredentialsApi } from './credentials/credentials-api';
|
|
|
7
7
|
import { FeaturesApi } from './features/features-api';
|
|
8
8
|
import { TriggersApi } from './triggers/triggers-api';
|
|
9
9
|
import { ServicePricesApi } from './service-prices/service-prices-api';
|
|
10
|
-
import {
|
|
10
|
+
import { MarkupRulesApi } from './markup-rules/markup-rules-api';
|
|
11
|
+
import { ProvidersApi } from './providers/providers-api';
|
|
11
12
|
import { SessionsApi } from './sessions/sessions-api';
|
|
12
13
|
import { MissionsApi } from './missions/missions-api';
|
|
13
14
|
import { BillingClient } from './billing/billing-client';
|
|
@@ -72,10 +73,16 @@ export class PersonaSdk {
|
|
|
72
73
|
return new ServicePricesApi(this.baseUrl, auth);
|
|
73
74
|
}
|
|
74
75
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
return new
|
|
76
|
+
markupRules(apiKey: string): MarkupRulesApi;
|
|
77
|
+
markupRules(authProvider: AuthenticationProvider): MarkupRulesApi;
|
|
78
|
+
markupRules(auth: string | AuthenticationProvider): MarkupRulesApi {
|
|
79
|
+
return new MarkupRulesApi(this.baseUrl, auth);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
providers(apiKey: string): ProvidersApi;
|
|
83
|
+
providers(authProvider: AuthenticationProvider): ProvidersApi;
|
|
84
|
+
providers(auth: string | AuthenticationProvider): ProvidersApi {
|
|
85
|
+
return new ProvidersApi(this.baseUrl, auth);
|
|
79
86
|
}
|
|
80
87
|
|
|
81
88
|
sessions(apiKey: string): SessionsApi;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { HttpApi } from '../http-api';
|
|
2
|
+
import { Paginated } from '../paginated';
|
|
3
|
+
import { AuthenticationProvider } from '../auth/authentication-provider';
|
|
4
|
+
import { Provider, ProviderModel } from './types';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Managed LLM providers (super admin only). Providers bind a litellm provider
|
|
8
|
+
* name to its credentials; global or per-project (override). API keys are stored
|
|
9
|
+
* encrypted and returned masked.
|
|
10
|
+
*/
|
|
11
|
+
export class ProvidersApi extends HttpApi {
|
|
12
|
+
constructor(baseUrl: string, auth: string | AuthenticationProvider) {
|
|
13
|
+
super(baseUrl, auth);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
async list(projectId?: string | null, keyword?: string | null, page?: number, size?: number): Promise<Paginated<Provider>> {
|
|
17
|
+
const { page: p, size: s } = this.normalizePageParams(page, size);
|
|
18
|
+
const params: Record<string, unknown> = { page: p, size: s };
|
|
19
|
+
if (projectId) params.projectId = projectId;
|
|
20
|
+
if (keyword) params.keyword = keyword;
|
|
21
|
+
return this.httpGet<Paginated<Provider>>('/providers', params);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async get(id: string): Promise<Provider> {
|
|
25
|
+
return this.httpGet<Provider>('/providers/' + id);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async create(provider: Provider): Promise<Provider> {
|
|
29
|
+
return this.httpPost<Provider>('/providers', provider);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async update(id: string, provider: Provider): Promise<Provider> {
|
|
33
|
+
return this.httpPut<Provider>('/providers/' + id, provider);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
async remove(id: string): Promise<void> {
|
|
37
|
+
await this.httpDelete('/providers/' + id);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Provider names litellm supports (for the "add provider" picker). Admin. */
|
|
41
|
+
async available(): Promise<string[]> {
|
|
42
|
+
return this.httpGet<string[]>('/providers/available');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Names of providers configured for the caller (global + their project), no
|
|
46
|
+
* credentials. Authenticated (not admin) — for the model selector. */
|
|
47
|
+
async names(): Promise<string[]> {
|
|
48
|
+
return this.httpGet<string[]>('/provider-names');
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Model suggestions (chat, with capabilities) for a provider, from litellm. */
|
|
52
|
+
async models(provider: string): Promise<ProviderModel[]> {
|
|
53
|
+
return this.httpGet<ProviderModel[]>('/provider-models', { provider });
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface Provider {
|
|
2
|
+
id?: string;
|
|
3
|
+
/** litellm provider name, e.g. "openai", "anthropic", "vertex_ai". */
|
|
4
|
+
name?: string;
|
|
5
|
+
/** null/undefined => global; set => per-project override. */
|
|
6
|
+
projectId?: string | null;
|
|
7
|
+
/** Write-only; returned masked ("********") on reads. */
|
|
8
|
+
apiKey?: string;
|
|
9
|
+
baseUrl?: string;
|
|
10
|
+
/** Provider-specific extras (e.g. vertexProject, vertexLocation, vertexCredentials). */
|
|
11
|
+
config?: Record<string, unknown>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** A model suggestion for a provider, with litellm capability flags. */
|
|
15
|
+
export interface ProviderModel {
|
|
16
|
+
id: string;
|
|
17
|
+
contextWindow?: number;
|
|
18
|
+
supportsVision?: boolean;
|
|
19
|
+
supportsFunctionCalling?: boolean;
|
|
20
|
+
supportsAudioInput?: boolean;
|
|
21
|
+
supportsPdfInput?: boolean;
|
|
22
|
+
supportsReasoning?: boolean;
|
|
23
|
+
}
|
package/src/sessions/types.ts
CHANGED
|
@@ -66,6 +66,8 @@ export interface Message {
|
|
|
66
66
|
task?: Record<string, unknown>;
|
|
67
67
|
sender?: string;
|
|
68
68
|
thought?: boolean;
|
|
69
|
+
/** True when this message is a context-compaction summary (injected by compaction). */
|
|
70
|
+
isCompactionSummary?: boolean;
|
|
69
71
|
}
|
|
70
72
|
|
|
71
73
|
export interface AgentResponse {
|
package/src/values/values-api.ts
CHANGED
|
@@ -42,10 +42,6 @@ export class ValuesApi extends HttpApi {
|
|
|
42
42
|
return this.httpGet<string[]>('/values/synthesizers/' + synthesizerName + '/voices');
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
async getStmTypes(): Promise<string[]> {
|
|
46
|
-
return this.httpGet<string[]>('/values/stm-types');
|
|
47
|
-
}
|
|
48
|
-
|
|
49
45
|
async getDocumentExtractors(): Promise<string[]> {
|
|
50
46
|
return this.httpGet<string[]>('/values/document-extractors');
|
|
51
47
|
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { HttpApi } from '../http-api';
|
|
2
|
-
import { Paginated } from '../paginated';
|
|
3
|
-
import { AuthenticationProvider } from '../auth/authentication-provider';
|
|
4
|
-
import { KnownModel } from './types';
|
|
5
|
-
|
|
6
|
-
export class KnownModelsApi extends HttpApi {
|
|
7
|
-
constructor(baseUrl: string, auth: string | AuthenticationProvider) {
|
|
8
|
-
super(baseUrl, auth);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<KnownModel>> {
|
|
12
|
-
const { page: p, size: s } = this.normalizePageParams(page, size);
|
|
13
|
-
const params: Record<string, unknown> = { page: p, size: s, ...extraParams };
|
|
14
|
-
if (keyword) params.keyword = keyword;
|
|
15
|
-
return this.httpGet<Paginated<KnownModel>>('/known-models', params);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
async get(id: string): Promise<KnownModel> {
|
|
19
|
-
return this.httpGet<KnownModel>('/known-models/' + id);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
async create(knownModel: KnownModel): Promise<KnownModel> {
|
|
23
|
-
return this.httpPost<KnownModel>('/known-models', knownModel);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
async update(id: string, knownModel: KnownModel): Promise<KnownModel> {
|
|
27
|
-
return this.httpPut<KnownModel>('/known-models/' + id, knownModel);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
async remove(id: string): Promise<void> {
|
|
31
|
-
await this.httpDelete('/known-models/' + id);
|
|
32
|
-
}
|
|
33
|
-
}
|