@proteos/sdk 0.20.0 → 0.20.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/dist/index.cjs +25 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +51 -1
- package/dist/index.d.ts +51 -1
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/auth/platform-entities.ts +1 -0
- package/src/conversation/index.ts +45 -0
- package/src/conversation/types.ts +39 -0
- package/src/index.ts +5 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proteos/sdk",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "TypeScript SDK for the Proteos platform",
|
|
6
6
|
"repository": {
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"tsup": "^8.3.0",
|
|
67
67
|
"typescript": "^5.7.0",
|
|
68
68
|
"vitest": "^3.0.0",
|
|
69
|
-
"@proteos/
|
|
70
|
-
"@proteos/
|
|
69
|
+
"@proteos/biome-config": "0.0.0",
|
|
70
|
+
"@proteos/tsconfig": "0.0.0"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"build": "tsup",
|
|
@@ -62,6 +62,7 @@ export const PLATFORM_ENTITIES: readonly PlatformEntity[] = [
|
|
|
62
62
|
{ slug: 'messages', name: 'Messages' },
|
|
63
63
|
{ slug: 'agent-listeners', name: 'Agent Listeners' },
|
|
64
64
|
{ slug: 'transcriptions', name: 'Transcriptions' },
|
|
65
|
+
{ slug: 'glossary-terms', name: 'Glossary Terms' },
|
|
65
66
|
// Connectors (connector-service). `connections` above is shared; this is the
|
|
66
67
|
// manifest catalog.
|
|
67
68
|
{ slug: 'connectors', name: 'Connectors' },
|
|
@@ -10,10 +10,13 @@ import type {
|
|
|
10
10
|
Conversation,
|
|
11
11
|
CreateAgentListenerRequest,
|
|
12
12
|
CreateConnectionRequest,
|
|
13
|
+
CreateGlossaryTermRequest,
|
|
13
14
|
DispatchMeetingBotRequest,
|
|
15
|
+
GlossaryTerm,
|
|
14
16
|
InstallConnectionResponse,
|
|
15
17
|
ListAgentListenersQuery,
|
|
16
18
|
ListConnectionsQuery,
|
|
19
|
+
ListGlossaryTermsQuery,
|
|
17
20
|
ListConversationsQuery,
|
|
18
21
|
ListMessagesQuery,
|
|
19
22
|
ListParticipantsQuery,
|
|
@@ -28,6 +31,7 @@ import type {
|
|
|
28
31
|
UnreadCounts,
|
|
29
32
|
UpdateAgentListenerRequest,
|
|
30
33
|
UpdateConnectionRequest,
|
|
34
|
+
UpdateGlossaryTermRequest,
|
|
31
35
|
} from './types.js'
|
|
32
36
|
|
|
33
37
|
const CONVERSATION_BASE_PATH = '/conversations/v1'
|
|
@@ -47,6 +51,8 @@ export class ConversationClient {
|
|
|
47
51
|
readonly conversations: ConversationService
|
|
48
52
|
readonly messages: MessageService
|
|
49
53
|
readonly agentListeners: AgentListenerService
|
|
54
|
+
/** Per-org glossary: custom vocabulary that boosts transcription accuracy. */
|
|
55
|
+
readonly glossaryTerms: GlossaryTermService
|
|
50
56
|
readonly transcriptions: TranscriptionService
|
|
51
57
|
/** Meeting bots (Ava): dispatch into a meeting URL, remove from a meeting. */
|
|
52
58
|
readonly meetings: MeetingService
|
|
@@ -58,6 +64,7 @@ export class ConversationClient {
|
|
|
58
64
|
this.conversations = new ConversationServiceImpl(client)
|
|
59
65
|
this.messages = new MessageServiceImpl(client)
|
|
60
66
|
this.agentListeners = new AgentListenerServiceImpl(client)
|
|
67
|
+
this.glossaryTerms = new GlossaryTermServiceImpl(client)
|
|
61
68
|
this.transcriptions = new TranscriptionServiceImpl(client)
|
|
62
69
|
this.meetings = new MeetingServiceImpl(client)
|
|
63
70
|
this.voice = new VoiceServiceImpl(client)
|
|
@@ -277,6 +284,44 @@ class AgentListenerServiceImpl implements AgentListenerService {
|
|
|
277
284
|
}
|
|
278
285
|
}
|
|
279
286
|
|
|
287
|
+
/**
|
|
288
|
+
* Per-org glossary: custom-vocabulary terms that boost transcription accuracy.
|
|
289
|
+
* A term feeds the transcription provider's keyterm prompting; `priority` ranks
|
|
290
|
+
* a term (prioritized terms are injected first, then unprioritized), which
|
|
291
|
+
* decides the top 100 sent when an org stores more than the provider's cap.
|
|
292
|
+
*/
|
|
293
|
+
export interface GlossaryTermService {
|
|
294
|
+
list(query?: ListGlossaryTermsQuery): Promise<ListResponse<GlossaryTerm>>
|
|
295
|
+
get(id: string): Promise<GlossaryTerm>
|
|
296
|
+
create(request: CreateGlossaryTermRequest): Promise<GlossaryTerm>
|
|
297
|
+
update(id: string, request: UpdateGlossaryTermRequest): Promise<GlossaryTerm>
|
|
298
|
+
delete(id: string): Promise<void>
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
class GlossaryTermServiceImpl implements GlossaryTermService {
|
|
302
|
+
constructor(private readonly client: ProteosClient) {}
|
|
303
|
+
|
|
304
|
+
list(query: ListGlossaryTermsQuery = {}): Promise<ListResponse<GlossaryTerm>> {
|
|
305
|
+
return this.client.requestWithQuery('GET', `${CONVERSATION_BASE_PATH}/glossary-terms`, query)
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
get(id: string): Promise<GlossaryTerm> {
|
|
309
|
+
return this.client.request('GET', `${CONVERSATION_BASE_PATH}/glossary-terms/${encodeURIComponent(id)}`)
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
create(request: CreateGlossaryTermRequest): Promise<GlossaryTerm> {
|
|
313
|
+
return this.client.request('POST', `${CONVERSATION_BASE_PATH}/glossary-terms`, request)
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
update(id: string, request: UpdateGlossaryTermRequest): Promise<GlossaryTerm> {
|
|
317
|
+
return this.client.request('PATCH', `${CONVERSATION_BASE_PATH}/glossary-terms/${encodeURIComponent(id)}`, request)
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
async delete(id: string): Promise<void> {
|
|
321
|
+
await this.client.request('DELETE', `${CONVERSATION_BASE_PATH}/glossary-terms/${encodeURIComponent(id)}`)
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
280
325
|
/** Batch transcription of stored audio files + materialization. */
|
|
281
326
|
export interface TranscriptionService {
|
|
282
327
|
/**
|
|
@@ -439,6 +439,45 @@ export interface UpdateAgentListenerRequest {
|
|
|
439
439
|
priority?: number
|
|
440
440
|
}
|
|
441
441
|
|
|
442
|
+
/**
|
|
443
|
+
* A per-org glossary term: custom vocabulary that improves transcription
|
|
444
|
+
* accuracy. `term` is the boost phrase injected into the provider's keyterm
|
|
445
|
+
* prompting; `definition` is human/agent documentation only. `priority` ranks a
|
|
446
|
+
* term for injection (prioritized terms outrank unprioritized; lower number
|
|
447
|
+
* first) and decides which terms win when the org exceeds the provider's 100-term
|
|
448
|
+
* per-request cap.
|
|
449
|
+
*/
|
|
450
|
+
export interface GlossaryTerm {
|
|
451
|
+
id: string
|
|
452
|
+
org_id: string
|
|
453
|
+
term: string
|
|
454
|
+
definition?: string
|
|
455
|
+
priority?: number
|
|
456
|
+
created_at: string
|
|
457
|
+
created_by: UserRef
|
|
458
|
+
updated_at: string
|
|
459
|
+
updated_by: UserRef
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
export interface CreateGlossaryTermRequest {
|
|
463
|
+
term: string
|
|
464
|
+
definition?: string
|
|
465
|
+
priority?: number
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
export interface UpdateGlossaryTermRequest {
|
|
469
|
+
term?: string
|
|
470
|
+
definition?: string
|
|
471
|
+
priority?: number
|
|
472
|
+
/** Removes the term's priority (unprioritizes it) regardless of `priority`. */
|
|
473
|
+
is_priority_cleared?: boolean
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
export interface ListGlossaryTermsQuery extends PaginationQuery {
|
|
477
|
+
/** Case-insensitive substring match on the term text. */
|
|
478
|
+
search?: string
|
|
479
|
+
}
|
|
480
|
+
|
|
442
481
|
export interface PaginationQuery {
|
|
443
482
|
page?: number
|
|
444
483
|
page_size?: number
|
package/src/index.ts
CHANGED
|
@@ -183,10 +183,14 @@ export type {
|
|
|
183
183
|
ConversationStatus,
|
|
184
184
|
CreateAgentListenerRequest,
|
|
185
185
|
CreateConnectionRequest,
|
|
186
|
+
CreateGlossaryTermRequest,
|
|
186
187
|
DispatchMeetingBotRequest,
|
|
188
|
+
GlossaryTerm,
|
|
189
|
+
GlossaryTermService,
|
|
187
190
|
InstallConnectionResponse,
|
|
188
191
|
ListAgentListenersQuery,
|
|
189
192
|
ListConnectionsQuery,
|
|
193
|
+
ListGlossaryTermsQuery,
|
|
190
194
|
ListConversationsQuery,
|
|
191
195
|
ListMessagesQuery,
|
|
192
196
|
ListParticipantsQuery,
|
|
@@ -218,6 +222,7 @@ export type {
|
|
|
218
222
|
UnreadCounts,
|
|
219
223
|
UpdateAgentListenerRequest,
|
|
220
224
|
UpdateConnectionRequest,
|
|
225
|
+
UpdateGlossaryTermRequest,
|
|
221
226
|
VoiceService,
|
|
222
227
|
VoiceTranscriptionStream,
|
|
223
228
|
} from './conversation/index.js'
|