@botpress/cognitive 0.4.6 → 0.5.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.
- package/.turbo/turbo-build.log +7 -7
- package/dist/index.cjs +784 -111
- package/dist/index.cjs.map +2 -2
- package/dist/index.d.ts +178 -112
- package/dist/index.mjs +784 -111
- package/dist/index.mjs.map +2 -2
- package/package.json +1 -1
- package/refresh-models.ts +51 -30
package/dist/index.d.ts
CHANGED
|
@@ -139,7 +139,7 @@ type Model$2 = {
|
|
|
139
139
|
id: string;
|
|
140
140
|
name: string;
|
|
141
141
|
description: string;
|
|
142
|
-
tags: Array<'recommended' | 'deprecated' | 'general-purpose' | 'low-cost' | 'vision' | 'coding' | 'agents' | 'function-calling' | 'roleplay' | 'storytelling' | 'reasoning' | 'preview'>;
|
|
142
|
+
tags: Array<'recommended' | 'deprecated' | 'general-purpose' | 'low-cost' | 'vision' | 'coding' | 'agents' | 'function-calling' | 'roleplay' | 'storytelling' | 'reasoning' | 'preview' | 'speech-to-text'>;
|
|
143
143
|
input: {
|
|
144
144
|
maxTokens: number;
|
|
145
145
|
/** Cost per 1 million tokens, in U.S. dollars */
|
|
@@ -9663,6 +9663,7 @@ interface CreateWorkspaceMemberRequestParams {
|
|
|
9663
9663
|
interface CreateWorkspaceMemberRequestBody {
|
|
9664
9664
|
email: string;
|
|
9665
9665
|
role: "viewer" | "billing" | "developer" | "manager" | "administrator" | "owner";
|
|
9666
|
+
sendEmail?: boolean;
|
|
9666
9667
|
}
|
|
9667
9668
|
type CreateWorkspaceMemberInput = CreateWorkspaceMemberRequestBody & CreateWorkspaceMemberRequestHeaders & CreateWorkspaceMemberRequestQuery & CreateWorkspaceMemberRequestParams;
|
|
9668
9669
|
interface CreateWorkspaceMemberResponse {
|
|
@@ -19872,22 +19873,65 @@ declare class Cognitive {
|
|
|
19872
19873
|
private _generateContent;
|
|
19873
19874
|
}
|
|
19874
19875
|
|
|
19875
|
-
type Models = 'auto' | 'best' | 'fast' | 'anthropic:claude-haiku-4-5-20251001' | 'anthropic:claude-haiku-4-5-reasoning-20251001' | 'anthropic:claude-opus-4-6' | 'anthropic:claude-sonnet-4-20250514' | 'anthropic:claude-sonnet-4-5-20250929' | 'anthropic:claude-sonnet-4-6' | 'cerebras:gpt-oss-120b' | 'cerebras:
|
|
19876
|
+
type Models = 'auto' | 'best' | 'fast' | 'anthropic:claude-haiku-4-5-20251001' | 'anthropic:claude-haiku-4-5-reasoning-20251001' | 'anthropic:claude-opus-4-5-20251101' | 'anthropic:claude-opus-4-6' | 'anthropic:claude-sonnet-4-20250514' | 'anthropic:claude-sonnet-4-5-20250929' | 'anthropic:claude-sonnet-4-6' | 'cerebras:gpt-oss-120b' | 'cerebras:llama3.1-8b' | 'fireworks-ai:deepseek-v3p1' | 'fireworks-ai:deepseek-v3p2' | 'fireworks-ai:gpt-oss-120b' | 'fireworks-ai:gpt-oss-20b' | 'fireworks-ai:llama-v3p3-70b-instruct' | 'fireworks-ai:qwen3-8b' | 'google-ai:gemini-2.5-flash' | 'google-ai:gemini-2.5-flash-lite' | 'google-ai:gemini-2.5-pro' | 'google-ai:gemini-3-flash' | 'google-ai:gemini-3.1-flash-lite' | 'google-ai:gemini-3.1-pro' | 'groq:gpt-oss-120b' | 'groq:gpt-oss-20b' | 'groq:llama-3.1-8b-instant' | 'groq:llama-3.3-70b-versatile' | 'openai:gpt-4.1-2025-04-14' | 'openai:gpt-4.1-mini-2025-04-14' | 'openai:gpt-4.1-nano-2025-04-14' | 'openai:gpt-4o-2024-11-20' | 'openai:gpt-4o-mini-2024-07-18' | 'openai:gpt-5-2025-08-07' | 'openai:gpt-5-mini-2025-08-07' | 'openai:gpt-5-nano-2025-08-07' | 'openai:gpt-5.1-2025-11-13' | 'openai:gpt-5.2-2025-12-11' | 'openai:gpt-5.3-chat' | 'openai:gpt-5.4-2026-03-05' | 'openai:gpt-5.4-mini-2026-03-17' | 'openai:gpt-5.4-nano-2026-03-17' | 'openai:o1-2024-12-17' | 'openai:o3-2025-04-16' | 'openai:o3-mini-2025-01-31' | 'openai:o4-mini-2025-04-16' | 'openrouter:gpt-oss-120b' | 'xai:grok-3' | 'xai:grok-3-mini' | 'xai:grok-4-0709' | 'xai:grok-4-1-fast-non-reasoning' | 'xai:grok-4-1-fast-reasoning' | 'xai:grok-4-fast-non-reasoning' | 'xai:grok-4-fast-reasoning' | 'xai:grok-4.20-0309-non-reasoning' | 'xai:grok-4.20-0309-reasoning' | 'xai:grok-code-fast-1' | 'openai:gpt-5.4' | 'openai:gpt-5.4-mini' | 'openai:gpt-5.4-nano' | 'openai:gpt-5.3-chat-latest' | 'openai:gpt-5' | 'openai:gpt-5-mini' | 'openai:gpt-5-nano' | 'openai:o4-mini' | 'openai:o3' | 'openai:gpt-4.1' | 'openai:gpt-4.1-mini' | 'openai:gpt-4.1-nano' | 'openai:o3-mini' | 'openai:o1-mini' | 'openai:gpt-4o-mini' | 'openai:gpt-4o' | 'anthropic:claude-opus-4-5' | 'anthropic:claude-sonnet-4-5' | 'anthropic:claude-sonnet-4' | 'anthropic:claude-sonnet-4-reasoning' | 'anthropic:claude-haiku-4-5' | 'anthropic:claude-haiku-4-5-reasoning' | 'anthropic:claude-haiku-4-5-20251001' | 'google-ai:gemini-3.1-pro-preview' | 'google-ai:gemini-3-flash-preview' | 'google-ai:gemini-3.1-flash-lite-preview' | 'google-ai:models/gemini-2.0-flash' | 'google-ai:gemini-3-pro-preview' | 'groq:openai/gpt-oss-20b' | 'groq:openai/gpt-oss-120b' | 'fireworks-ai:accounts/fireworks/models/qwen3-8b' | 'fireworks-ai:accounts/fireworks/models/gpt-oss-20b' | 'fireworks-ai:accounts/fireworks/models/gpt-oss-120b' | 'fireworks-ai:accounts/fireworks/models/deepseek-v3p2' | 'fireworks-ai:accounts/fireworks/models/deepseek-v3p1' | 'fireworks-ai:accounts/fireworks/models/deepseek-r1-0528' | 'fireworks-ai:accounts/fireworks/models/deepseek-v3-0324' | 'fireworks-ai:accounts/fireworks/models/llama4-maverick-instruct-basic' | 'fireworks-ai:accounts/fireworks/models/llama4-scout-instruct-basic' | 'fireworks-ai:accounts/fireworks/models/llama-v3p3-70b-instruct' | 'fireworks-ai:accounts/fireworks/models/deepseek-r1' | 'fireworks-ai:accounts/fireworks/models/deepseek-r1-basic' | 'fireworks-ai:accounts/fireworks/models/deepseek-v3' | 'fireworks-ai:accounts/fireworks/models/llama-v3p1-405b-instruct' | 'fireworks-ai:accounts/fireworks/models/llama-v3p1-70b-instruct' | 'fireworks-ai:accounts/fireworks/models/llama-v3p1-8b-instruct' | 'fireworks-ai:accounts/fireworks/models/mixtral-8x22b-instruct' | 'fireworks-ai:accounts/fireworks/models/mixtral-8x7b-instruct' | 'fireworks-ai:accounts/fireworks/models/mythomax-l2-13b' | 'fireworks-ai:accounts/fireworks/models/gemma2-9b-it' | ({} & string);
|
|
19877
|
+
type SttModels = 'auto' | 'best' | 'fast' | 'fireworks-ai:whisper-v3' | 'groq:whisper-large-v3' | 'groq:whisper-large-v3-turbo' | 'openai:whisper-1' | ({} & string);
|
|
19878
|
+
type CognitiveContentPart = {
|
|
19879
|
+
type: 'text' | 'image' | 'audio';
|
|
19880
|
+
text?: string;
|
|
19881
|
+
url?: string;
|
|
19882
|
+
mimeType?: string;
|
|
19883
|
+
};
|
|
19884
|
+
type CognitiveToolCall = {
|
|
19885
|
+
id: string;
|
|
19886
|
+
name: string;
|
|
19887
|
+
input: Record<string, unknown>;
|
|
19888
|
+
};
|
|
19889
|
+
type CognitiveMessage = {
|
|
19890
|
+
role: 'user' | 'assistant' | 'system';
|
|
19891
|
+
content: string | CognitiveContentPart[] | null;
|
|
19892
|
+
type?: 'text' | 'tool_calls' | 'tool_result' | 'multipart';
|
|
19893
|
+
toolCalls?: {
|
|
19894
|
+
id: string;
|
|
19895
|
+
type: 'function';
|
|
19896
|
+
function: {
|
|
19897
|
+
name: string;
|
|
19898
|
+
arguments: Record<string, unknown> | null;
|
|
19899
|
+
};
|
|
19900
|
+
}[];
|
|
19901
|
+
toolResultCallId?: string;
|
|
19902
|
+
};
|
|
19903
|
+
type CognitiveTool = {
|
|
19904
|
+
name: string;
|
|
19905
|
+
description?: string;
|
|
19906
|
+
parameters?: Record<string, unknown>;
|
|
19907
|
+
strict?: boolean;
|
|
19908
|
+
};
|
|
19909
|
+
type CognitiveToolControl = {
|
|
19910
|
+
mode: 'auto';
|
|
19911
|
+
parallel?: boolean;
|
|
19912
|
+
} | {
|
|
19913
|
+
mode: 'none';
|
|
19914
|
+
} | {
|
|
19915
|
+
mode: 'required';
|
|
19916
|
+
parallel?: boolean;
|
|
19917
|
+
} | {
|
|
19918
|
+
mode: 'specific';
|
|
19919
|
+
toolName: string;
|
|
19920
|
+
parallel?: boolean;
|
|
19921
|
+
};
|
|
19922
|
+
type CommonRequestOptions = {
|
|
19923
|
+
/** Include additional metadata in the response */
|
|
19924
|
+
debug?: boolean;
|
|
19925
|
+
/** Bypass the cache and force a new request */
|
|
19926
|
+
skipCache?: boolean;
|
|
19927
|
+
/** Client-provided request ID. Acts as an idempotency key — if provided, the result is stored and a retry with the same ID returns the stored result instead of re-running the operation */
|
|
19928
|
+
requestId?: string;
|
|
19929
|
+
};
|
|
19876
19930
|
type CognitiveRequest = {
|
|
19877
19931
|
/**
|
|
19878
19932
|
* @minItems 1
|
|
19879
19933
|
*/
|
|
19880
|
-
messages:
|
|
19881
|
-
role: 'user' | 'assistant' | 'system';
|
|
19882
|
-
content: string | {
|
|
19883
|
-
type: 'text' | 'image';
|
|
19884
|
-
text?: string;
|
|
19885
|
-
url?: string;
|
|
19886
|
-
mimeType?: string;
|
|
19887
|
-
[k: string]: any;
|
|
19888
|
-
}[];
|
|
19889
|
-
type?: string;
|
|
19890
|
-
}[];
|
|
19934
|
+
messages: CognitiveMessage[];
|
|
19891
19935
|
/**
|
|
19892
19936
|
* Model to query. Additional models are used as fallback if the main model is unavailable
|
|
19893
19937
|
*/
|
|
@@ -19905,109 +19949,121 @@ type CognitiveRequest = {
|
|
|
19905
19949
|
*/
|
|
19906
19950
|
responseFormat?: 'text' | 'json' | 'json_object';
|
|
19907
19951
|
reasoningEffort?: 'low' | 'medium' | 'high' | 'dynamic' | 'none';
|
|
19908
|
-
|
|
19909
|
-
|
|
19910
|
-
|
|
19911
|
-
|
|
19912
|
-
|
|
19913
|
-
|
|
19914
|
-
|
|
19915
|
-
|
|
19916
|
-
|
|
19917
|
-
/**
|
|
19918
|
-
* Maximum time to wait for the first token before falling back to the next provider
|
|
19919
|
-
*/
|
|
19952
|
+
/** Enable web search. The model can search the web and fetch pages to ground its response with real-time information. */
|
|
19953
|
+
search?: true | {
|
|
19954
|
+
excludedDomains?: string[];
|
|
19955
|
+
};
|
|
19956
|
+
/** Tools the model may call */
|
|
19957
|
+
tools?: CognitiveTool[];
|
|
19958
|
+
/** Controls how the model uses tools. Defaults to auto when tools are provided */
|
|
19959
|
+
toolControl?: CognitiveToolControl;
|
|
19960
|
+
options?: CommonRequestOptions & {
|
|
19961
|
+
/** Maximum time to wait for the first token before falling back to the next provider */
|
|
19920
19962
|
maxTimeToFirstToken?: number;
|
|
19963
|
+
/** STT model to use when transcribing audio parts for models that do not support audio natively */
|
|
19964
|
+
transcriptionModel?: SttModels;
|
|
19921
19965
|
};
|
|
19922
19966
|
meta?: {
|
|
19923
|
-
/**
|
|
19924
|
-
* Source of the prompt, e.g. agent/:id/:version cards/ai-generate, cards/ai-task, nodes/autonomous, etc.
|
|
19925
|
-
*/
|
|
19967
|
+
/** Source of the prompt, e.g. agent/:id/:version, cards/ai-generate, cards/ai-task, nodes/autonomous, etc. */
|
|
19926
19968
|
promptSource?: string;
|
|
19927
19969
|
promptCategory?: string;
|
|
19928
|
-
/**
|
|
19929
|
-
* Name of the integration that originally received the message that initiated this action
|
|
19930
|
-
*/
|
|
19970
|
+
/** Name of the integration that originally received the message that initiated this action */
|
|
19931
19971
|
integrationName?: string;
|
|
19932
19972
|
};
|
|
19933
19973
|
};
|
|
19974
|
+
type StopReason = 'stop' | 'max_tokens' | 'content_filter' | 'tool_calls' | 'other';
|
|
19975
|
+
type WarningType = 'parameter_ignored' | 'provider_limitation' | 'deprecated_model' | 'discontinued_model' | 'fallback_used' | 'timeout';
|
|
19976
|
+
type CognitiveMetadata = {
|
|
19977
|
+
requestId?: string;
|
|
19978
|
+
provider: string;
|
|
19979
|
+
model?: string;
|
|
19980
|
+
usage: {
|
|
19981
|
+
inputTokens: number;
|
|
19982
|
+
inputCost: number;
|
|
19983
|
+
outputTokens: number;
|
|
19984
|
+
outputCost: number;
|
|
19985
|
+
};
|
|
19986
|
+
/** Total cost of the request in U.S. dollars */
|
|
19987
|
+
cost: number;
|
|
19988
|
+
cached?: boolean;
|
|
19989
|
+
/** Time it took for the provider to respond to the LLM query, in milliseconds */
|
|
19990
|
+
latency?: number;
|
|
19991
|
+
/** Time it took for the first token to be received from the provider, in milliseconds */
|
|
19992
|
+
ttft?: number;
|
|
19993
|
+
/** Time spent on reasoning in milliseconds */
|
|
19994
|
+
reasoningTime?: number;
|
|
19995
|
+
stopReason?: StopReason;
|
|
19996
|
+
reasoningEffort?: string;
|
|
19997
|
+
/** Web sources cited by the model when search is enabled */
|
|
19998
|
+
citations?: {
|
|
19999
|
+
url: string;
|
|
20000
|
+
title?: string;
|
|
20001
|
+
}[];
|
|
20002
|
+
warnings?: {
|
|
20003
|
+
type: WarningType;
|
|
20004
|
+
message: string;
|
|
20005
|
+
}[];
|
|
20006
|
+
/** List of models that were tried and failed before the successful one */
|
|
20007
|
+
fallbackPath?: string[];
|
|
20008
|
+
/** Present when audio content was transcribed to text before being sent to the LLM */
|
|
20009
|
+
transcription?: {
|
|
20010
|
+
/** Full STT model ID including provider (e.g. groq:whisper-large-v3-turbo) */
|
|
20011
|
+
model: string;
|
|
20012
|
+
provider: string;
|
|
20013
|
+
/** Transcription cost in U.S. dollars */
|
|
20014
|
+
cost: number;
|
|
20015
|
+
/** Total audio duration transcribed in seconds */
|
|
20016
|
+
durationSeconds: number;
|
|
20017
|
+
/** Number of audio parts transcribed */
|
|
20018
|
+
parts: number;
|
|
20019
|
+
};
|
|
20020
|
+
debug?: {
|
|
20021
|
+
type: string;
|
|
20022
|
+
data?: unknown;
|
|
20023
|
+
}[];
|
|
20024
|
+
};
|
|
19934
20025
|
type CognitiveStreamChunk = {
|
|
19935
20026
|
output?: string;
|
|
20027
|
+
reasoning?: string;
|
|
20028
|
+
/** Tool calls requested by the model (emitted with the final chunk) */
|
|
20029
|
+
toolCalls?: CognitiveToolCall[];
|
|
19936
20030
|
created: number;
|
|
19937
20031
|
finished?: boolean;
|
|
19938
|
-
metadata?:
|
|
19939
|
-
provider: string;
|
|
19940
|
-
model?: string;
|
|
19941
|
-
usage: {
|
|
19942
|
-
inputTokens: number;
|
|
19943
|
-
inputCost: number;
|
|
19944
|
-
outputTokens: number;
|
|
19945
|
-
outputCost: number;
|
|
19946
|
-
};
|
|
19947
|
-
cost: number;
|
|
19948
|
-
cached?: boolean;
|
|
19949
|
-
/**
|
|
19950
|
-
* Time it took for the provider to respond to the LLM query
|
|
19951
|
-
*/
|
|
19952
|
-
latency?: number;
|
|
19953
|
-
/**
|
|
19954
|
-
* Time it took for the first token to be received from the provider
|
|
19955
|
-
*/
|
|
19956
|
-
ttft?: number;
|
|
19957
|
-
stopReason?: 'stop' | 'max_tokens' | 'content_filter' | 'tool_calls' | 'other';
|
|
19958
|
-
reasoningEffort?: string;
|
|
19959
|
-
warnings?: {
|
|
19960
|
-
type: 'parameter_ignored' | 'provider_limitation' | 'deprecated_model' | 'discontinued_model' | 'fallback_used';
|
|
19961
|
-
message: string;
|
|
19962
|
-
}[];
|
|
19963
|
-
/**
|
|
19964
|
-
* List of models that were tried and failed
|
|
19965
|
-
*/
|
|
19966
|
-
fallbackPath?: string[];
|
|
19967
|
-
debug?: {
|
|
19968
|
-
type: 'models_to_try' | 'provider_request' | 'provider_response';
|
|
19969
|
-
}[];
|
|
19970
|
-
};
|
|
20032
|
+
metadata?: CognitiveMetadata;
|
|
19971
20033
|
};
|
|
19972
20034
|
type CognitiveResponse = {
|
|
19973
20035
|
output: string;
|
|
19974
20036
|
reasoning?: string;
|
|
19975
|
-
|
|
19976
|
-
|
|
19977
|
-
|
|
19978
|
-
|
|
19979
|
-
|
|
19980
|
-
|
|
19981
|
-
|
|
19982
|
-
|
|
19983
|
-
|
|
19984
|
-
|
|
19985
|
-
|
|
19986
|
-
|
|
19987
|
-
|
|
19988
|
-
|
|
19989
|
-
|
|
19990
|
-
|
|
19991
|
-
|
|
19992
|
-
|
|
19993
|
-
|
|
19994
|
-
|
|
19995
|
-
|
|
19996
|
-
|
|
19997
|
-
|
|
19998
|
-
|
|
19999
|
-
|
|
20000
|
-
|
|
20001
|
-
* List of models that were tried and failed
|
|
20002
|
-
*/
|
|
20003
|
-
fallbackPath?: string[];
|
|
20004
|
-
debug?: {
|
|
20005
|
-
type: 'models_to_try' | 'provider_request' | 'provider_response';
|
|
20006
|
-
data?: any | null;
|
|
20007
|
-
}[];
|
|
20008
|
-
};
|
|
20037
|
+
/** Tool calls requested by the model */
|
|
20038
|
+
toolCalls?: CognitiveToolCall[];
|
|
20039
|
+
metadata: CognitiveMetadata;
|
|
20040
|
+
error?: string;
|
|
20041
|
+
};
|
|
20042
|
+
type TranscribeRequest = {
|
|
20043
|
+
/** URL of the audio file to transcribe (supports http(s) URLs and data URIs) */
|
|
20044
|
+
url: string;
|
|
20045
|
+
/** MIME type of the audio file. Auto-detected from URL if not provided. */
|
|
20046
|
+
mimeType?: string;
|
|
20047
|
+
/** STT model or ordered list of models to try. Additional models are used as fallback. Defaults to auto. */
|
|
20048
|
+
model?: SttModels | SttModels[];
|
|
20049
|
+
options?: CommonRequestOptions;
|
|
20050
|
+
};
|
|
20051
|
+
/**
|
|
20052
|
+
* Transcription metadata. Picks shared fields from CognitiveMetadata and adds transcription-specific ones.
|
|
20053
|
+
*/
|
|
20054
|
+
type TranscribeMetadata = Pick<CognitiveMetadata, 'requestId' | 'provider' | 'cost' | 'latency' | 'cached' | 'fallbackPath' | 'debug'> & {
|
|
20055
|
+
/** Full model ID including provider (e.g. groq:whisper-large-v3-turbo) */
|
|
20056
|
+
model: string;
|
|
20057
|
+
/** Audio duration in seconds */
|
|
20058
|
+
durationSeconds: number;
|
|
20059
|
+
};
|
|
20060
|
+
type TranscribeResponse = {
|
|
20061
|
+
/** Transcribed text */
|
|
20062
|
+
output: string;
|
|
20009
20063
|
error?: string;
|
|
20064
|
+
metadata: TranscribeMetadata;
|
|
20010
20065
|
};
|
|
20066
|
+
type ModelTag = 'recommended' | 'deprecated' | 'general-purpose' | 'low-cost' | 'vision' | 'coding' | 'agents' | 'function-calling' | 'roleplay' | 'storytelling' | 'reasoning' | 'preview' | 'speech-to-text';
|
|
20011
20067
|
type Model = {
|
|
20012
20068
|
id: string;
|
|
20013
20069
|
name: string;
|
|
@@ -20016,13 +20072,14 @@ type Model = {
|
|
|
20016
20072
|
* Aliases that are also resolving to this model
|
|
20017
20073
|
*/
|
|
20018
20074
|
aliases?: string[];
|
|
20019
|
-
tags:
|
|
20075
|
+
tags: ModelTag[];
|
|
20020
20076
|
input: {
|
|
20021
20077
|
maxTokens: number;
|
|
20022
20078
|
/**
|
|
20023
20079
|
* Cost per 1 million tokens, in U.S. dollars
|
|
20024
20080
|
*/
|
|
20025
20081
|
costPer1MTokens: number;
|
|
20082
|
+
costPerMinute?: number;
|
|
20026
20083
|
};
|
|
20027
20084
|
output: {
|
|
20028
20085
|
maxTokens: number;
|
|
@@ -20030,26 +20087,34 @@ type Model = {
|
|
|
20030
20087
|
* Cost per 1 million tokens, in U.S. dollars
|
|
20031
20088
|
*/
|
|
20032
20089
|
costPer1MTokens: number;
|
|
20090
|
+
costPerMinute?: number;
|
|
20033
20091
|
};
|
|
20034
20092
|
/**
|
|
20035
20093
|
* The lifecycle state of the model. Deprecated models are still available, but a warning will be shown to the user. Discontinued models will be directed to a replacement model.
|
|
20036
20094
|
*/
|
|
20037
20095
|
lifecycle: 'production' | 'preview' | 'deprecated' | 'discontinued';
|
|
20096
|
+
capabilities?: {
|
|
20097
|
+
supportsImages?: boolean;
|
|
20098
|
+
supportsAudio?: boolean;
|
|
20099
|
+
supportsTranscription?: boolean;
|
|
20100
|
+
supportsSearch?: boolean;
|
|
20101
|
+
};
|
|
20038
20102
|
};
|
|
20039
20103
|
|
|
20104
|
+
type BetaTextRequest = {
|
|
20105
|
+
type: 'generateText';
|
|
20106
|
+
input: CognitiveRequest;
|
|
20107
|
+
};
|
|
20108
|
+
type BetaTranscribeRequest = {
|
|
20109
|
+
type: 'transcribeAudio';
|
|
20110
|
+
input: TranscribeRequest;
|
|
20111
|
+
};
|
|
20112
|
+
type BetaRequest = BetaTextRequest | BetaTranscribeRequest;
|
|
20040
20113
|
type BetaEvents = {
|
|
20041
|
-
request: (req:
|
|
20042
|
-
|
|
20043
|
-
|
|
20044
|
-
|
|
20045
|
-
input: CognitiveRequest;
|
|
20046
|
-
}, res: CognitiveResponse) => void;
|
|
20047
|
-
error: (req: {
|
|
20048
|
-
input: CognitiveRequest;
|
|
20049
|
-
}, error: any) => void;
|
|
20050
|
-
retry: (req: {
|
|
20051
|
-
input: CognitiveRequest;
|
|
20052
|
-
}, error: any) => void;
|
|
20114
|
+
request: (req: BetaRequest) => void;
|
|
20115
|
+
response: (req: BetaRequest, res: CognitiveResponse | TranscribeResponse) => void;
|
|
20116
|
+
error: (req: BetaRequest, error: any) => void;
|
|
20117
|
+
retry: (req: BetaRequest, error: any) => void;
|
|
20053
20118
|
};
|
|
20054
20119
|
type ClientProps = {
|
|
20055
20120
|
apiUrl?: string;
|
|
@@ -20078,6 +20143,7 @@ declare class CognitiveBeta {
|
|
|
20078
20143
|
on<K extends keyof BetaEvents>(event: K, cb: BetaEvents[K]): Unsubscribe;
|
|
20079
20144
|
generateText(input: CognitiveRequest, options?: RequestOptions): Promise<CognitiveResponse>;
|
|
20080
20145
|
listModels(): Promise<Model[]>;
|
|
20146
|
+
transcribeAudio(input: TranscribeRequest, options?: RequestOptions): Promise<TranscribeResponse>;
|
|
20081
20147
|
generateTextStream(request: CognitiveRequest, options?: RequestOptions): AsyncGenerator<CognitiveStreamChunk, void, unknown>;
|
|
20082
20148
|
private _ndjson;
|
|
20083
20149
|
private _isRetryableServerError;
|
|
@@ -20086,4 +20152,4 @@ declare class CognitiveBeta {
|
|
|
20086
20152
|
declare const isKnownV2Model: (model: string | undefined) => boolean;
|
|
20087
20153
|
declare const getCognitiveV2Model: (model: string) => Model | undefined;
|
|
20088
20154
|
|
|
20089
|
-
export { type BetaEvents, type BotpressClientLike, Cognitive, CognitiveBeta, type CognitiveRequest, type CognitiveResponse, type CognitiveStreamChunk, type Events, type GenerateContentInput, type GenerateContentOutput, type Model$1 as Model, type ModelPreferences, ModelProvider, type Models, RemoteModelProvider, getCognitiveV2Model, isKnownV2Model };
|
|
20155
|
+
export { type BetaEvents, type BetaRequest, type BetaTextRequest, type BetaTranscribeRequest, type BotpressClientLike, Cognitive, CognitiveBeta, type CognitiveContentPart, type CognitiveMessage, type CognitiveMetadata, type CognitiveRequest, type CognitiveResponse, type CognitiveStreamChunk, type CognitiveTool, type CognitiveToolCall, type CognitiveToolControl, type CommonRequestOptions, type Events, type GenerateContentInput, type GenerateContentOutput, type Model$1 as Model, type ModelPreferences, ModelProvider, type ModelTag, type Models, RemoteModelProvider, type StopReason, type SttModels, type TranscribeMetadata, type TranscribeRequest, type TranscribeResponse, getCognitiveV2Model, isKnownV2Model };
|