@bitbitpress/client 0.1.7 → 0.1.9
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 +111 -118
- package/dist/examples/basic-usage.d.ts.map +1 -1
- package/dist/examples/basic-usage.js +39 -47
- package/dist/examples/basic-usage.js.map +1 -1
- package/dist/generated/openapi.d.ts +28 -39
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/user/batch-manager.d.ts +6 -5
- package/dist/user/batch-manager.d.ts.map +1 -1
- package/dist/user/batch-manager.js +15 -23
- package/dist/user/batch-manager.js.map +1 -1
- package/dist/user/index.d.ts +28 -32
- package/dist/user/index.d.ts.map +1 -1
- package/dist/user/index.js +44 -20
- package/dist/user/index.js.map +1 -1
- package/dist/user/profile.d.ts +2 -2
- package/dist/user/profile.d.ts.map +1 -1
- package/dist/user/profile.js +2 -2
- package/dist/user/profile.js.map +1 -1
- package/dist/user/recommendations.d.ts +5 -12
- package/dist/user/recommendations.d.ts.map +1 -1
- package/dist/user/recommendations.js +3 -3
- package/dist/user/recommendations.js.map +1 -1
- package/dist/user/report.d.ts +3 -3
- package/dist/user/report.d.ts.map +1 -1
- package/dist/user/report.js +3 -3
- package/dist/user/report.js.map +1 -1
- package/dist/user/signal-batch-manager.d.ts +5 -7
- package/dist/user/signal-batch-manager.d.ts.map +1 -1
- package/dist/user/signal-batch-manager.js +7 -7
- package/dist/user/signal-batch-manager.js.map +1 -1
- package/dist/user/signal.d.ts +3 -3
- package/dist/user/signal.d.ts.map +1 -1
- package/dist/user/signal.js +3 -3
- package/dist/user/signal.js.map +1 -1
- package/dist/user/synthesize.d.ts +19 -13
- package/dist/user/synthesize.d.ts.map +1 -1
- package/dist/user/synthesize.js +26 -4
- package/dist/user/synthesize.js.map +1 -1
- package/dist/user/token.d.ts +3 -3
- package/dist/user/token.d.ts.map +1 -1
- package/dist/user/token.js +3 -3
- package/dist/user/token.js.map +1 -1
- package/dist/user/typeDefs.d.ts +18 -0
- package/dist/user/typeDefs.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -306,6 +306,7 @@ client.user.signal(options: SignalRequest): Promise<SignalResponse>
|
|
|
306
306
|
- `contentContext` (optional): Context about the content that triggered this signal
|
|
307
307
|
- `contentId` (required): The ID of the content (e.g., your article ID)
|
|
308
308
|
- `contentType` (required): The type of content (currently only `"article"`)
|
|
309
|
+
- `options.isSynchronous` (optional): When `true`, the request waits for signals to be processed. Defaults to `false`. Use sparingly.
|
|
309
310
|
|
|
310
311
|
##### Returns
|
|
311
312
|
|
|
@@ -410,147 +411,128 @@ console.log('Signal 2 recorded:', response2.recorded);
|
|
|
410
411
|
|
|
411
412
|
#### synthesizeItem
|
|
412
413
|
|
|
413
|
-
Synthesize a single item (batched). Items are automatically batched and sent together after the configured timeout. Returns a promise that resolves with the `data` field from the event (excluding 'connected' and 'complete' events).
|
|
414
|
+
Synthesize a single item (batched). Items are automatically batched and sent together after the configured timeout. Returns a promise that resolves with the `data` field from the event for that item's index (excluding 'connected' and 'complete' events).
|
|
414
415
|
|
|
415
416
|
```typescript
|
|
416
|
-
client.user.synthesizeItem(item:
|
|
417
|
+
client.user.synthesizeItem(item: SynthesizeItem): Promise<SynthesizeItemResponse>
|
|
417
418
|
```
|
|
418
419
|
|
|
419
420
|
##### Parameters
|
|
420
421
|
|
|
421
|
-
- `item` (required): A single synthesize item (same
|
|
422
|
+
- `item` (required): A single synthesize item (same shape as items in `synthesize`): `inputs`, `output` (schema as JSON string or Zod 4 schema, optional `staleAfter`), optional `configurationKeyName`
|
|
422
423
|
|
|
423
424
|
##### Returns
|
|
424
425
|
|
|
425
|
-
- `Promise<
|
|
426
|
-
- For `DAILY_SUMMARY`: `{ summary: string | null }`
|
|
427
|
-
- For `CUSTOM`: An object following your schema input, where `fieldNames` are keys
|
|
426
|
+
- `Promise<SynthesizeItemResponse>`: Resolves with the data event for this item — `data` is the synthesized object (keys match your output schema) when present; `error` is set on failure
|
|
428
427
|
|
|
429
428
|
##### Behavior
|
|
430
429
|
|
|
431
|
-
- Items added within the batch timeout window (default: 250ms) are grouped
|
|
432
|
-
- Each item's promise resolves
|
|
433
|
-
- The
|
|
434
|
-
- Only data events (DAILY_SUMMARY or CUSTOM) resolve the promise - 'connected' and 'complete' events are ignored
|
|
435
|
-
- The batch timeout can be configured when creating the client via `synthesizeBatchTimeout`
|
|
430
|
+
- Items added within the batch timeout window (default: 250ms) are grouped and sent in one request
|
|
431
|
+
- Each item's promise resolves when its data event arrives (by `index`)
|
|
432
|
+
- The batch timeout is configurable via `synthesizeBatchTimeout` when creating the client
|
|
436
433
|
|
|
437
434
|
##### Example
|
|
438
435
|
|
|
439
436
|
```typescript
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
437
|
+
const result1 = await client.user.synthesizeItem({
|
|
438
|
+
inputs: [{ type: 'externalId', value: 'article-123' }],
|
|
439
|
+
output: {
|
|
440
|
+
schema: JSON.stringify({
|
|
441
|
+
type: 'object',
|
|
442
|
+
properties: { title: { type: 'string' }, summary: { type: 'string' } },
|
|
443
|
+
}),
|
|
444
|
+
},
|
|
444
445
|
});
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
},
|
|
456
|
-
|
|
457
|
-
contentContext: {
|
|
458
|
-
contentId: 'article-123',
|
|
459
|
-
contentType: 'article',
|
|
460
|
-
expandOnContext: true,
|
|
446
|
+
console.log('Synthesized:', result1);
|
|
447
|
+
|
|
448
|
+
// Or pass a Zod 4 schema (converted to JSON schema string when sending)
|
|
449
|
+
// meta variables include:
|
|
450
|
+
// - description: formatting and purpose of the field
|
|
451
|
+
// - characterLimitHint: rough amount of max characters the field should have, works as a hint
|
|
452
|
+
import { z } from 'zod';
|
|
453
|
+
const result2 = await client.user.synthesizeItem({
|
|
454
|
+
inputs: [{ type: 'text', value: 'Summarize this' }],
|
|
455
|
+
output: {
|
|
456
|
+
schema: z.object({ headline: z.string().meta({ description: 'headline, uppercase', characterLimitHint: 100 }) }),
|
|
457
|
+
staleAfter: '30m',
|
|
461
458
|
},
|
|
462
459
|
});
|
|
463
|
-
// customData will be an object with keys matching your schema fieldNames
|
|
464
|
-
console.log('Custom data:', customData);
|
|
465
|
-
|
|
466
|
-
// Both items are sent together in a single batch request
|
|
467
|
-
// Each promise resolves immediately when its data event arrives
|
|
468
460
|
```
|
|
469
461
|
|
|
470
462
|
---
|
|
471
463
|
|
|
472
464
|
#### synthesize
|
|
473
465
|
|
|
474
|
-
Synthesize user
|
|
466
|
+
Synthesize content items personalized to the user (streaming SSE). Returns a stream of connection and data events.
|
|
475
467
|
|
|
476
468
|
```typescript
|
|
477
|
-
client.user.synthesize(items:
|
|
469
|
+
client.user.synthesize(items: SynthesizeItems): Promise<AsyncIterable<SynthesizeEvent>>
|
|
478
470
|
```
|
|
479
471
|
|
|
480
472
|
##### Parameters
|
|
481
473
|
|
|
482
|
-
- `items` (required): Array of items
|
|
483
|
-
- `{ type: "
|
|
484
|
-
- `{
|
|
485
|
-
|
|
486
|
-
##### SchemaField
|
|
487
|
-
|
|
488
|
-
- `fieldName` (required): Name of the field
|
|
489
|
-
- `fieldDescription` (required): A prompt describing the value of the field
|
|
490
|
-
- `fieldCharacterLimitHint` (optional): Optional hint for max number of characters that should be returned for this field. Not a guarantee.
|
|
491
|
-
|
|
492
|
-
##### ContentContext (required for CUSTOM items)
|
|
493
|
-
|
|
494
|
-
- `contentId` (optional): Your content ID
|
|
495
|
-
- `contentType` (optional): The type of content to synthesize (currently only `"article"`)
|
|
496
|
-
- `expandOnContext` (optional): If `true`, expands on the current context to provide more data to the synthesis. Determines if the synthesis should focus on the content provided, or if it should expand on it.
|
|
474
|
+
- `items` (required): Array of items. Each item has:
|
|
475
|
+
- `inputs` (optional): Context for synthesis — array of `{ type: "externalId" | "text" | "excludeExternalIds", value: string }` (article ID, freeform text, or comma-separated external IDs to exclude)
|
|
476
|
+
- `output`: `{ schema: string | ZodType, staleAfter?: string }` — output schema as a JSON string or Zod 4 schema (top-level type must be `"object"`); optional staleness (e.g. `"1h"`, `"30m"`, `"1d"`)
|
|
477
|
+
- `configurationKeyName` (optional): Key name for configuration
|
|
497
478
|
|
|
498
479
|
##### Returns
|
|
499
480
|
|
|
500
|
-
- `Promise<AsyncIterable<SynthesizeEvent>>`:
|
|
481
|
+
- `Promise<AsyncIterable<SynthesizeEvent>>`: Async iterable of events
|
|
501
482
|
|
|
502
483
|
##### SynthesizeEvent
|
|
503
484
|
|
|
504
|
-
Events in the stream can be:
|
|
505
|
-
|
|
506
485
|
- `{ type: "connected" }`: Connection established
|
|
507
|
-
- `{ type: "DAILY_SUMMARY", index: number, data: { summary: string | null } }`: Daily summary data
|
|
508
|
-
- `{ type: "CUSTOM", index: number, data: {...} }`: Custom data following your schema
|
|
509
486
|
- `{ type: "complete" }`: Stream complete
|
|
487
|
+
- `{ index: number, data?: unknown, error?: string }`: Data event for that item — `data` is the synthesized object (keys match your output schema) when present; `error` is set on failure
|
|
510
488
|
|
|
511
489
|
##### Example
|
|
512
490
|
|
|
513
491
|
```typescript
|
|
492
|
+
import { z } from 'zod';
|
|
493
|
+
|
|
514
494
|
const stream = await client.user.synthesize([
|
|
515
495
|
{
|
|
516
|
-
type: '
|
|
496
|
+
inputs: [{ type: 'externalId', value: 'article-123' }],
|
|
497
|
+
output: {
|
|
498
|
+
schema: JSON.stringify({
|
|
499
|
+
type: 'object',
|
|
500
|
+
properties: { title: { type: 'string' }, summary: { type: 'string' } },
|
|
501
|
+
}),
|
|
502
|
+
},
|
|
517
503
|
},
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
504
|
+
{
|
|
505
|
+
inputs: [{ type: 'text', value: 'Summarize recent tech news' }],
|
|
506
|
+
output: {
|
|
507
|
+
schema: z.object({ headline: z.string() }),
|
|
508
|
+
staleAfter: '1h',
|
|
509
|
+
},
|
|
510
|
+
},
|
|
511
|
+
// Richer Zod schema: array of objects with description and characterLimitHint
|
|
512
|
+
{
|
|
513
|
+
inputs: [{ type: 'text', value: 'Summarize key points by topic' }],
|
|
514
|
+
output: {
|
|
515
|
+
schema: z.object({
|
|
516
|
+
summaries: z.array(
|
|
517
|
+
z.object({
|
|
518
|
+
summary: z.string().meta({
|
|
519
|
+
description: 'a single sentence summary of a specific topic or facts',
|
|
520
|
+
characterLimitHint: 100,
|
|
521
|
+
}),
|
|
522
|
+
}),
|
|
523
|
+
),
|
|
524
|
+
}),
|
|
537
525
|
},
|
|
526
|
+
],
|
|
538
527
|
]);
|
|
539
528
|
|
|
540
529
|
for await (const event of stream) {
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
break;
|
|
548
|
-
case 'CUSTOM':
|
|
549
|
-
console.log('Custom data:', event.data);
|
|
550
|
-
break;
|
|
551
|
-
case 'complete':
|
|
552
|
-
console.log('Stream complete');
|
|
553
|
-
break;
|
|
530
|
+
if ('type' in event) {
|
|
531
|
+
if (event.type === 'connected') console.log('Stream connected');
|
|
532
|
+
else if (event.type === 'complete') console.log('Stream complete');
|
|
533
|
+
} else if ('index' in event) {
|
|
534
|
+
if (event.error) console.error(`Item ${event.index}:`, event.error);
|
|
535
|
+
else console.log(`Item ${event.index}:`, event.data);
|
|
554
536
|
}
|
|
555
537
|
}
|
|
556
538
|
```
|
|
@@ -559,6 +541,8 @@ for await (const event of stream) {
|
|
|
559
541
|
|
|
560
542
|
### Types
|
|
561
543
|
|
|
544
|
+
API request/response types are derived from the Control Room OpenAPI spec. The source of truth is `src/generated/openapi.d.ts`, generated by `npm run generate:types`. The types below mirror that spec for reference.
|
|
545
|
+
|
|
562
546
|
#### BitBitPressClientConfig
|
|
563
547
|
|
|
564
548
|
```typescript
|
|
@@ -650,6 +634,8 @@ type SignalRequest = {
|
|
|
650
634
|
contentType: 'article';
|
|
651
635
|
};
|
|
652
636
|
}>;
|
|
637
|
+
/** When true, wait for signals to be processed. Default false. Use sparingly. */
|
|
638
|
+
isSynchronous?: boolean;
|
|
653
639
|
}
|
|
654
640
|
```
|
|
655
641
|
|
|
@@ -677,42 +663,49 @@ type SignalResponse = {
|
|
|
677
663
|
|
|
678
664
|
#### SynthesizeRequest
|
|
679
665
|
|
|
666
|
+
Request body for POST `/v1/user/synthesize` (from OpenAPI). Each item has `inputs`, `output`, and optional `configurationKeyName`.
|
|
667
|
+
|
|
680
668
|
```typescript
|
|
681
669
|
type SynthesizeRequest = {
|
|
682
|
-
items: Array<
|
|
683
|
-
|
|
684
|
-
|
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
}>;
|
|
691
|
-
contentContext: {
|
|
692
|
-
contentId?: string;
|
|
693
|
-
contentType?: 'article';
|
|
694
|
-
expandOnContext?: boolean;
|
|
695
|
-
};
|
|
696
|
-
}
|
|
697
|
-
>;
|
|
670
|
+
items: Array<{
|
|
671
|
+
configurationKeyName?: string;
|
|
672
|
+
inputs?: Array<{ type: 'externalId' | 'text' | 'excludeExternalIds'; value: string }>;
|
|
673
|
+
output: {
|
|
674
|
+
schema: string; // JSON schema string; top-level type must be "object"
|
|
675
|
+
staleAfter?: string;
|
|
676
|
+
};
|
|
677
|
+
}>;
|
|
698
678
|
}
|
|
699
679
|
```
|
|
700
680
|
|
|
681
|
+
#### SynthesizeItem / SynthesizeItems
|
|
682
|
+
|
|
683
|
+
Same shape as the request items above, but `output.schema` may be a **string or a Zod 4 schema**; Zod schemas are converted to the expected JSON schema string when sending.
|
|
684
|
+
|
|
685
|
+
- `SynthesizeItem`: Single item (for `synthesizeItem`).
|
|
686
|
+
- `SynthesizeItems`: Array of items (for `synthesize`).
|
|
687
|
+
- `SynthesizeOutputSchema`: `string | ZodType` (exported for typing `output.schema`).
|
|
688
|
+
|
|
701
689
|
#### SynthesizeEvent
|
|
702
690
|
|
|
691
|
+
Stream events (SSE). Connection events use `type`; data events use `index`, optional `data`, and optional `error`.
|
|
692
|
+
|
|
703
693
|
```typescript
|
|
704
|
-
type SynthesizeEvent =
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
data?: unknown;
|
|
708
|
-
}
|
|
694
|
+
type SynthesizeEvent =
|
|
695
|
+
| { type: 'connected' }
|
|
696
|
+
| { type: 'complete' }
|
|
697
|
+
| { index: number; data?: unknown; error?: string };
|
|
709
698
|
```
|
|
710
699
|
|
|
711
|
-
|
|
700
|
+
`data` is the synthesized object (keys match your output schema) when present; `error` is set on failure.
|
|
701
|
+
|
|
702
|
+
#### SynthesizeItemResponse
|
|
703
|
+
|
|
704
|
+
Return type of `synthesizeItem`. Same shape as a data event payload (without `index`).
|
|
705
|
+
|
|
712
706
|
```typescript
|
|
713
|
-
{
|
|
714
|
-
|
|
715
|
-
|
|
707
|
+
type SynthesizeItemResponse = {
|
|
708
|
+
data?: unknown; // synthesized object when present
|
|
709
|
+
error?: string; // set on failure
|
|
710
|
+
};
|
|
716
711
|
```
|
|
717
|
-
|
|
718
|
-
For `CUSTOM` events, `data` will be an object following your schema input, where `fieldNames` are keys.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basic-usage.d.ts","sourceRoot":"","sources":["../../src/examples/basic-usage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,iBAAe,YAAY,kBA4B1B;AAGD,iBAAe,gBAAgB,
|
|
1
|
+
{"version":3,"file":"basic-usage.d.ts","sourceRoot":"","sources":["../../src/examples/basic-usage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,iBAAe,YAAY,kBA4B1B;AAGD,iBAAe,gBAAgB,kBAuC9B;AAGD,iBAAe,uBAAuB,kBAiCrC;AAGD,iBAAe,aAAa,kBAqC3B;AAGD,iBAAe,oBAAoB,kBAiClC;AAED,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,aAAa,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -40,43 +40,37 @@ async function streamingExample() {
|
|
|
40
40
|
await client.user.authenticate("your-user's-auth-sso-token");
|
|
41
41
|
const stream = await client.user.synthesize([
|
|
42
42
|
{
|
|
43
|
-
type: '
|
|
43
|
+
inputs: [{ type: 'externalId', value: 'article-123' }],
|
|
44
|
+
output: {
|
|
45
|
+
schema: JSON.stringify({
|
|
46
|
+
type: 'object',
|
|
47
|
+
properties: { title: { type: 'string' }, summary: { type: 'string' } },
|
|
48
|
+
}),
|
|
49
|
+
},
|
|
44
50
|
},
|
|
45
51
|
{
|
|
46
|
-
type: '
|
|
47
|
-
|
|
48
|
-
{
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
{
|
|
54
|
-
fieldName: 'summary',
|
|
55
|
-
fieldDescription: 'A brief summary',
|
|
56
|
-
fieldCharacterLimitHint: 200,
|
|
57
|
-
},
|
|
58
|
-
],
|
|
59
|
-
contentContext: {
|
|
60
|
-
contentId: 'article-123',
|
|
61
|
-
contentType: 'article',
|
|
62
|
-
expandOnContext: true,
|
|
52
|
+
inputs: [{ type: 'text', value: 'Summarize recent tech news' }],
|
|
53
|
+
output: {
|
|
54
|
+
schema: JSON.stringify({
|
|
55
|
+
type: 'object',
|
|
56
|
+
properties: { headline: { type: 'string' } },
|
|
57
|
+
}),
|
|
58
|
+
staleAfter: '1h',
|
|
63
59
|
},
|
|
64
60
|
},
|
|
65
61
|
]);
|
|
66
62
|
for await (const event of stream) {
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
if ('type' in event) {
|
|
64
|
+
if (event.type === 'connected')
|
|
69
65
|
console.log('Stream connected');
|
|
70
|
-
|
|
71
|
-
case 'DAILY_SUMMARY':
|
|
72
|
-
console.log('Daily summary:', event.data);
|
|
73
|
-
break;
|
|
74
|
-
case 'CUSTOM':
|
|
75
|
-
console.log('Custom data:', event.data);
|
|
76
|
-
break;
|
|
77
|
-
case 'complete':
|
|
66
|
+
else if (event.type === 'complete')
|
|
78
67
|
console.log('Stream complete');
|
|
79
|
-
|
|
68
|
+
}
|
|
69
|
+
else if ('index' in event) {
|
|
70
|
+
if (event.error)
|
|
71
|
+
console.error(`Item ${event.index}:`, event.error);
|
|
72
|
+
else
|
|
73
|
+
console.log(`Item ${event.index}:`, event.data);
|
|
80
74
|
}
|
|
81
75
|
}
|
|
82
76
|
}
|
|
@@ -89,27 +83,25 @@ async function batchedSynthesisExample() {
|
|
|
89
83
|
// Authenticate first
|
|
90
84
|
await client.user.authenticate("your-user's-auth-sso-token");
|
|
91
85
|
// Items are automatically batched and sent together after the timeout
|
|
92
|
-
// Each promise resolves with the data
|
|
93
|
-
const
|
|
94
|
-
type: '
|
|
86
|
+
// Each promise resolves with the synthesized data for that item's index
|
|
87
|
+
const result1 = await client.user.synthesizeItem({
|
|
88
|
+
inputs: [{ type: 'externalId', value: 'article-123' }],
|
|
89
|
+
output: {
|
|
90
|
+
schema: JSON.stringify({
|
|
91
|
+
type: 'object',
|
|
92
|
+
properties: { title: { type: 'string' }, summary: { type: 'string' } },
|
|
93
|
+
}),
|
|
94
|
+
},
|
|
95
95
|
});
|
|
96
|
-
console.log('
|
|
97
|
-
const
|
|
98
|
-
type: '
|
|
99
|
-
|
|
100
|
-
{
|
|
101
|
-
|
|
102
|
-
fieldDescription: 'The article title',
|
|
103
|
-
fieldCharacterLimitHint: 100,
|
|
104
|
-
},
|
|
105
|
-
],
|
|
106
|
-
contentContext: {
|
|
107
|
-
contentId: 'article-123',
|
|
108
|
-
contentType: 'article',
|
|
109
|
-
expandOnContext: true,
|
|
96
|
+
console.log('Synthesized:', result1);
|
|
97
|
+
const result2 = await client.user.synthesizeItem({
|
|
98
|
+
inputs: [{ type: 'text', value: 'Summarize this' }],
|
|
99
|
+
output: {
|
|
100
|
+
schema: JSON.stringify({ type: 'object', properties: { headline: { type: 'string' } } }),
|
|
101
|
+
staleAfter: '30m',
|
|
110
102
|
},
|
|
111
103
|
});
|
|
112
|
-
console.log('
|
|
104
|
+
console.log('Synthesized:', result2);
|
|
113
105
|
// Both items are sent together in a single batch request
|
|
114
106
|
// Each promise resolves immediately when its data event arrives
|
|
115
107
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basic-usage.js","sourceRoot":"","sources":["../../src/examples/basic-usage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,6CAA6C;AAC7C,KAAK,UAAU,YAAY;IACzB,MAAM,MAAM,GAAG,IAAI,iBAAiB,CAAC;QACnC,OAAO,EAAE,mDAAmD;KAC7D,CAAC,CAAC;IAEH,gFAAgF;IAChF,MAAM,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,4BAA4B,CAAC,CAAC;IAE7D,sBAAsB;IACtB,MAAM,eAAe,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC;QACxD,KAAK,EAAE,EAAE;KACV,CAAC,CAAC;IACH,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC;IAEvD,yDAAyD;IACzD,MAAM,YAAY,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;QAC5C,OAAO,EAAE;YACP;gBACE,MAAM,EAAE,6BAA6B;gBACrC,IAAI,EAAE,QAAQ;gBACd,cAAc,EAAE;oBACd,SAAS,EAAE,aAAa;oBACxB,WAAW,EAAE,SAAS;iBACvB;aACF;SACF;KACF,CAAC,CAAC;IACH,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,YAAY,CAAC,QAAQ,CAAC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C,YAAY,CAAC,4BAA4B,CAAC,CAAC;IAE7D,wEAAwE;IACxE,gDAAgD;IAChD,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;QAC7C,MAAM,EAAE,6EAA6E;QACrF,IAAI,EAAE,QAAQ;QACd,cAAc,EAAE;YACd,SAAS,EAAE,aAAa;YACxB,WAAW,EAAE,SAAS;SACvB;KACF,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;QAC7C,MAAM,EAAE,uBAAuB;QAC/B,IAAI,EAAE,SAAS;QACf,cAAc,EAAE;YACd,SAAS,EAAE,aAAa;YACxB,WAAW,EAAE,SAAS;SACvB;KACF,CAAC,CAAC;IAEH,2DAA2D;IAC3D,yDAAyD;IACzD,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;IACtD,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;AACxD,CAAC;AAED,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,aAAa,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -482,6 +482,8 @@ export interface paths {
|
|
|
482
482
|
contentType: "article";
|
|
483
483
|
};
|
|
484
484
|
}[];
|
|
485
|
+
/** @description Whether the request should wait for the signals to be processed. False by default. Use sparingly. */
|
|
486
|
+
isSynchronous?: boolean;
|
|
485
487
|
};
|
|
486
488
|
};
|
|
487
489
|
};
|
|
@@ -571,7 +573,7 @@ export interface paths {
|
|
|
571
573
|
* Synthesize User Content
|
|
572
574
|
* @description **POST** `/v1/user/synthesize`
|
|
573
575
|
*
|
|
574
|
-
* Synthesize content items personalized to the user.
|
|
576
|
+
* Synthesize content items personalized to the user.
|
|
575
577
|
*/
|
|
576
578
|
post: {
|
|
577
579
|
parameters: {
|
|
@@ -586,70 +588,57 @@ export interface paths {
|
|
|
586
588
|
requestBody: {
|
|
587
589
|
content: {
|
|
588
590
|
"application/json": {
|
|
589
|
-
/** @description Array of items to synthesize */
|
|
590
|
-
items:
|
|
591
|
-
/**
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
type: "DAILY_SUMMARY" | "CUSTOM";
|
|
596
|
-
} | {
|
|
597
|
-
/** @enum {unknown} */
|
|
598
|
-
type?: "DAILY_SUMMARY";
|
|
599
|
-
} | {
|
|
600
|
-
/** @enum {unknown} */
|
|
601
|
-
type?: "CUSTOM";
|
|
602
|
-
/** @description Schema describing the output format. */
|
|
603
|
-
schema: {
|
|
604
|
-
/** @description Name of the field */
|
|
605
|
-
fieldName: string;
|
|
606
|
-
/** @description A prompt describing the value of the field */
|
|
607
|
-
fieldDescription: string;
|
|
608
|
-
/** @description Optional hint for max number of characters that should be returned for this field. Not a guarantee. */
|
|
609
|
-
fieldCharacterLimitHint?: number;
|
|
610
|
-
}[];
|
|
611
|
-
/** @description Context data to provide to the prompt. */
|
|
612
|
-
contentContext: {
|
|
613
|
-
/** @description Your content id */
|
|
614
|
-
contentId?: string;
|
|
591
|
+
/** @description Array of items to synthesize. Each item has inputs and output; optional configurationKeyName to use a named config (omit for default). */
|
|
592
|
+
items: {
|
|
593
|
+
/** @description Optional configuration key name. Loads an existing synthesis config by this name; omit for default configuration. */
|
|
594
|
+
configurationKeyName?: string;
|
|
595
|
+
/** @description Inputs used as context for the synthesis: externalId (article ID), or text (freeform text). */
|
|
596
|
+
inputs?: {
|
|
615
597
|
/**
|
|
616
|
-
* @description
|
|
598
|
+
* @description Type of input: externalId (article) or text (freeform).
|
|
617
599
|
* @enum {string}
|
|
618
600
|
*/
|
|
619
|
-
|
|
620
|
-
/** @description
|
|
621
|
-
|
|
601
|
+
type: "externalId" | "text" | "excludeExternalIds";
|
|
602
|
+
/** @description External ID (e.g. article) for externalId, freeform text for text, or comma-separated list of external IDs to exclude */
|
|
603
|
+
value: string;
|
|
604
|
+
}[];
|
|
605
|
+
/** @description Output definition: schema and optional staleness. */
|
|
606
|
+
output: {
|
|
607
|
+
/** @description Output schema as a JSON string. Top-level type must be "object". Example: {"type":"object","properties":{"title":{"type":"string","description":"title"}}} */
|
|
608
|
+
schema: string;
|
|
609
|
+
/** @description Time after which the result is considered stale and will be regenerated again. Examples: "1h", "30m", "1d", "3600" (seconds). */
|
|
610
|
+
staleAfter?: string;
|
|
622
611
|
};
|
|
623
|
-
}
|
|
612
|
+
}[];
|
|
624
613
|
};
|
|
625
614
|
};
|
|
626
615
|
};
|
|
627
616
|
responses: {
|
|
628
617
|
/**
|
|
629
|
-
* @description Streaming response (Server-Sent Events). Each event is a JSON object sent as `data: {JSON}\n\n`.
|
|
618
|
+
* @description Streaming response (Server-Sent Events). Each event is a JSON object sent as `data: {JSON}\n\n`.
|
|
630
619
|
*
|
|
631
620
|
* **Connection Events:**
|
|
632
621
|
* ```json
|
|
633
622
|
* {"type":"connected" | "complete"}
|
|
634
623
|
* ```
|
|
635
624
|
*
|
|
636
|
-
* **Data Events:**
|
|
625
|
+
* **Data Events (success):**
|
|
637
626
|
* ```json
|
|
638
627
|
* {
|
|
639
|
-
* "type": "DAILY_SUMMARY" | "CUSTOM",
|
|
640
628
|
* "index": number,
|
|
641
629
|
* "data": {...}
|
|
642
630
|
* }
|
|
643
631
|
* ```
|
|
632
|
+
* `data` is the synthesized object (keys match your output schema).
|
|
644
633
|
*
|
|
645
|
-
*
|
|
634
|
+
* **Data Events (error):**
|
|
646
635
|
* ```json
|
|
647
636
|
* {
|
|
648
|
-
* "
|
|
637
|
+
* "index": number,
|
|
638
|
+
* "error": "error message"
|
|
649
639
|
* }
|
|
650
640
|
* ```
|
|
651
|
-
*
|
|
652
|
-
* For `CUSTOM` type, `data` will be an object following your schema input, where `fieldNames` are keys.
|
|
641
|
+
* Sent when synthesis fails for that item (e.g. resolve failure, exception).
|
|
653
642
|
*/
|
|
654
643
|
200: {
|
|
655
644
|
headers: {
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,6 @@ export type { RecommendationsRequest, RecommendationsResponse } from './user/rec
|
|
|
14
14
|
export type { ProfileResponse } from './user/profile.js';
|
|
15
15
|
export type { ReportRequest, ReportResponse } from './user/report.js';
|
|
16
16
|
export type { TokenRequest, TokenResponse } from './user/token.js';
|
|
17
|
-
export type { SynthesizeRequest } from './user/typeDefs.js';
|
|
18
|
-
export type { SynthesizeEvent } from './user/synthesize.js';
|
|
17
|
+
export type { BitBitPressSynthesizeRequest, RecommendationsRequestBody, SynthesizeInput, SynthesizeItem, SynthesizeItems, SynthesizeOutputSchema, SynthesizeRequest, } from './user/typeDefs.js';
|
|
18
|
+
export type { SynthesizeEvent, SynthesizeItemResponse } from './user/synthesize.js';
|
|
19
19
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,YAAY,EACV,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,yBAAyB,EACzB,WAAW,EACX,QAAQ,GACT,MAAM,cAAc,CAAC;AAGtB,mBAAmB,wBAAwB,CAAC;AAG5C,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC9E,YAAY,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACjG,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACtE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACnE,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,YAAY,EACV,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,yBAAyB,EACzB,WAAW,EACX,QAAQ,GACT,MAAM,cAAc,CAAC;AAGtB,mBAAmB,wBAAwB,CAAC;AAG5C,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC9E,YAAY,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACjG,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACtE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACnE,YAAY,EACV,4BAA4B,EAC5B,0BAA0B,EAC1B,eAAe,EACf,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { RequestConfig } from '../request.js';
|
|
2
|
-
import
|
|
2
|
+
import { SynthesizeItemResponse } from './synthesize.js';
|
|
3
|
+
import type { SynthesizeItem } from './typeDefs.js';
|
|
3
4
|
/**
|
|
4
5
|
* Batch manager for synthesizeItem
|
|
5
6
|
* Resolves each item individually based on its index in the response
|
|
@@ -7,14 +8,14 @@ import type { SynthesizeRequest } from './typeDefs.js';
|
|
|
7
8
|
export declare class SynthesizeBatchManager {
|
|
8
9
|
private queue;
|
|
9
10
|
private timer;
|
|
10
|
-
private
|
|
11
|
+
private getConfig;
|
|
11
12
|
private batchTimeout;
|
|
12
|
-
constructor(
|
|
13
|
+
constructor(getConfig: () => Promise<RequestConfig>, batchTimeout: number);
|
|
13
14
|
/**
|
|
14
|
-
* Update the
|
|
15
|
+
* Update the config getter (e.g., when token refresh logic changes)
|
|
15
16
|
*/
|
|
16
17
|
updateConfig(config: RequestConfig): void;
|
|
17
|
-
addItem(item:
|
|
18
|
+
addItem(item: SynthesizeItem): Promise<SynthesizeItemResponse>;
|
|
18
19
|
private flush;
|
|
19
20
|
}
|
|
20
21
|
//# sourceMappingURL=batch-manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batch-manager.d.ts","sourceRoot":"","sources":["../../src/user/batch-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"batch-manager.d.ts","sourceRoot":"","sources":["../../src/user/batch-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAwB,sBAAsB,EAAc,MAAM,iBAAiB,CAAC;AAC3F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAkBpD;;;GAGG;AACH,qBAAa,sBAAsB;IACjC,OAAO,CAAC,KAAK,CAIL;IACR,OAAO,CAAC,KAAK,CAAsB;IACnC,OAAO,CAAC,SAAS,CAA+B;IAChD,OAAO,CAAC,YAAY,CAAS;gBAEjB,SAAS,EAAE,MAAM,OAAO,CAAC,aAAa,CAAC,EAAE,YAAY,EAAE,MAAM;IAKzE;;OAEG;IACH,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;IAIzC,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,sBAAsB,CAAC;YAehD,KAAK;CAyBpB"}
|