whio-api-sdk 1.0.176 → 1.0.177-beta
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/src/sdk/sdk.d.ts +7 -1
- package/dist/src/sdk/sdk.js +40 -0
- package/dist/src/sdk/types.d.ts +27 -0
- package/dist/src/sdk/urls.d.ts +1 -0
- package/dist/src/sdk/urls.js +2 -0
- package/example-agent-settings.ts +77 -0
- package/package.json +1 -1
- package/src/sdk/sdk.ts +38 -0
- package/src/sdk/types.ts +34 -0
- package/src/sdk/urls.ts +3 -0
package/dist/src/sdk/sdk.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LoginResponse, LoginCredentials, SDKConfig, User, UpdateUserDto, Organization, TemplateCategory, Template, Team, UserTemplate, TranscriptionSummary, TranscriptionAudioUploadResponse, PasswordChangeResponse, Session, CreateSessionDto, UpdateSessionDto, Agent, AudioFile, UpdateAudioFileDto } from './types';
|
|
1
|
+
import { LoginResponse, LoginCredentials, SDKConfig, User, UpdateUserDto, Organization, TemplateCategory, Template, Team, UserTemplate, TranscriptionSummary, TranscriptionAudioUploadResponse, PasswordChangeResponse, Session, CreateSessionDto, UpdateSessionDto, Agent, AudioFile, UpdateAudioFileDto, AgentSettings, CreateAgentSettingsDto, UpdateAgentSettingsDto } from './types';
|
|
2
2
|
export declare class ApiSDK {
|
|
3
3
|
private baseUrl;
|
|
4
4
|
private storage;
|
|
@@ -96,6 +96,12 @@ export declare class ApiSDK {
|
|
|
96
96
|
deleteAgent(id: string): Promise<void>;
|
|
97
97
|
addAgentToOrganization(agentId: string, organizationId: string): Promise<void>;
|
|
98
98
|
removeAgentFromOrganization(agentId: string, organizationId: string): Promise<void>;
|
|
99
|
+
createAgentSettings(settingsData: CreateAgentSettingsDto): Promise<AgentSettings>;
|
|
100
|
+
getAgentSettings(organizationId?: string, agentId?: string): Promise<AgentSettings[]>;
|
|
101
|
+
getAgentSettingsById(id: string): Promise<AgentSettings>;
|
|
102
|
+
getAgentSettingsByAgentAndOrganization(agentId: string, organizationId: string): Promise<AgentSettings>;
|
|
103
|
+
updateAgentSettings(id: string, settingsData: UpdateAgentSettingsDto): Promise<AgentSettings>;
|
|
104
|
+
deleteAgentSettings(id: string): Promise<void>;
|
|
99
105
|
uploadAudioFileToSession(sessionId: string, file: File | Blob, fileName?: string): Promise<AudioFile>;
|
|
100
106
|
getMyAudioFiles(): Promise<AudioFile[]>;
|
|
101
107
|
getAllAudioFiles(): Promise<AudioFile[]>;
|
package/dist/src/sdk/sdk.js
CHANGED
|
@@ -724,6 +724,46 @@ export class ApiSDK {
|
|
|
724
724
|
});
|
|
725
725
|
}
|
|
726
726
|
// ======================
|
|
727
|
+
// AGENT SETTINGS METHODS
|
|
728
|
+
// ======================
|
|
729
|
+
createAgentSettings(settingsData) {
|
|
730
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
731
|
+
return this.request(urls.agentSettings, 'POST', settingsData);
|
|
732
|
+
});
|
|
733
|
+
}
|
|
734
|
+
getAgentSettings(organizationId, agentId) {
|
|
735
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
736
|
+
const params = new URLSearchParams();
|
|
737
|
+
if (organizationId)
|
|
738
|
+
params.append('organizationId', organizationId);
|
|
739
|
+
if (agentId)
|
|
740
|
+
params.append('agentId', agentId);
|
|
741
|
+
const queryString = params.toString();
|
|
742
|
+
const endpoint = queryString ? `${urls.agentSettings}?${queryString}` : urls.agentSettings;
|
|
743
|
+
return this.request(endpoint, 'GET');
|
|
744
|
+
});
|
|
745
|
+
}
|
|
746
|
+
getAgentSettingsById(id) {
|
|
747
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
748
|
+
return this.request(`${urls.agentSettings}/${id}`, 'GET');
|
|
749
|
+
});
|
|
750
|
+
}
|
|
751
|
+
getAgentSettingsByAgentAndOrganization(agentId, organizationId) {
|
|
752
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
753
|
+
return this.request(`${urls.agentSettings}/agent/${agentId}/organization/${organizationId}`, 'GET');
|
|
754
|
+
});
|
|
755
|
+
}
|
|
756
|
+
updateAgentSettings(id, settingsData) {
|
|
757
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
758
|
+
return this.request(`${urls.agentSettings}/${id}`, 'PATCH', settingsData);
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
deleteAgentSettings(id) {
|
|
762
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
763
|
+
yield this.request(`${urls.agentSettings}/${id}`, 'DELETE');
|
|
764
|
+
});
|
|
765
|
+
}
|
|
766
|
+
// ======================
|
|
727
767
|
// AUDIO FILE METHODS
|
|
728
768
|
// ======================
|
|
729
769
|
uploadAudioFileToSession(sessionId, file, fileName) {
|
package/dist/src/sdk/types.d.ts
CHANGED
|
@@ -364,3 +364,30 @@ export interface UpdateAudioFileDto {
|
|
|
364
364
|
transcriptionUrl?: string;
|
|
365
365
|
status?: AudioFileStatus;
|
|
366
366
|
}
|
|
367
|
+
export interface AgentSettings {
|
|
368
|
+
id: string;
|
|
369
|
+
temperature: number;
|
|
370
|
+
topK: number;
|
|
371
|
+
topP: number;
|
|
372
|
+
repetitionPenalty: number;
|
|
373
|
+
createdAt: string;
|
|
374
|
+
updatedAt: string;
|
|
375
|
+
agentId: string;
|
|
376
|
+
organizationId: string;
|
|
377
|
+
agent?: Agent;
|
|
378
|
+
organization?: Organization;
|
|
379
|
+
}
|
|
380
|
+
export interface CreateAgentSettingsDto {
|
|
381
|
+
agentId: string;
|
|
382
|
+
organizationId: string;
|
|
383
|
+
temperature?: number;
|
|
384
|
+
topK?: number;
|
|
385
|
+
topP?: number;
|
|
386
|
+
repetitionPenalty?: number;
|
|
387
|
+
}
|
|
388
|
+
export interface UpdateAgentSettingsDto {
|
|
389
|
+
temperature?: number;
|
|
390
|
+
topK?: number;
|
|
391
|
+
topP?: number;
|
|
392
|
+
repetitionPenalty?: number;
|
|
393
|
+
}
|
package/dist/src/sdk/urls.d.ts
CHANGED
package/dist/src/sdk/urls.js
CHANGED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// Example usage of AgentSettings functionality
|
|
2
|
+
import { ApiSDK, CreateAgentSettingsDto, UpdateAgentSettingsDto } from './src/sdk';
|
|
3
|
+
|
|
4
|
+
async function exampleAgentSettingsUsage() {
|
|
5
|
+
// Initialize SDK
|
|
6
|
+
const sdk = new ApiSDK({
|
|
7
|
+
baseUrl: 'http://localhost:3000',
|
|
8
|
+
storage: {
|
|
9
|
+
getItem: (key) => localStorage.getItem(key),
|
|
10
|
+
setItem: (key, value) => localStorage.setItem(key, value),
|
|
11
|
+
removeItem: (key) => localStorage.removeItem(key),
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
try {
|
|
16
|
+
// Login first (superuser required for agent settings)
|
|
17
|
+
await sdk.login({
|
|
18
|
+
email: 'superuser@example.com',
|
|
19
|
+
password: 'password123'
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
// Create agent settings
|
|
23
|
+
const createData: CreateAgentSettingsDto = {
|
|
24
|
+
agentId: 'agent-uuid-here',
|
|
25
|
+
organizationId: 'org-uuid-here',
|
|
26
|
+
temperature: 0.7,
|
|
27
|
+
topK: 40,
|
|
28
|
+
topP: 0.9,
|
|
29
|
+
repetitionPenalty: 1.1
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const newSettings = await sdk.createAgentSettings(createData);
|
|
33
|
+
console.log('Created agent settings:', newSettings);
|
|
34
|
+
|
|
35
|
+
// Get all agent settings
|
|
36
|
+
const allSettings = await sdk.getAgentSettings();
|
|
37
|
+
console.log('All agent settings:', allSettings);
|
|
38
|
+
|
|
39
|
+
// Get settings for specific organization
|
|
40
|
+
const orgSettings = await sdk.getAgentSettings('org-uuid-here');
|
|
41
|
+
console.log('Organization settings:', orgSettings);
|
|
42
|
+
|
|
43
|
+
// Get settings for specific agent
|
|
44
|
+
const agentSettings = await sdk.getAgentSettings(undefined, 'agent-uuid-here');
|
|
45
|
+
console.log('Agent settings:', agentSettings);
|
|
46
|
+
|
|
47
|
+
// Get specific settings by agent and organization
|
|
48
|
+
const specificSettings = await sdk.getAgentSettingsByAgentAndOrganization(
|
|
49
|
+
'agent-uuid-here',
|
|
50
|
+
'org-uuid-here'
|
|
51
|
+
);
|
|
52
|
+
console.log('Specific settings:', specificSettings);
|
|
53
|
+
|
|
54
|
+
// Update agent settings
|
|
55
|
+
const updateData: UpdateAgentSettingsDto = {
|
|
56
|
+
temperature: 0.8,
|
|
57
|
+
topK: 50
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const updatedSettings = await sdk.updateAgentSettings(newSettings.id, updateData);
|
|
61
|
+
console.log('Updated settings:', updatedSettings);
|
|
62
|
+
|
|
63
|
+
// Get settings by ID
|
|
64
|
+
const settingsById = await sdk.getAgentSettingsById(newSettings.id);
|
|
65
|
+
console.log('Settings by ID:', settingsById);
|
|
66
|
+
|
|
67
|
+
// Delete agent settings
|
|
68
|
+
await sdk.deleteAgentSettings(newSettings.id);
|
|
69
|
+
console.log('Agent settings deleted');
|
|
70
|
+
|
|
71
|
+
} catch (error) {
|
|
72
|
+
console.error('Error:', error);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Export for use in other files
|
|
77
|
+
export { exampleAgentSettingsUsage };
|
package/package.json
CHANGED
package/src/sdk/sdk.ts
CHANGED
|
@@ -44,6 +44,9 @@ import {
|
|
|
44
44
|
AudioFileStatus,
|
|
45
45
|
CreateAudioFileDto,
|
|
46
46
|
UpdateAudioFileDto,
|
|
47
|
+
AgentSettings,
|
|
48
|
+
CreateAgentSettingsDto,
|
|
49
|
+
UpdateAgentSettingsDto,
|
|
47
50
|
} from './types';
|
|
48
51
|
import urls from './urls';
|
|
49
52
|
import { jwtDecode } from 'jwt-decode';
|
|
@@ -790,6 +793,41 @@ export class ApiSDK {
|
|
|
790
793
|
await this.request(`${urls.agents}/${agentId}/organizations/${organizationId}`, 'DELETE');
|
|
791
794
|
}
|
|
792
795
|
|
|
796
|
+
// ======================
|
|
797
|
+
// AGENT SETTINGS METHODS
|
|
798
|
+
// ======================
|
|
799
|
+
|
|
800
|
+
public async createAgentSettings(settingsData: CreateAgentSettingsDto): Promise<AgentSettings> {
|
|
801
|
+
return this.request<AgentSettings>(urls.agentSettings, 'POST', settingsData);
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
public async getAgentSettings(organizationId?: string, agentId?: string): Promise<AgentSettings[]> {
|
|
805
|
+
const params = new URLSearchParams();
|
|
806
|
+
if (organizationId) params.append('organizationId', organizationId);
|
|
807
|
+
if (agentId) params.append('agentId', agentId);
|
|
808
|
+
|
|
809
|
+
const queryString = params.toString();
|
|
810
|
+
const endpoint = queryString ? `${urls.agentSettings}?${queryString}` : urls.agentSettings;
|
|
811
|
+
|
|
812
|
+
return this.request<AgentSettings[]>(endpoint, 'GET');
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
public async getAgentSettingsById(id: string): Promise<AgentSettings> {
|
|
816
|
+
return this.request<AgentSettings>(`${urls.agentSettings}/${id}`, 'GET');
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
public async getAgentSettingsByAgentAndOrganization(agentId: string, organizationId: string): Promise<AgentSettings> {
|
|
820
|
+
return this.request<AgentSettings>(`${urls.agentSettings}/agent/${agentId}/organization/${organizationId}`, 'GET');
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
public async updateAgentSettings(id: string, settingsData: UpdateAgentSettingsDto): Promise<AgentSettings> {
|
|
824
|
+
return this.request<AgentSettings>(`${urls.agentSettings}/${id}`, 'PATCH', settingsData);
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
public async deleteAgentSettings(id: string): Promise<void> {
|
|
828
|
+
await this.request(`${urls.agentSettings}/${id}`, 'DELETE');
|
|
829
|
+
}
|
|
830
|
+
|
|
793
831
|
// ======================
|
|
794
832
|
// AUDIO FILE METHODS
|
|
795
833
|
// ======================
|
package/src/sdk/types.ts
CHANGED
|
@@ -461,3 +461,37 @@ export interface UpdateAudioFileDto {
|
|
|
461
461
|
transcriptionUrl?: string;
|
|
462
462
|
status?: AudioFileStatus;
|
|
463
463
|
}
|
|
464
|
+
|
|
465
|
+
// Agent Settings types
|
|
466
|
+
export interface AgentSettings {
|
|
467
|
+
id: string;
|
|
468
|
+
temperature: number;
|
|
469
|
+
topK: number;
|
|
470
|
+
topP: number;
|
|
471
|
+
repetitionPenalty: number;
|
|
472
|
+
createdAt: string;
|
|
473
|
+
updatedAt: string;
|
|
474
|
+
agentId: string;
|
|
475
|
+
organizationId: string;
|
|
476
|
+
|
|
477
|
+
// Relationships (populated by API)
|
|
478
|
+
agent?: Agent;
|
|
479
|
+
organization?: Organization;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
// Agent Settings DTOs
|
|
483
|
+
export interface CreateAgentSettingsDto {
|
|
484
|
+
agentId: string;
|
|
485
|
+
organizationId: string;
|
|
486
|
+
temperature?: number;
|
|
487
|
+
topK?: number;
|
|
488
|
+
topP?: number;
|
|
489
|
+
repetitionPenalty?: number;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
export interface UpdateAgentSettingsDto {
|
|
493
|
+
temperature?: number;
|
|
494
|
+
topK?: number;
|
|
495
|
+
topP?: number;
|
|
496
|
+
repetitionPenalty?: number;
|
|
497
|
+
}
|