const ai = new Ai(env.AI);
const output = ai.run('@cf/meta/llama-2-7b-chat-int8', {
prompt: args.prompt
}).then(function (result){
return result;
}).then(async function (result){
await fetch('https://discord.com/api/v10/webhooks/'+env.DISCORD_APPLICATION_ID+'/'+interaction.token+'/messages/@original',{
method:'PATCH',
headers:{'content-type': 'application/json;charset=UTF-8',},
body:JSON.stringify({
content: result.response,
})
})
})
const ai = new Ai(env.AI);
const output = ai.run('@cf/meta/llama-2-7b-chat-int8', {
prompt: args.prompt
}).then(function (result){
return result;
}).then(async function (result){
await fetch('https://discord.com/api/v10/webhooks/'+env.DISCORD_APPLICATION_ID+'/'+interaction.token+'/messages/@original',{
method:'PATCH',
headers:{'content-type': 'application/json;charset=UTF-8',},
body:JSON.stringify({
content: result.response,
})
})
})