Sr Izan
Sr Izan
Explore posts from servers
CDCloudflare Developers
Created by Sr Izan on 4/3/2024 in #general-help
only "t" on response - AI Rest API
hey! I'm currently getting the following response on the second message to the AI: REST API response: { result: { response: 't' }, success: true, errors: [], messages: [] } API query:
const response = await fetch(`https://api.cloudflare.com/client/v4/accounts/${process.env.CF_AI_ACC}/ai/run/@cf/meta/llama-2-7b-chat-int8`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.CF_AI_TOKEN}`
},
body: JSON.stringify({
messages: messages
})
}).then(async res => await res.json())
const response = await fetch(`https://api.cloudflare.com/client/v4/accounts/${process.env.CF_AI_ACC}/ai/run/@cf/meta/llama-2-7b-chat-int8`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.CF_AI_TOKEN}`
},
body: JSON.stringify({
messages: messages
})
}).then(async res => await res.json())
2 replies