
BotHub: Попробуйте ИИ прямо сейчасbot
Fournisseurs llama-4-maverickSur Bothub, vous pouvez choisir vous-même les fournisseurs pour les requêtes. Si vous n'avez pas fait de choix, nous trouverons automatiquement des fournisseurs adaptés capables de gérer la taille et les paramètres de votre demande.
Пример кода и API для llama-4-maverickМы предлагаем полный доступ к API OpenAI через наш сервис. Все наши конечные точки полностью соответствуют конечным точкам OpenAI, их можно использовать как с плагинами, так и при разработке собственного программного обеспечения через SDK.Создать API ключ
import OpenAI from 'openai';
const openai = new OpenAI({
apiKey: '<your bothub access token>',
baseURL: 'https://bothub.chat/api/v2/openai/v1'
});
// Sync - Text generation
async function main() {
const chatCompletion = await openai.chat.completions.create({
messages: [{ role: 'user', content: 'Say this is a test' }],
model: 'llama-4-maverick',
});
}
// Async - Text generation
async function main() {
const stream = await openai.chat.completions.create({
messages: [{ role: 'user', content: 'Say this is a test' }],
model: 'llama-4-maverick',
stream: true
});
for await (const chunk of stream) {
const part: string | null = chunk.choices[0].delta?.content ?? null;
}
}
main();
Comment ça marche llama-4-maverick?
Les bothubs recueillent des informations...