We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am attempting to use AWS's Nova model with generateObject and it produces this error:
generateObject
ValidationException: This model doesn't support the toolConfig.toolChoice.tool field. Remove toolConfig.toolChoice.tool and try again.
AWS_BEDROCK_REGION=us-east-1 AWS_BEDROCK_MODEL_ID=amazon.nova-pro-v1:0
import { createAmazonBedrock } from '@ai-sdk/amazon-bedrock' import { generateObject } from 'ai' import mime from 'mime' import fs from 'fs/promises' import { MODEL_ID, BEDROCK_REGION } from '../data/constants.js' const bedrock = createAmazonBedrock({ region: BEDROCK_REGION, }) const model = bedrock(MODEL_ID) //In this situation there are no files being passed. export async function generate(prompt, schema, system = null, files = []) { const time = Date.now() console.log('Generating data...') const fileParts = [] for (let file of files) { const fileBuffer = await fs.readFile(file) const fileMime = mime.getType(file) fileParts.push({ type: 'file', data: fileBuffer, mimeType: fileMime, }) } const { object } = await generateObject({ model, temperature: 0.8, maxTokens: 5120, output: 'object', schema, ...(system ? { system } : {}), messages: [ { role: 'user', content: [ { type: 'text', text: prompt, }, ...fileParts, ], }, ], }) console.log('Time to generate data:', Date.now() - time) return object }
"@ai-sdk/amazon-bedrock": "^1.0.8",
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
I am attempting to use AWS's Nova model with
generateObject
and it produces this error:Code example
AI provider
"@ai-sdk/amazon-bedrock": "^1.0.8",
Additional context
No response
The text was updated successfully, but these errors were encountered: