@talqing/sdk 0.4.2 → 0.4.4

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.
@@ -652,6 +652,10 @@ export type AvatarCatalogEntryResponse = {
652
652
  * Label
653
653
  */
654
654
  label: string | null;
655
+ /**
656
+ * Logo Url
657
+ */
658
+ logo_url: string | null;
655
659
  /**
656
660
  * Model
657
661
  */
@@ -2646,7 +2650,9 @@ export type CreateEmailBatchRequest = {
2646
2650
  *
2647
2651
  * Send these rows. **This is the call that mails real people.**
2648
2652
  *
2649
- * Name ``recipient_ids`` or pass ``selection: "all_drafts"``. Everything else
2653
+ * ``scope: "selected"`` sends exactly ``recipient_ids``. ``scope: "all"`` is a
2654
+ * standing send: every row of the batch as it reaches `draft`, including rows
2655
+ * not drafted yet — so it mails drafts nobody has read. Everything else
2650
2656
  * defaults to the batch's own setting; ``window`` and ``send_daily_cap`` accept
2651
2657
  * an explicit ``null`` to mean "no window" and "uncapped" rather than
2652
2658
  * "inherit", so the service reads ``model_fields_set``.
@@ -2671,9 +2677,11 @@ export type CreateEmailSendRequest = {
2671
2677
  */
2672
2678
  reply_to?: string | null;
2673
2679
  /**
2674
- * Selection
2680
+ * Scope
2681
+ *
2682
+ * `selected` sends `recipient_ids`; `all` sends every row as it is drafted.
2675
2683
  */
2676
- selection?: 'all_drafts' | null;
2684
+ scope: 'all' | 'selected';
2677
2685
  /**
2678
2686
  * Send Attempts
2679
2687
  */
@@ -3206,6 +3214,22 @@ export type DeliveryResultResponse = {
3206
3214
  webhook_id: string;
3207
3215
  };
3208
3216
 
3217
+ /**
3218
+ * DraftFailure
3219
+ *
3220
+ * One reason drafts failed, and how many rows it holds.
3221
+ */
3222
+ export type DraftFailure = {
3223
+ /**
3224
+ * Count
3225
+ */
3226
+ count: number;
3227
+ /**
3228
+ * Reason
3229
+ */
3230
+ reason: string;
3231
+ };
3232
+
3209
3233
  /**
3210
3234
  * DraftedVersion
3211
3235
  *
@@ -3228,6 +3252,9 @@ export type DraftedVersion = {
3228
3252
 
3229
3253
  /**
3230
3254
  * EmailBatchCounts
3255
+ *
3256
+ * Rows by the status a reader sees. `draft` is drafts no live send covers
3257
+ * yet; `queued` is drafts one does.
3231
3258
  */
3232
3259
  export type EmailBatchCounts = {
3233
3260
  /**
@@ -3297,6 +3324,10 @@ export type EmailBatchResponse = {
3297
3324
  * Draft Concurrency
3298
3325
  */
3299
3326
  draft_concurrency: number;
3327
+ /**
3328
+ * Draft Failures
3329
+ */
3330
+ draft_failures: Array<DraftFailure>;
3300
3331
  /**
3301
3332
  * Draft Gap Seconds
3302
3333
  */
@@ -3390,10 +3421,15 @@ export type EmailBatchResponse = {
3390
3421
  * Sent Today
3391
3422
  */
3392
3423
  sent_today: number;
3424
+ skips: EmailBatchSkips;
3393
3425
  /**
3394
3426
  * Stale Redraftable
3395
3427
  */
3396
3428
  stale_redraftable: number;
3429
+ /**
3430
+ * Stale Sent
3431
+ */
3432
+ stale_sent: number;
3397
3433
  /**
3398
3434
  * Start At
3399
3435
  */
@@ -3421,6 +3457,26 @@ export type EmailBatchResponse = {
3421
3457
  window: TimeWindow | null;
3422
3458
  };
3423
3459
 
3460
+ /**
3461
+ * EmailBatchSkips
3462
+ *
3463
+ * `counts.skipped`, by who decided it.
3464
+ */
3465
+ export type EmailBatchSkips = {
3466
+ /**
3467
+ * Duplicate Recipient
3468
+ */
3469
+ duplicate_recipient: number;
3470
+ /**
3471
+ * Operator
3472
+ */
3473
+ operator: number;
3474
+ /**
3475
+ * Unfillable
3476
+ */
3477
+ unfillable: number;
3478
+ };
3479
+
3424
3480
  /**
3425
3481
  * EmailRecipientInput
3426
3482
  *
@@ -3513,11 +3569,11 @@ export type EmailRecipientResponse = {
3513
3569
  /**
3514
3570
  * Skip Reason
3515
3571
  */
3516
- skip_reason: string | null;
3572
+ skip_reason: 'operator' | 'duplicate_recipient' | 'unfillable' | null;
3517
3573
  /**
3518
3574
  * Status
3519
3575
  */
3520
- status: 'pending' | 'drafting' | 'draft' | 'draft_failed' | 'skipped' | 'queued' | 'sending' | 'sent' | 'send_failed';
3576
+ status: 'pending' | 'drafting' | 'draft' | 'draft_failed' | 'skipped' | 'sending' | 'sent' | 'send_failed' | 'queued' | 'canceled';
3521
3577
  /**
3522
3578
  * Task Run Id
3523
3579
  */
@@ -3541,19 +3597,20 @@ export type EmailRecipientResponse = {
3541
3597
  *
3542
3598
  * Where this send's rows are.
3543
3599
  *
3544
- * ``total`` is what the send was created with and never changes — a send's row
3545
- * set is immutable — so ``returned`` is what is left once every other bucket is
3546
- * accounted for: the rows a cancel or a failure handed back as drafts.
3600
+ * ``total`` is the rows a `selected` send was created with, and null for an
3601
+ * `all` send, which cannot know it while drafting runs. ``queued`` and
3602
+ * ``drafting`` are what it still covers — drafts ready to go, and rows still
3603
+ * being written — so both are 0 once it has ended.
3547
3604
  */
3548
3605
  export type EmailSendCounts = {
3549
3606
  /**
3550
- * Queued
3607
+ * Drafting
3551
3608
  */
3552
- queued: number;
3609
+ drafting: number;
3553
3610
  /**
3554
- * Returned
3611
+ * Queued
3555
3612
  */
3556
- returned: number;
3613
+ queued: number;
3557
3614
  /**
3558
3615
  * Send Failed
3559
3616
  */
@@ -3573,7 +3630,7 @@ export type EmailSendCounts = {
3573
3630
  /**
3574
3631
  * Total
3575
3632
  */
3576
- total: number;
3633
+ total: number | null;
3577
3634
  };
3578
3635
 
3579
3636
  /**
@@ -3616,11 +3673,15 @@ export type EmailSendResponse = {
3616
3673
  /**
3617
3674
  * Next Send Reason
3618
3675
  */
3619
- next_send_reason: 'start' | 'window' | 'daily_cap' | 'retry' | 'gap' | null;
3676
+ next_send_reason: 'start' | 'window' | 'daily_cap' | 'retry' | 'gap' | 'drafting' | null;
3620
3677
  /**
3621
3678
  * Reply To
3622
3679
  */
3623
3680
  reply_to: string | null;
3681
+ /**
3682
+ * Scope
3683
+ */
3684
+ scope: 'all' | 'selected';
3624
3685
  /**
3625
3686
  * Send Attempts
3626
3687
  */
@@ -4013,7 +4074,12 @@ export type HandoffTarget = {
4013
4074
  * Liveness of the API process itself.
4014
4075
  */
4015
4076
  export type HealthResponse = {
4016
- model_registry?: ModelRegistryHealth | null;
4077
+ /**
4078
+ * Model Registry
4079
+ */
4080
+ model_registry?: {
4081
+ [key: string]: ModelRegistryHealth;
4082
+ } | null;
4017
4083
  /**
4018
4084
  * Status
4019
4085
  */
@@ -5354,6 +5420,10 @@ export type LLMCatalogEntryResponse = {
5354
5420
  * Label
5355
5421
  */
5356
5422
  label: string | null;
5423
+ /**
5424
+ * Logo Url
5425
+ */
5426
+ logo_url: string | null;
5357
5427
  /**
5358
5428
  * Model
5359
5429
  */
@@ -5384,6 +5454,31 @@ export type LLMCatalogEntryResponse = {
5384
5454
  [key: string]: unknown;
5385
5455
  };
5386
5456
 
5457
+ /**
5458
+ * LLMModelSearchResponse
5459
+ *
5460
+ * One page of a searched provider's language models — never the whole
5461
+ * registry.
5462
+ *
5463
+ * Ordered by real-world popularity when `q` is empty (OpenRouter ranks its own
5464
+ * list by tokens processed, so the first screen is the models people actually
5465
+ * run) and by match quality when it is not, popularity breaking the ties.
5466
+ */
5467
+ export type LLMModelSearchResponse = {
5468
+ /**
5469
+ * Kind
5470
+ */
5471
+ kind: 'llm';
5472
+ /**
5473
+ * Models
5474
+ */
5475
+ models: Array<LLMCatalogEntryResponse>;
5476
+ /**
5477
+ * Next Cursor
5478
+ */
5479
+ next_cursor: string | null;
5480
+ };
5481
+
5387
5482
  /**
5388
5483
  * LLMModelSpec
5389
5484
  */
@@ -5392,6 +5487,12 @@ export type LLMModelSpec = {
5392
5487
  * Builtin Tools
5393
5488
  */
5394
5489
  builtin_tools?: Array<BuiltinToolSpec>;
5490
+ /**
5491
+ * Hosts
5492
+ *
5493
+ * OpenRouter only: the hosts allowed to serve this model, from list_model_hosts; the fastest of them answers. Unset lets OpenRouter use any host.
5494
+ */
5495
+ hosts?: Array<string> | null;
5395
5496
  /**
5396
5497
  * Model
5397
5498
  */
@@ -5424,6 +5525,12 @@ export type LLMModelSpecOverride = {
5424
5525
  * Builtin Tools
5425
5526
  */
5426
5527
  builtin_tools?: Array<BuiltinToolSpec> | null;
5528
+ /**
5529
+ * Hosts
5530
+ *
5531
+ * OpenRouter only: the hosts allowed to serve this model, from list_model_hosts; the fastest of them answers. Unset lets OpenRouter use any host.
5532
+ */
5533
+ hosts?: Array<string> | null;
5427
5534
  /**
5428
5535
  * Model
5429
5536
  */
@@ -5528,6 +5635,12 @@ export type LLMSpec = {
5528
5635
  */
5529
5636
  builtin_tools?: Array<BuiltinToolSpec>;
5530
5637
  fallback?: LLMModelSpec | null;
5638
+ /**
5639
+ * Hosts
5640
+ *
5641
+ * OpenRouter only: the hosts allowed to serve this model, from list_model_hosts; the fastest of them answers. Unset lets OpenRouter use any host.
5642
+ */
5643
+ hosts?: Array<string> | null;
5531
5644
  /**
5532
5645
  * Model
5533
5646
  */
@@ -5561,6 +5674,12 @@ export type LLMSpecOverride = {
5561
5674
  */
5562
5675
  builtin_tools?: Array<BuiltinToolSpec> | null;
5563
5676
  fallback?: LLMModelSpecOverride | null;
5677
+ /**
5678
+ * Hosts
5679
+ *
5680
+ * OpenRouter only: the hosts allowed to serve this model, from list_model_hosts; the fastest of them answers. Unset lets OpenRouter use any host.
5681
+ */
5682
+ hosts?: Array<string> | null;
5564
5683
  /**
5565
5684
  * Model
5566
5685
  */
@@ -5715,6 +5834,65 @@ export type McpSelection = {
5715
5834
  mcp?: InlineMcpServer | null;
5716
5835
  };
5717
5836
 
5837
+ /**
5838
+ * ModelHostResponse
5839
+ *
5840
+ * One endpoint that can serve an OpenRouter language model.
5841
+ */
5842
+ export type ModelHostResponse = {
5843
+ /**
5844
+ * All Endpoints
5845
+ */
5846
+ all_endpoints: boolean;
5847
+ /**
5848
+ * Context Length
5849
+ */
5850
+ context_length: number | null;
5851
+ /**
5852
+ * Host
5853
+ */
5854
+ host: string;
5855
+ /**
5856
+ * Latency P50 Ms
5857
+ */
5858
+ latency_p50_ms: number | null;
5859
+ /**
5860
+ * Logo Url
5861
+ */
5862
+ logo_url: string | null;
5863
+ /**
5864
+ * Name
5865
+ */
5866
+ name: string;
5867
+ pricing: LLMPricing;
5868
+ /**
5869
+ * Quantization
5870
+ */
5871
+ quantization: string | null;
5872
+ /**
5873
+ * Throughput P50
5874
+ */
5875
+ throughput_p50: number | null;
5876
+ /**
5877
+ * Uptime 30M
5878
+ */
5879
+ uptime_30m: number | null;
5880
+ };
5881
+
5882
+ /**
5883
+ * ModelHostsResponse
5884
+ */
5885
+ export type ModelHostsResponse = {
5886
+ /**
5887
+ * Hosts
5888
+ */
5889
+ hosts: Array<ModelHostResponse>;
5890
+ /**
5891
+ * Model
5892
+ */
5893
+ model: string;
5894
+ };
5895
+
5718
5896
  /**
5719
5897
  * ModelMetadata
5720
5898
  *
@@ -5735,7 +5913,7 @@ export type ModelMetadata = {
5735
5913
  /**
5736
5914
  * ModelRegistryHealth
5737
5915
  *
5738
- * How fresh this process's searched-provider model list is.
5916
+ * How fresh one kind of this process's searched-provider model list is.
5739
5917
  *
5740
5918
  * A silently stale registry is the one failure this design trades for
5741
5919
  * freshness — a refresh that keeps failing holds the last good snapshot
@@ -5758,26 +5936,6 @@ export type ModelRegistryHealth = {
5758
5936
  models: number;
5759
5937
  };
5760
5938
 
5761
- /**
5762
- * ModelSearchResponse
5763
- *
5764
- * One page of a searched provider's models — never the whole registry.
5765
- *
5766
- * Ordered by real-world popularity when `q` is empty (OpenRouter ranks its own
5767
- * list by tokens processed, so the first screen is the models people actually
5768
- * run) and by match quality when it is not, popularity breaking the ties.
5769
- */
5770
- export type ModelSearchResponse = {
5771
- /**
5772
- * Models
5773
- */
5774
- models: Array<LLMCatalogEntryResponse>;
5775
- /**
5776
- * Next Cursor
5777
- */
5778
- next_cursor: string | null;
5779
- };
5780
-
5781
5939
  /**
5782
5940
  * NodeContentResponse
5783
5941
  */
@@ -5828,6 +5986,10 @@ export type NoiseCancellationCatalogEntryResponse = {
5828
5986
  * Label
5829
5987
  */
5830
5988
  label: string | null;
5989
+ /**
5990
+ * Logo Url
5991
+ */
5992
+ logo_url: string | null;
5831
5993
  /**
5832
5994
  * Model
5833
5995
  */
@@ -7364,11 +7526,10 @@ export type PatchEmailRecipientRequest = {
7364
7526
  *
7365
7527
  * Re-steer one send: its pacing, its hours, its ceiling, its start time.
7366
7528
  *
7367
- * It never edits the sender, and it never edits the row set in either
7368
- * direction. To change what a scheduled send contains, cancel it — every unsent
7369
- * row comes back as a draft — and create another. A second way to move a row
7370
- * out of a send would be a second state machine to keep correct for something
7371
- * cancel already covers.
7529
+ * Never its sender and never its scope — "re-steer the pacing, never the
7530
+ * contents". Widening a send is another send; narrowing one has no defensible
7531
+ * answer to "which rows does it keep?". To change what a send covers, cancel it
7532
+ * — its unsent rows simply stay drafts — and create another.
7372
7533
  */
7373
7534
  export type PatchEmailSendRequest = {
7374
7535
  /**
@@ -7950,6 +8111,10 @@ export type ProviderEntryResponse = {
7950
8111
  * Logo Url
7951
8112
  */
7952
8113
  logo_url: string;
8114
+ /**
8115
+ * Searched Kinds
8116
+ */
8117
+ searched_kinds: Array<'llm' | 'stt'>;
7953
8118
  };
7954
8119
 
7955
8120
  /**
@@ -8180,6 +8345,10 @@ export type RealtimeCatalogEntryResponse = {
8180
8345
  * Languages
8181
8346
  */
8182
8347
  languages: Array<LanguageOption>;
8348
+ /**
8349
+ * Logo Url
8350
+ */
8351
+ logo_url: string | null;
8183
8352
  /**
8184
8353
  * Model
8185
8354
  */
@@ -8206,6 +8375,10 @@ export type RealtimeCatalogEntryResponse = {
8206
8375
  * Speed Min
8207
8376
  */
8208
8377
  speed_min: number;
8378
+ /**
8379
+ * Supports Instruction Update
8380
+ */
8381
+ supports_instruction_update: boolean;
8209
8382
  /**
8210
8383
  * Supports Speed
8211
8384
  */
@@ -8599,11 +8772,10 @@ export type RecordingState = 'none' | 'available' | 'pending' | 'expired' | 'fai
8599
8772
  * Four selections, and they differ in what they REFUSE as much as in what they
8600
8773
  * move, because a redraft discards a draft the tenant has already paid for:
8601
8774
  *
8602
- * - ``all`` — every row in the batch. Rows already sent or queued come back in
8775
+ * - ``all`` — every row in the batch. Rows already sent or mid-send come back in
8603
8776
  * ``rejected``, by name, so a bulk press cannot quietly do less than it said.
8604
8777
  * - ``failed`` — rows whose drafting failed.
8605
- * - ``not_sent`` — every row that has not left and is not about to, with
8606
- * nothing rejected.
8778
+ * - ``not_sent`` — every row that has not left, with nothing rejected.
8607
8779
  * - ``stale_version`` — rows drafted by a task version older than the one
8608
8780
  * published now. The selection that makes "watch the output, improve the
8609
8781
  * task, publish, redraft the rest" a workflow rather than a wish.
@@ -8839,6 +9011,10 @@ export type STTCatalogEntryResponse = {
8839
9011
  * Languages
8840
9012
  */
8841
9013
  languages: Array<LanguageOption>;
9014
+ /**
9015
+ * Logo Url
9016
+ */
9017
+ logo_url: string | null;
8842
9018
  /**
8843
9019
  * Model
8844
9020
  */
@@ -8864,6 +9040,27 @@ export type STTCatalogEntryResponse = {
8864
9040
  [key: string]: unknown;
8865
9041
  };
8866
9042
 
9043
+ /**
9044
+ * STTModelSearchResponse
9045
+ *
9046
+ * One page of a searched provider's speech-to-text models, ordered as the
9047
+ * provider lists them.
9048
+ */
9049
+ export type STTModelSearchResponse = {
9050
+ /**
9051
+ * Kind
9052
+ */
9053
+ kind: 'stt';
9054
+ /**
9055
+ * Models
9056
+ */
9057
+ models: Array<STTCatalogEntryResponse>;
9058
+ /**
9059
+ * Next Cursor
9060
+ */
9061
+ next_cursor: string | null;
9062
+ };
9063
+
8867
9064
  /**
8868
9065
  * STTModelSpec
8869
9066
  */
@@ -8926,6 +9123,10 @@ export type STTPriceLine = {
8926
9123
  * Provider
8927
9124
  */
8928
9125
  provider: string;
9126
+ /**
9127
+ * Provider Reported
9128
+ */
9129
+ provider_reported: boolean;
8929
9130
  rates: STTPricing | null;
8930
9131
  };
8931
9132
 
@@ -9003,6 +9204,10 @@ export type STTUsage = {
9003
9204
  * Provider
9004
9205
  */
9005
9206
  provider: string;
9207
+ /**
9208
+ * Reported Cost
9209
+ */
9210
+ reported_cost: string | null;
9006
9211
  };
9007
9212
 
9008
9213
  /**
@@ -9119,7 +9324,7 @@ export type SelectRecipientsRequest = {
9119
9324
  /**
9120
9325
  * Selection
9121
9326
  *
9122
- * Every row this verb can act on: `draft` for skip, `skipped` for restore.
9327
+ * Every row this verb can act on: drafts for skip, rows a person skipped for restore.
9123
9328
  */
9124
9329
  selection?: 'all_eligible' | null;
9125
9330
  };
@@ -9561,6 +9766,10 @@ export type TTSCatalogEntryResponse = {
9561
9766
  * Languages
9562
9767
  */
9563
9768
  languages: Array<LanguageOption>;
9769
+ /**
9770
+ * Logo Url
9771
+ */
9772
+ logo_url: string | null;
9564
9773
  /**
9565
9774
  * Model
9566
9775
  */
@@ -13370,6 +13579,10 @@ export type CatalogModelsSearchData = {
13370
13579
  * Cursor
13371
13580
  */
13372
13581
  cursor?: string;
13582
+ /**
13583
+ * Kind
13584
+ */
13585
+ kind?: 'llm' | 'stt';
13373
13586
  };
13374
13587
  url: '/v1/catalog/models';
13375
13588
  };
@@ -13393,13 +13606,57 @@ export type CatalogModelsSearchError = CatalogModelsSearchErrors[keyof CatalogMo
13393
13606
 
13394
13607
  export type CatalogModelsSearchResults = {
13395
13608
  /**
13609
+ * Response Catalog.Models.Search
13610
+ *
13396
13611
  * Successful Response
13397
13612
  */
13398
- 200: ModelSearchResponse;
13613
+ 200: ({
13614
+ kind: 'llm';
13615
+ } & LLMModelSearchResponse) | ({
13616
+ kind: 'stt';
13617
+ } & STTModelSearchResponse);
13399
13618
  };
13400
13619
 
13401
13620
  export type CatalogModelsSearchResult = CatalogModelsSearchResults[keyof CatalogModelsSearchResults];
13402
13621
 
13622
+ export type CatalogModelsHostsData = {
13623
+ body?: never;
13624
+ path?: never;
13625
+ query: {
13626
+ /**
13627
+ * Model
13628
+ */
13629
+ model: string;
13630
+ };
13631
+ url: '/v1/catalog/models/hosts';
13632
+ };
13633
+
13634
+ export type CatalogModelsHostsErrors = {
13635
+ /**
13636
+ * Missing credential, or one that is revoked or no longer a member of this organization.
13637
+ */
13638
+ 401: ErrorResponse;
13639
+ /**
13640
+ * The request did not match this operation's schema; `detail.errors` lists each field.
13641
+ */
13642
+ 422: ErrorResponse;
13643
+ /**
13644
+ * Unexpected error. Every error this API returns carries this body.
13645
+ */
13646
+ default: ErrorResponse;
13647
+ };
13648
+
13649
+ export type CatalogModelsHostsError = CatalogModelsHostsErrors[keyof CatalogModelsHostsErrors];
13650
+
13651
+ export type CatalogModelsHostsResults = {
13652
+ /**
13653
+ * Successful Response
13654
+ */
13655
+ 200: ModelHostsResponse;
13656
+ };
13657
+
13658
+ export type CatalogModelsHostsResult = CatalogModelsHostsResults[keyof CatalogModelsHostsResults];
13659
+
13403
13660
  export type CatalogVoicesListData = {
13404
13661
  body?: never;
13405
13662
  path?: never;