{"record":{"id":"dee19b4c5819548b","repo":"FlowiseAI/Flowise","slug":"input-type-must-be-selected-for-cohere-models","errorCode":null,"errorMessage":"Input Type must be selected for Cohere models.","messagePattern":"Input Type must be selected for Cohere models\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/embeddings/AWSBedrockEmbedding/AWSBedrockEmbedding.ts","lineNumber":136,"sourceCode":"        async listModels(): Promise<INodeOptionsValue[]> {\n            return await getModels(MODEL_TYPE.EMBEDDING, 'AWSBedrockEmbeddings')\n        },\n        async listRegions(): Promise<INodeOptionsValue[]> {\n            return await getRegions(MODEL_TYPE.EMBEDDING, 'AWSBedrockEmbeddings')\n        }\n    }\n\n    async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {\n        const iRegion = nodeData.inputs?.region as string\n        const iModel = nodeData.inputs?.model as string\n        const customModel = nodeData.inputs?.customModel as string\n        const inputType = nodeData.inputs?.inputType as string\n        const endpointHost = (nodeData.inputs?.endpointHost as string)?.trim()\n        const effectiveModel = customModel || iModel\n        if (!effectiveModel) throw new Error('Model ID is required')\n\n        if (effectiveModel.startsWith('cohere') && !inputType) {\n            throw new Error('Input Type must be selected for Cohere models.')\n        }\n\n        const obj: BedrockEmbeddingsParams = {\n            model: effectiveModel,\n            region: iRegion\n        }\n\n        /**\n         * Long-term credentials specified in embedding configuration are optional.\n         * Bedrock's credential provider falls back to the AWS SDK to fetch\n         * credentials from the running environment.\n         * Supports STS AssumeRole when a Role ARN is configured in the credential.\n         */\n        const credentialConfig = await getAWSCredentialConfig(nodeData, options, iRegion)\n        if (credentialConfig.credentials) {\n            obj.credentials = credentialConfig.credentials\n        }\n","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/embeddings/AWSBedrockEmbedding/AWSBedrockEmbedding.ts#L118-L154","documentation":"init() guard: Cohere embedding models on Bedrock (modelId starting with 'cohere') require an input_type (search_document/search_query/classification/clustering) in the request body. Without it Bedrock rejects the call, so the node fails fast.","triggerScenarios":"effectiveModel is a Cohere embed model (e.g. cohere.embed-english-v3) and nodeData.inputs.inputType is empty/undefined.","commonSituations":"Switching from Titan to Cohere without re-selecting inputType, a flow import that dropped the inputType field, or UI conditionally hiding inputType until model change.","solutions":["Select an Input Type in the node UI when using a Cohere embed model.","Default to 'search_document' for indexing workloads if unspecified.","Validate model+inputType together at the editor layer.","When migrating from Titan, re-configure the inputType field explicitly."],"exampleFix":"// before\nif (effectiveModel.startsWith('cohere') && !inputType) {\n    throw new Error('Input Type must be selected for Cohere models.')\n}\n\n// after\nconst effectiveInputType = effectiveModel.startsWith('cohere') ? (inputType || 'search_document') : inputType\nif (effectiveModel.startsWith('cohere') && !effectiveInputType) {\n    throw new Error('Input Type must be selected for Cohere models.')\n}","handlingStrategy":"validation","validationCode":"const COHERE_INPUT_TYPES = ['search_document', 'search_query', 'classification', 'clustering'] as const\nif (effectiveModel.startsWith('cohere')) {\n    const t = COHERE_INPUT_TYPES.includes(inputType) ? inputType : 'search_document'\n    // use t in the request body\n}","typeGuard":"type CohereInputType = 'search_document' | 'search_query' | 'classification' | 'clustering'\nfunction isCohereInputType(v: unknown): v is CohereInputType {\n    return ['search_document', 'search_query', 'classification', 'clustering'].includes(v as string)\n}","tryCatchPattern":null,"preventionTips":["Show the Input Type selector automatically when a Cohere model is chosen.","Default to 'search_document' for indexing pipelines.","Validate inputType together with model in the editor.","Re-configure inputType when migrating from Titan to Cohere."],"tags":["aws-bedrock","cohere","embeddings","validation"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}