straico-custom-provider
Version:
Straico custom provider for Vercel AI SDK
27 lines (23 loc) • 778 B
text/typescript
import { straico } from '../src/provider/index-simple';
async function main() {
// Initialize the model
const model = straico('anthropic/claude-3-haiku:beta', {
fileUrls: ['https://prompt-rack.s3.amazonaws.com/api/1721329178731_space_words.csv'],
youtubeUrls: ['https://www.youtube.com/watch?v=zORUUqJd81M']
});
try {
// Generate a completion
const result = await model.doGenerate([
{
type: 'text',
text: 'Which key terms from the 100-word space document also appear in the YouTube video about the universe?'
}
], {});
console.log('Generation result:');
console.log(result);
} catch (error) {
console.error('Error generating completion:', error);
}
}
// Run the example
main().catch(console.error);