@inferencesh/sdk 0.20.1 → 0.21.0

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.
@@ -3,12 +3,8 @@
3
3
  * This is the NDJSON alternative to SSE/EventSource that avoids
4
4
  * the browser's ~6 connection limit per domain.
5
5
  */
6
- /**
7
- * Stream NDJSON from an HTTP endpoint using fetch + ReadableStream.
8
- * Yields parsed JSON objects, automatically filtering heartbeats.
9
- */
10
- export async function* streamable(url, options = {}) {
11
- const { headers = {}, body, method = body ? 'POST' : 'GET', signal, skipHeartbeats = true, credentials, } = options;
6
+ /** Send the stream's request and hand back the body to read. */
7
+ async function openStream(source, { headers = {}, body, method = body ? 'POST' : 'GET', signal, credentials }) {
12
8
  const requestHeaders = {
13
9
  Accept: 'application/x-ndjson',
14
10
  ...headers,
@@ -16,13 +12,13 @@ export async function* streamable(url, options = {}) {
16
12
  if (body) {
17
13
  requestHeaders['Content-Type'] = 'application/json';
18
14
  }
19
- const res = await fetch(url, {
15
+ const init = {
20
16
  method,
21
17
  headers: requestHeaders,
22
18
  body: body ? JSON.stringify(body) : undefined,
23
19
  signal,
24
- credentials,
25
- });
20
+ };
21
+ const res = typeof source === 'string' ? await fetch(source, { ...init, credentials }) : await source(init);
26
22
  if (!res.ok) {
27
23
  const text = await res.text();
28
24
  throw new Error(`HTTP ${res.status}: ${text}`);
@@ -30,7 +26,16 @@ export async function* streamable(url, options = {}) {
30
26
  if (!res.body) {
31
27
  throw new Error('No response body');
32
28
  }
33
- const reader = res.body.getReader();
29
+ return res.body;
30
+ }
31
+ /**
32
+ * Stream NDJSON from an HTTP endpoint using fetch + ReadableStream.
33
+ * Yields parsed JSON objects, automatically filtering heartbeats.
34
+ * `source` is the URL to fetch, or a StreamRequest that sends the request.
35
+ */
36
+ export async function* streamable(source, options = {}) {
37
+ const { skipHeartbeats = true } = options;
38
+ const reader = (await openStream(source, options)).getReader();
34
39
  const decoder = new TextDecoder();
35
40
  let buffer = '';
36
41
  try {
@@ -109,12 +114,16 @@ export class StreamableManager {
109
114
  this.abortController = new AbortController();
110
115
  try {
111
116
  this.options.onStart?.();
112
- for await (const message of streamableRaw(this.options.url, {
113
- headers: this.options.headers,
114
- body: this.options.body,
115
- signal: this.abortController.signal,
116
- credentials: this.options.credentials,
117
- })) {
117
+ const { options } = this;
118
+ const stream = 'request' in options
119
+ ? streamableRaw(options.request, { body: options.body, signal: this.abortController.signal })
120
+ : streamableRaw(options.url, {
121
+ headers: options.headers,
122
+ body: options.body,
123
+ signal: this.abortController.signal,
124
+ credentials: options.credentials,
125
+ });
126
+ for await (const message of stream) {
118
127
  if (!this.isRunning)
119
128
  break;
120
129
  const wrapper = message;
@@ -179,30 +188,9 @@ export class StreamableManager {
179
188
  * Raw streamable that yields the full message including wrapper.
180
189
  * Use this when you need access to event type or fields.
181
190
  */
182
- export async function* streamableRaw(url, options = {}) {
183
- const { headers = {}, body, method = body ? 'POST' : 'GET', signal, skipHeartbeats = true, credentials, } = options;
184
- const requestHeaders = {
185
- Accept: 'application/x-ndjson',
186
- ...headers,
187
- };
188
- if (body) {
189
- requestHeaders['Content-Type'] = 'application/json';
190
- }
191
- const res = await fetch(url, {
192
- method,
193
- headers: requestHeaders,
194
- body: body ? JSON.stringify(body) : undefined,
195
- signal,
196
- credentials,
197
- });
198
- if (!res.ok) {
199
- const text = await res.text();
200
- throw new Error(`HTTP ${res.status}: ${text}`);
201
- }
202
- if (!res.body) {
203
- throw new Error('No response body');
204
- }
205
- const reader = res.body.getReader();
191
+ export async function* streamableRaw(source, options = {}) {
192
+ const { skipHeartbeats = true } = options;
193
+ const reader = (await openStream(source, options)).getReader();
206
194
  const decoder = new TextDecoder();
207
195
  let buffer = '';
208
196
  try {
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- export { HttpClient, type HttpClientConfig, type ErrorHandler, type MessageHandler, createHttpClient } from './http/client';
1
+ export { HttpClient, type HttpClientConfig, type ErrorHandler, type FailedRequest, type HttpFetchInit, type MessageHandler, createHttpClient } from './http/client';
2
2
  export type { Response } from './http/response';
3
3
  import type { Response } from './http/response';
4
4
  export { StreamManager, type StreamManagerOptions, type PartialDataWrapper } from './http/stream';
5
- export { StreamableManager, type StreamableManagerOptions, type StreamableMessage, streamable, streamableRaw } from './http/streamable';
5
+ export { StreamableManager, type StreamableManagerOptions, type StreamableSource, type StreamRequest, type StreamRequestInit, type StreamableMessage, streamable, streamableRaw } from './http/streamable';
6
6
  export { PollManager, type PollManagerOptions } from './http/poll';
7
7
  export { InferenceError, RequirementsNotMetException, SessionError, SessionNotFoundError, SessionExpiredError, SessionEndedError, WorkerLostError, isRequirementsNotMetException, isInferenceError, isSessionError, } from './http/errors';
8
8
  export { TasksAPI, type RunOptions, type WatchOptions, type TaskWatch } from './api/tasks';
package/dist/types.d.ts CHANGED
@@ -1227,8 +1227,9 @@ export interface AppDTO extends BaseModelDTO, PermissionModelDTO {
1227
1227
  category: AppCategory;
1228
1228
  images: AppImages;
1229
1229
  /**
1230
- * Tags name what the app does and its traits, as lowercase slugs. Known
1231
- * slugs are the shared.AppTag constants; others are free-form.
1230
+ * Tags name what the app does and its traits, as lowercase slugs
1231
+ * (text-to-image, open-weights). GET /store/tags lists the ones in use
1232
+ * with their titles.
1232
1233
  */
1233
1234
  tags: string[];
1234
1235
  version_id: string;
@@ -2438,7 +2439,7 @@ export interface DecideEntitlementRequestRequest {
2438
2439
  * and APIError.Code on the legacy envelope. Clients branch on these, so a
2439
2440
  * code is a named const here, where it generates into models and the SDKs.
2440
2441
  */
2441
- export type ErrorCode = "invalid_request" | "validation_error" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "name_conflict" | "already_exists" | "not_configured" | "method_not_allowed" | "rate_limited" | "internal_error" | "team_role_required" | "blocked_by_usage_policy" | "last_owner" | "account_deactivated" | "account_banned" | "person_required" | "otp_required" | "mcp_auth_expired" | "limit_exceeded" | "feature_not_available" | "entitlement_unavailable" | "payment_required" | "payment_method_required" | "form_closed" | "already_submitted" | "already_claimed" | "already_entitled" | "request_open" | "agents_disabled" | "remote_offline" | "remote_timeout" | "harness_not_drivable" | "harness_too_old";
2442
+ export type ErrorCode = "invalid_request" | "validation_error" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "name_conflict" | "already_exists" | "not_configured" | "method_not_allowed" | "rate_limited" | "internal_error" | "team_role_required" | "blocked_by_usage_policy" | "last_owner" | "account_deactivated" | "account_banned" | "person_required" | "otp_required" | "impersonation_reason_required" | "mcp_auth_expired" | "limit_exceeded" | "feature_not_available" | "entitlement_unavailable" | "payment_required" | "payment_method_required" | "form_closed" | "already_submitted" | "already_claimed" | "already_entitled" | "request_open" | "agents_disabled" | "remote_offline" | "remote_timeout" | "harness_not_drivable" | "harness_too_old";
2442
2443
  export declare const ErrorCodeInvalidRequest: ErrorCode;
2443
2444
  export declare const ErrorCodeValidationError: ErrorCode;
2444
2445
  export declare const ErrorCodeUnauthorized: ErrorCode;
@@ -2482,6 +2483,12 @@ export declare const ErrorCodeAccountBanned: ErrorCode;
2482
2483
  */
2483
2484
  export declare const ErrorCodePersonRequired: ErrorCode;
2484
2485
  export declare const ErrorCodeOTPRequired: ErrorCode;
2486
+ /**
2487
+ * ErrorCodeImpersonationReasonRequired (403): a platform admin named a
2488
+ * team they are not a member of without a live impersonation grant.
2489
+ * Clients stop viewing as the team on it.
2490
+ */
2491
+ export declare const ErrorCodeImpersonationReasonRequired: ErrorCode;
2485
2492
  export declare const ErrorCodeMCPAuthExpired: ErrorCode;
2486
2493
  /**
2487
2494
  * Entitlements. LimitExceeded (402) and FeatureNotAvailable (403) carry
@@ -4088,6 +4095,23 @@ export interface StatBuckets {
4088
4095
  this_week: number;
4089
4096
  all_time: number;
4090
4097
  }
4098
+ export interface StoreCategoryDTO {
4099
+ slug: string;
4100
+ name: string;
4101
+ description: string;
4102
+ icon: string;
4103
+ rank: number;
4104
+ count: number;
4105
+ }
4106
+ /**
4107
+ * StoreTagDTO is one app tag the store lists: a tag at least
4108
+ * shared.MinAppsPerListedTag public apps carry.
4109
+ */
4110
+ export interface StoreTagDTO {
4111
+ slug: string;
4112
+ title: string;
4113
+ count: number;
4114
+ }
4091
4115
  /**
4092
4116
  * SubscriptionDTO for API responses
4093
4117
  */
@@ -4857,269 +4881,6 @@ export declare const AppCategoryFlow: AppCategory;
4857
4881
  * Decision models: typed questions in, a probability for every answer out, no generation.
4858
4882
  */
4859
4883
  export declare const AppCategoryDecision: AppCategory;
4860
- /**
4861
- * AppTag is a known app tag: a lowercase slug naming a task an app performs
4862
- * (text-to-image) or a trait it has (open-weights). An app's tags are free
4863
- * strings; the ones listed here are the tags clients present by title and
4864
- * build pages for. Each has an AppTagTitle constant with the same suffix.
4865
- */
4866
- export type AppTag = "text-to-image" | "image-to-image" | "image-editing" | "image-upscaling" | "background-removal" | "training" | "lora" | "pbr-materials" | "text-to-video" | "image-to-video" | "reference-to-video" | "video-to-video" | "video-upscaling" | "video-extension" | "video-enhancement" | "lip-sync" | "talking-avatar" | "native-audio" | "text-to-speech" | "speech-to-text" | "voice-cloning" | "voice-design" | "music-generation" | "sound-effects" | "realtime" | "reasoning" | "vision" | "coding" | "open-weights" | "classification" | "moderation" | "routing" | "web-search" | "web-scraping" | "deep-research" | "research-papers" | "social-media" | "messaging" | "productivity" | "media-utilities" | "rendering" | "evaluation";
4867
- /**
4868
- * The list holds tags that at least three public apps carry, so each one
4869
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
4870
- */
4871
- export declare const AppTagTextToImage: AppTag;
4872
- /**
4873
- * The list holds tags that at least three public apps carry, so each one
4874
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
4875
- */
4876
- export declare const AppTagImageToImage: AppTag;
4877
- /**
4878
- * The list holds tags that at least three public apps carry, so each one
4879
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
4880
- */
4881
- export declare const AppTagImageEditing: AppTag;
4882
- /**
4883
- * The list holds tags that at least three public apps carry, so each one
4884
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
4885
- */
4886
- export declare const AppTagImageUpscaling: AppTag;
4887
- /**
4888
- * The list holds tags that at least three public apps carry, so each one
4889
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
4890
- */
4891
- export declare const AppTagBackgroundRemoval: AppTag;
4892
- /**
4893
- * The list holds tags that at least three public apps carry, so each one
4894
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
4895
- */
4896
- export declare const AppTagTraining: AppTag;
4897
- /**
4898
- * The list holds tags that at least three public apps carry, so each one
4899
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
4900
- */
4901
- export declare const AppTagLoRA: AppTag;
4902
- /**
4903
- * The list holds tags that at least three public apps carry, so each one
4904
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
4905
- */
4906
- export declare const AppTagPBRMaterials: AppTag;
4907
- /**
4908
- * The list holds tags that at least three public apps carry, so each one
4909
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
4910
- */
4911
- export declare const AppTagTextToVideo: AppTag;
4912
- /**
4913
- * The list holds tags that at least three public apps carry, so each one
4914
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
4915
- */
4916
- export declare const AppTagImageToVideo: AppTag;
4917
- /**
4918
- * The list holds tags that at least three public apps carry, so each one
4919
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
4920
- */
4921
- export declare const AppTagReferenceToVideo: AppTag;
4922
- /**
4923
- * The list holds tags that at least three public apps carry, so each one
4924
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
4925
- */
4926
- export declare const AppTagVideoToVideo: AppTag;
4927
- /**
4928
- * The list holds tags that at least three public apps carry, so each one
4929
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
4930
- */
4931
- export declare const AppTagVideoUpscaling: AppTag;
4932
- /**
4933
- * The list holds tags that at least three public apps carry, so each one
4934
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
4935
- */
4936
- export declare const AppTagVideoExtension: AppTag;
4937
- /**
4938
- * The list holds tags that at least three public apps carry, so each one
4939
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
4940
- */
4941
- export declare const AppTagVideoEnhancement: AppTag;
4942
- /**
4943
- * The list holds tags that at least three public apps carry, so each one
4944
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
4945
- */
4946
- export declare const AppTagLipSync: AppTag;
4947
- /**
4948
- * The list holds tags that at least three public apps carry, so each one
4949
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
4950
- */
4951
- export declare const AppTagTalkingAvatar: AppTag;
4952
- /**
4953
- * The list holds tags that at least three public apps carry, so each one
4954
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
4955
- */
4956
- export declare const AppTagNativeAudio: AppTag;
4957
- /**
4958
- * The list holds tags that at least three public apps carry, so each one
4959
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
4960
- */
4961
- export declare const AppTagTextToSpeech: AppTag;
4962
- /**
4963
- * The list holds tags that at least three public apps carry, so each one
4964
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
4965
- */
4966
- export declare const AppTagSpeechToText: AppTag;
4967
- /**
4968
- * The list holds tags that at least three public apps carry, so each one
4969
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
4970
- */
4971
- export declare const AppTagVoiceCloning: AppTag;
4972
- /**
4973
- * The list holds tags that at least three public apps carry, so each one
4974
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
4975
- */
4976
- export declare const AppTagVoiceDesign: AppTag;
4977
- /**
4978
- * The list holds tags that at least three public apps carry, so each one
4979
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
4980
- */
4981
- export declare const AppTagMusicGeneration: AppTag;
4982
- /**
4983
- * The list holds tags that at least three public apps carry, so each one
4984
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
4985
- */
4986
- export declare const AppTagSoundEffects: AppTag;
4987
- /**
4988
- * The list holds tags that at least three public apps carry, so each one
4989
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
4990
- */
4991
- export declare const AppTagRealtime: AppTag;
4992
- /**
4993
- * The list holds tags that at least three public apps carry, so each one
4994
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
4995
- */
4996
- export declare const AppTagReasoning: AppTag;
4997
- /**
4998
- * The list holds tags that at least three public apps carry, so each one
4999
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
5000
- */
5001
- export declare const AppTagVision: AppTag;
5002
- /**
5003
- * The list holds tags that at least three public apps carry, so each one
5004
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
5005
- */
5006
- export declare const AppTagCoding: AppTag;
5007
- /**
5008
- * The list holds tags that at least three public apps carry, so each one
5009
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
5010
- */
5011
- export declare const AppTagOpenWeights: AppTag;
5012
- /**
5013
- * The list holds tags that at least three public apps carry, so each one
5014
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
5015
- */
5016
- export declare const AppTagClassification: AppTag;
5017
- /**
5018
- * The list holds tags that at least three public apps carry, so each one
5019
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
5020
- */
5021
- export declare const AppTagModeration: AppTag;
5022
- /**
5023
- * The list holds tags that at least three public apps carry, so each one
5024
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
5025
- */
5026
- export declare const AppTagRouting: AppTag;
5027
- /**
5028
- * The list holds tags that at least three public apps carry, so each one
5029
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
5030
- */
5031
- export declare const AppTagWebSearch: AppTag;
5032
- /**
5033
- * The list holds tags that at least three public apps carry, so each one
5034
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
5035
- */
5036
- export declare const AppTagWebScraping: AppTag;
5037
- /**
5038
- * The list holds tags that at least three public apps carry, so each one
5039
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
5040
- */
5041
- export declare const AppTagDeepResearch: AppTag;
5042
- /**
5043
- * The list holds tags that at least three public apps carry, so each one
5044
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
5045
- */
5046
- export declare const AppTagResearchPapers: AppTag;
5047
- /**
5048
- * The list holds tags that at least three public apps carry, so each one
5049
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
5050
- */
5051
- export declare const AppTagSocialMedia: AppTag;
5052
- /**
5053
- * The list holds tags that at least three public apps carry, so each one
5054
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
5055
- */
5056
- export declare const AppTagMessaging: AppTag;
5057
- /**
5058
- * The list holds tags that at least three public apps carry, so each one
5059
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
5060
- */
5061
- export declare const AppTagProductivity: AppTag;
5062
- /**
5063
- * The list holds tags that at least three public apps carry, so each one
5064
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
5065
- */
5066
- export declare const AppTagMediaUtilities: AppTag;
5067
- /**
5068
- * The list holds tags that at least three public apps carry, so each one
5069
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
5070
- */
5071
- export declare const AppTagRendering: AppTag;
5072
- /**
5073
- * The list holds tags that at least three public apps carry, so each one
5074
- * leads somewhere. A tag on fewer apps stays a plain tag until it does.
5075
- */
5076
- export declare const AppTagEvaluation: AppTag;
5077
- /**
5078
- * AppTagTitle is the display title of a known AppTag.
5079
- */
5080
- export type AppTagTitle = "Text to Image" | "Image to Image" | "Image Editing" | "Image Upscaling" | "Background Removal" | "Model Training" | "LoRA" | "PBR Materials" | "Text to Video" | "Image to Video" | "Reference to Video" | "Video to Video" | "Video Upscaling" | "Video Extension" | "Video Enhancement" | "Lip Sync" | "Talking Avatar" | "Native Audio" | "Text to Speech" | "Speech to Text" | "Voice Cloning" | "Voice Design" | "Music Generation" | "Sound Effects" | "Realtime" | "Reasoning" | "Vision" | "Coding" | "Open Weights" | "Classification" | "Moderation" | "Routing" | "Web Search" | "Web Scraping" | "Deep Research" | "Research Papers" | "Social Media" | "Messaging" | "Productivity" | "Media Utilities" | "Rendering" | "Evaluation";
5081
- export declare const AppTagTitleTextToImage: AppTagTitle;
5082
- export declare const AppTagTitleImageToImage: AppTagTitle;
5083
- export declare const AppTagTitleImageEditing: AppTagTitle;
5084
- export declare const AppTagTitleImageUpscaling: AppTagTitle;
5085
- export declare const AppTagTitleBackgroundRemoval: AppTagTitle;
5086
- export declare const AppTagTitleTraining: AppTagTitle;
5087
- export declare const AppTagTitleLoRA: AppTagTitle;
5088
- export declare const AppTagTitlePBRMaterials: AppTagTitle;
5089
- export declare const AppTagTitleTextToVideo: AppTagTitle;
5090
- export declare const AppTagTitleImageToVideo: AppTagTitle;
5091
- export declare const AppTagTitleReferenceToVideo: AppTagTitle;
5092
- export declare const AppTagTitleVideoToVideo: AppTagTitle;
5093
- export declare const AppTagTitleVideoUpscaling: AppTagTitle;
5094
- export declare const AppTagTitleVideoExtension: AppTagTitle;
5095
- export declare const AppTagTitleVideoEnhancement: AppTagTitle;
5096
- export declare const AppTagTitleLipSync: AppTagTitle;
5097
- export declare const AppTagTitleTalkingAvatar: AppTagTitle;
5098
- export declare const AppTagTitleNativeAudio: AppTagTitle;
5099
- export declare const AppTagTitleTextToSpeech: AppTagTitle;
5100
- export declare const AppTagTitleSpeechToText: AppTagTitle;
5101
- export declare const AppTagTitleVoiceCloning: AppTagTitle;
5102
- export declare const AppTagTitleVoiceDesign: AppTagTitle;
5103
- export declare const AppTagTitleMusicGeneration: AppTagTitle;
5104
- export declare const AppTagTitleSoundEffects: AppTagTitle;
5105
- export declare const AppTagTitleRealtime: AppTagTitle;
5106
- export declare const AppTagTitleReasoning: AppTagTitle;
5107
- export declare const AppTagTitleVision: AppTagTitle;
5108
- export declare const AppTagTitleCoding: AppTagTitle;
5109
- export declare const AppTagTitleOpenWeights: AppTagTitle;
5110
- export declare const AppTagTitleClassification: AppTagTitle;
5111
- export declare const AppTagTitleModeration: AppTagTitle;
5112
- export declare const AppTagTitleRouting: AppTagTitle;
5113
- export declare const AppTagTitleWebSearch: AppTagTitle;
5114
- export declare const AppTagTitleWebScraping: AppTagTitle;
5115
- export declare const AppTagTitleDeepResearch: AppTagTitle;
5116
- export declare const AppTagTitleResearchPapers: AppTagTitle;
5117
- export declare const AppTagTitleSocialMedia: AppTagTitle;
5118
- export declare const AppTagTitleMessaging: AppTagTitle;
5119
- export declare const AppTagTitleProductivity: AppTagTitle;
5120
- export declare const AppTagTitleMediaUtilities: AppTagTitle;
5121
- export declare const AppTagTitleRendering: AppTagTitle;
5122
- export declare const AppTagTitleEvaluation: AppTagTitle;
5123
4884
  export type AppStatus = "active" | "maintenance" | "deprecated" | "retired";
5124
4885
  export declare const AppStatusActive: AppStatus;
5125
4886
  export declare const AppStatusMaintenance: AppStatus;
@@ -5323,6 +5084,148 @@ export interface ChannelContext {
5323
5084
  channel_type?: ChannelType;
5324
5085
  channel_metadata?: any;
5325
5086
  }
5087
+ /**
5088
+ * DecisionChoiceOption is one answer option of a choice question.
5089
+ */
5090
+ export interface DecisionChoiceOption {
5091
+ /**
5092
+ * Name is returned as the choice and keys the probabilities.
5093
+ */
5094
+ name: string;
5095
+ /**
5096
+ * Description says what the option covers.
5097
+ */
5098
+ description?: any;
5099
+ }
5100
+ /**
5101
+ * DecisionChoiceQuestion asks which one of a fixed set of options holds.
5102
+ */
5103
+ export interface DecisionChoiceQuestion {
5104
+ /**
5105
+ * ID is the caller's key for the question; its answer comes back under it.
5106
+ */
5107
+ id: string;
5108
+ instructions: any;
5109
+ options: DecisionChoiceOption[];
5110
+ }
5111
+ /**
5112
+ * DecisionScoreQuestion asks where the state sits on ordered levels.
5113
+ */
5114
+ export interface DecisionScoreQuestion {
5115
+ id: string;
5116
+ instructions: any;
5117
+ /**
5118
+ * Levels are described low end to high end; a level's number is its index.
5119
+ */
5120
+ levels: any[];
5121
+ }
5122
+ /**
5123
+ * DecisionNoulCriteria pins down what yes and no mean for a noul question.
5124
+ */
5125
+ export interface DecisionNoulCriteria {
5126
+ true?: any;
5127
+ false?: any;
5128
+ }
5129
+ /**
5130
+ * DecisionNoulQuestion asks for the probability that something is true.
5131
+ */
5132
+ export interface DecisionNoulQuestion {
5133
+ id: string;
5134
+ instructions: any;
5135
+ criteria?: DecisionNoulCriteria;
5136
+ }
5137
+ /**
5138
+ * DecisionInput is one state and the questions asked of it.
5139
+ */
5140
+ export interface DecisionInput {
5141
+ state: any;
5142
+ choices?: DecisionChoiceQuestion[];
5143
+ scores?: DecisionScoreQuestion[];
5144
+ nouls?: DecisionNoulQuestion[];
5145
+ }
5146
+ /**
5147
+ * DecisionVisionInput is the input of a decision model that also sees
5148
+ * images: a DecisionInput plus the images the questions are about.
5149
+ */
5150
+ export interface DecisionVisionInput extends DecisionInput {
5151
+ /**
5152
+ * Images are file URIs. Every question sees them.
5153
+ */
5154
+ images?: string[];
5155
+ }
5156
+ /**
5157
+ * DecisionChoiceAnswer is the answer to a choice question.
5158
+ */
5159
+ export interface DecisionChoiceAnswer {
5160
+ /**
5161
+ * Choice is the highest-probability option.
5162
+ */
5163
+ choice: string;
5164
+ confidence: number;
5165
+ /**
5166
+ * Probabilities maps every option name to its probability.
5167
+ */
5168
+ probabilities: {
5169
+ [key: string]: number;
5170
+ };
5171
+ }
5172
+ /**
5173
+ * DecisionScoreAnswer is the answer to a score question.
5174
+ */
5175
+ export interface DecisionScoreAnswer {
5176
+ /**
5177
+ * Score is the probability-weighted level, 0 to the top level number.
5178
+ */
5179
+ score: number;
5180
+ /**
5181
+ * Normalized is Score over the top level number: 0 to 1.
5182
+ */
5183
+ normalized: number;
5184
+ confidence: number;
5185
+ /**
5186
+ * Probabilities maps each level number, as a string, to its probability.
5187
+ */
5188
+ probabilities: {
5189
+ [key: string]: number;
5190
+ };
5191
+ /**
5192
+ * Legend maps each level number back to its description.
5193
+ */
5194
+ legend: {
5195
+ [key: string]: any;
5196
+ };
5197
+ }
5198
+ /**
5199
+ * DecisionNoulAnswer is the answer to a noul question.
5200
+ */
5201
+ export interface DecisionNoulAnswer {
5202
+ /**
5203
+ * Noul is the probability that the answer is yes.
5204
+ */
5205
+ noul: number;
5206
+ }
5207
+ /**
5208
+ * DecisionOutput is the answers, keyed by question id within each kind.
5209
+ */
5210
+ export interface DecisionOutput {
5211
+ choices: {
5212
+ [key: string]: DecisionChoiceAnswer;
5213
+ };
5214
+ scores: {
5215
+ [key: string]: DecisionScoreAnswer;
5216
+ };
5217
+ nouls: {
5218
+ [key: string]: DecisionNoulAnswer;
5219
+ };
5220
+ /**
5221
+ * Model is the model that answered.
5222
+ */
5223
+ model: string;
5224
+ /**
5225
+ * InputTokens is what the model read; decision models write none.
5226
+ */
5227
+ input_tokens: number;
5228
+ }
5326
5229
  /**
5327
5230
  * DescriptionLimit is the most characters a resource's description may have.
5328
5231
  */