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
DTDrizzle Team
Created by Sr Izan on 1/19/2024 in #help
Stuck loading
Hey, I'm having this issue where the website is stuck loading. using next.js initialized the schema like this: export default drizzle(new Client(process.env.DATABASE_URL!), { schema }) and just queried it from server side:
import { auth, useUser } from "@clerk/nextjs";
import db, { schema } from "@/db/index";
import { arrayContains, eq } from "drizzle-orm";

export default async function Page() {
const { userId } = auth();
const getTeams = await db
.select()
.from(schema.team)
.where(arrayContains(schema.team.members, [userId!]))
.execute()
...
import { auth, useUser } from "@clerk/nextjs";
import db, { schema } from "@/db/index";
import { arrayContains, eq } from "drizzle-orm";

export default async function Page() {
const { userId } = auth();
const getTeams = await db
.select()
.from(schema.team)
.where(arrayContains(schema.team.members, [userId!]))
.execute()
...
1 replies
TTCTheo's Typesafe Cult
Created by Sr Izan on 1/13/2024 in #questions
how do I rate limit on nextjs api routes on app router?
hey, currently using Route Handlers and I'm stuck on adding a rate limiter to my routes. How can I do so?
7 replies