@botpress/cognitive 0.4.7 → 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/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 */
@@ -19873,22 +19873,65 @@ declare class Cognitive {
19873
19873
  private _generateContent;
19874
19874
  }
19875
19875
 
19876
- 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:llama-4-scout-17b-16e-instruct' | 'cerebras:llama3.1-8b' | 'cerebras:llama3.3-70b' | 'cerebras:qwen-3-32b' | 'fireworks-ai:deepseek-r1-0528' | 'fireworks-ai:deepseek-v3-0324' | 'fireworks-ai:gpt-oss-120b' | 'fireworks-ai:gpt-oss-20b' | 'fireworks-ai:llama-v3p1-8b-instruct' | 'fireworks-ai:llama-v3p3-70b-instruct' | 'fireworks-ai:llama4-maverick-instruct-basic' | 'fireworks-ai:llama4-scout-instruct-basic' | 'google-ai:gemini-2.0-flash' | 'google-ai:gemini-2.5-flash' | 'google-ai:gemini-2.5-pro' | 'google-ai:gemini-3-flash' | 'google-ai:gemini-3-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.4-2026-03-05' | 'openai:o1-2024-12-17' | 'openai:o1-mini-2024-09-12' | '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-fast-non-reasoning' | 'xai:grok-4-fast-reasoning' | 'xai:grok-code-fast-1' | 'openai:gpt-5.4' | '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-sonnet-4-5' | 'anthropic:claude-sonnet-4' | 'anthropic:claude-sonnet-4-reasoning' | 'anthropic:claude-haiku-4-5' | 'anthropic:claude-haiku-4-5-reasoning' | 'google-ai:gemini-3.1-pro-preview' | 'google-ai:gemini-3-flash-preview' | 'google-ai:models/gemini-2.0-flash' | 'groq:openai/gpt-oss-20b' | 'groq:openai/gpt-oss-120b' | 'fireworks-ai:accounts/fireworks/models/gpt-oss-20b' | 'fireworks-ai:accounts/fireworks/models/gpt-oss-120b' | '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);
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
+ };
19877
19930
  type CognitiveRequest = {
19878
19931
  /**
19879
19932
  * @minItems 1
19880
19933
  */
19881
- messages: {
19882
- role: 'user' | 'assistant' | 'system';
19883
- content: string | {
19884
- type: 'text' | 'image';
19885
- text?: string;
19886
- url?: string;
19887
- mimeType?: string;
19888
- [k: string]: any;
19889
- }[];
19890
- type?: string;
19891
- }[];
19934
+ messages: CognitiveMessage[];
19892
19935
  /**
19893
19936
  * Model to query. Additional models are used as fallback if the main model is unavailable
19894
19937
  */
@@ -19906,109 +19949,121 @@ type CognitiveRequest = {
19906
19949
  */
19907
19950
  responseFormat?: 'text' | 'json' | 'json_object';
19908
19951
  reasoningEffort?: 'low' | 'medium' | 'high' | 'dynamic' | 'none';
19909
- options?: {
19910
- /**
19911
- * Debug mode include additional metadata in the response
19912
- */
19913
- debug?: boolean;
19914
- /**
19915
- * Bypass the cache and force a new request
19916
- */
19917
- skipCache?: boolean;
19918
- /**
19919
- * Maximum time to wait for the first token before falling back to the next provider
19920
- */
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 */
19921
19962
  maxTimeToFirstToken?: number;
19963
+ /** STT model to use when transcribing audio parts for models that do not support audio natively */
19964
+ transcriptionModel?: SttModels;
19922
19965
  };
19923
19966
  meta?: {
19924
- /**
19925
- * Source of the prompt, e.g. agent/:id/:version cards/ai-generate, cards/ai-task, nodes/autonomous, etc.
19926
- */
19967
+ /** Source of the prompt, e.g. agent/:id/:version, cards/ai-generate, cards/ai-task, nodes/autonomous, etc. */
19927
19968
  promptSource?: string;
19928
19969
  promptCategory?: string;
19929
- /**
19930
- * Name of the integration that originally received the message that initiated this action
19931
- */
19970
+ /** Name of the integration that originally received the message that initiated this action */
19932
19971
  integrationName?: string;
19933
19972
  };
19934
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
+ };
19935
20025
  type CognitiveStreamChunk = {
19936
20026
  output?: string;
20027
+ reasoning?: string;
20028
+ /** Tool calls requested by the model (emitted with the final chunk) */
20029
+ toolCalls?: CognitiveToolCall[];
19937
20030
  created: number;
19938
20031
  finished?: boolean;
19939
- metadata?: {
19940
- provider: string;
19941
- model?: string;
19942
- usage: {
19943
- inputTokens: number;
19944
- inputCost: number;
19945
- outputTokens: number;
19946
- outputCost: number;
19947
- };
19948
- cost: number;
19949
- cached?: boolean;
19950
- /**
19951
- * Time it took for the provider to respond to the LLM query
19952
- */
19953
- latency?: number;
19954
- /**
19955
- * Time it took for the first token to be received from the provider
19956
- */
19957
- ttft?: number;
19958
- stopReason?: 'stop' | 'max_tokens' | 'content_filter' | 'tool_calls' | 'other';
19959
- reasoningEffort?: string;
19960
- warnings?: {
19961
- type: 'parameter_ignored' | 'provider_limitation' | 'deprecated_model' | 'discontinued_model' | 'fallback_used';
19962
- message: string;
19963
- }[];
19964
- /**
19965
- * List of models that were tried and failed
19966
- */
19967
- fallbackPath?: string[];
19968
- debug?: {
19969
- type: 'models_to_try' | 'provider_request' | 'provider_response';
19970
- }[];
19971
- };
20032
+ metadata?: CognitiveMetadata;
19972
20033
  };
19973
20034
  type CognitiveResponse = {
19974
20035
  output: string;
19975
20036
  reasoning?: string;
19976
- metadata: {
19977
- provider: string;
19978
- model?: string;
19979
- usage: {
19980
- inputTokens: number;
19981
- inputCost: number;
19982
- outputTokens: number;
19983
- outputCost: number;
19984
- };
19985
- cost: number;
19986
- cached?: boolean;
19987
- /**
19988
- * Time it took for the provider to respond to the LLM query
19989
- */
19990
- latency?: number;
19991
- /**
19992
- * Time it took for the first token to be received from the provider
19993
- */
19994
- ttft?: number;
19995
- stopReason?: 'stop' | 'max_tokens' | 'content_filter' | 'tool_calls' | 'other';
19996
- reasoningEffort?: string;
19997
- warnings?: {
19998
- type: 'parameter_ignored' | 'provider_limitation' | 'deprecated_model' | 'discontinued_model' | 'fallback_used';
19999
- message: string;
20000
- }[];
20001
- /**
20002
- * List of models that were tried and failed
20003
- */
20004
- fallbackPath?: string[];
20005
- debug?: {
20006
- type: 'models_to_try' | 'provider_request' | 'provider_response';
20007
- data?: any | null;
20008
- }[];
20009
- };
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;
20010
20063
  error?: string;
20064
+ metadata: TranscribeMetadata;
20011
20065
  };
20066
+ type ModelTag = 'recommended' | 'deprecated' | 'general-purpose' | 'low-cost' | 'vision' | 'coding' | 'agents' | 'function-calling' | 'roleplay' | 'storytelling' | 'reasoning' | 'preview' | 'speech-to-text';
20012
20067
  type Model = {
20013
20068
  id: string;
20014
20069
  name: string;
@@ -20017,13 +20072,14 @@ type Model = {
20017
20072
  * Aliases that are also resolving to this model
20018
20073
  */
20019
20074
  aliases?: string[];
20020
- tags: ('recommended' | 'deprecated' | 'general-purpose' | 'low-cost' | 'vision' | 'coding' | 'agents' | 'function-calling' | 'roleplay' | 'storytelling' | 'reasoning' | 'preview')[];
20075
+ tags: ModelTag[];
20021
20076
  input: {
20022
20077
  maxTokens: number;
20023
20078
  /**
20024
20079
  * Cost per 1 million tokens, in U.S. dollars
20025
20080
  */
20026
20081
  costPer1MTokens: number;
20082
+ costPerMinute?: number;
20027
20083
  };
20028
20084
  output: {
20029
20085
  maxTokens: number;
@@ -20031,26 +20087,34 @@ type Model = {
20031
20087
  * Cost per 1 million tokens, in U.S. dollars
20032
20088
  */
20033
20089
  costPer1MTokens: number;
20090
+ costPerMinute?: number;
20034
20091
  };
20035
20092
  /**
20036
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.
20037
20094
  */
20038
20095
  lifecycle: 'production' | 'preview' | 'deprecated' | 'discontinued';
20096
+ capabilities?: {
20097
+ supportsImages?: boolean;
20098
+ supportsAudio?: boolean;
20099
+ supportsTranscription?: boolean;
20100
+ supportsSearch?: boolean;
20101
+ };
20039
20102
  };
20040
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;
20041
20113
  type BetaEvents = {
20042
- request: (req: {
20043
- input: CognitiveRequest;
20044
- }) => void;
20045
- response: (req: {
20046
- input: CognitiveRequest;
20047
- }, res: CognitiveResponse) => void;
20048
- error: (req: {
20049
- input: CognitiveRequest;
20050
- }, error: any) => void;
20051
- retry: (req: {
20052
- input: CognitiveRequest;
20053
- }, 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;
20054
20118
  };
20055
20119
  type ClientProps = {
20056
20120
  apiUrl?: string;
@@ -20079,6 +20143,7 @@ declare class CognitiveBeta {
20079
20143
  on<K extends keyof BetaEvents>(event: K, cb: BetaEvents[K]): Unsubscribe;
20080
20144
  generateText(input: CognitiveRequest, options?: RequestOptions): Promise<CognitiveResponse>;
20081
20145
  listModels(): Promise<Model[]>;
20146
+ transcribeAudio(input: TranscribeRequest, options?: RequestOptions): Promise<TranscribeResponse>;
20082
20147
  generateTextStream(request: CognitiveRequest, options?: RequestOptions): AsyncGenerator<CognitiveStreamChunk, void, unknown>;
20083
20148
  private _ndjson;
20084
20149
  private _isRetryableServerError;
@@ -20087,4 +20152,4 @@ declare class CognitiveBeta {
20087
20152
  declare const isKnownV2Model: (model: string | undefined) => boolean;
20088
20153
  declare const getCognitiveV2Model: (model: string) => Model | undefined;
20089
20154
 
20090
- 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 };