10const messages: CoreMessage[] = [];
11const openai = createOpenAI({
12 apiKey: Deno.env.get("OPENAI_API_KEY") || "",
13});
14
28 maxSteps: 10,
29 system:
30 `Your name is Vity Bounty Finder. You have been made by Vity Toolkit. You are an AI agent responsible for taking actions on Superteam Earn and Gibwork on users' behalf. You need to take action on using their APIs. Use correct tools to run APIs from the given toolkit. Give them the bounties/grants/projects if it comes under there background or interest. Your response should be structured and look beatiful too as it will directly be shown to the user. Be concise and helpful with your responses.
31
32 Note:
212 } catch (error) {
213 Toastify({
214 text: "We may have hit our Cerebras Usage limits. Try again later or fork this and use your own API key.",
215 position: "center",
216 duration: 3000,
1024 };
1025 } else {
1026 const client = new Cerebras({ apiKey: Deno.env.get("CEREBRAS_API_KEY") });
1027 const completion = await client.chat.completions.create({
1028 messages: [
1149 <meta name="viewport" content="width=device-width, initial-scale=1.0">
1150 <title>CerebrasCoder</title>
1151 <link rel="preconnect" href="https://fonts.googleapis.com" />
1152 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1153 <link
1154 href="https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap"
1155 rel="stylesheet"
1156 />
1165 <meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1166 <meta property="og:type" content="website">
1167 <meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
1168
1169
6
71. Sign up for [Cerebras](https://cloud.cerebras.ai/)
82. Get a Cerebras API Key
93. Save it in a [Val Town environment variable](https://www.val.town/settings/environment-variables) called `CEREBRAS_API_KEY`
10
11# Todos
6
71. Sign up for [Cerebras](https://cloud.cerebras.ai/)
82. Get a Cerebras API Key
93. Save it in a [Val Town environment variable](https://www.val.town/settings/environment-variables) called `CEREBRAS_API_KEY`
10
11# Todos
212 } catch (error) {
213 Toastify({
214 text: "We may have hit our Cerebras Usage limits. Try again later or fork this and use your own API key.",
215 position: "center",
216 duration: 3000,
1024 };
1025 } else {
1026 const client = new Cerebras({ apiKey: Deno.env.get("CEREBRAS_API_KEY") });
1027 const completion = await client.chat.completions.create({
1028 messages: [
1149 <meta name="viewport" content="width=device-width, initial-scale=1.0">
1150 <title>CerebrasCoder</title>
1151 <link rel="preconnect" href="https://fonts.googleapis.com" />
1152 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1153 <link
1154 href="https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap"
1155 rel="stylesheet"
1156 />
1165 <meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1166 <meta property="og:type" content="website">
1167 <meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
1168
1169
76
77 try {
78 const response = await fetch("/api/generate-question", {
79 method: "POST",
80 headers: { "Content-Type": "application/json" },
106
107 try {
108 const response = await fetch("/api/generate-exam-questions", {
109 method: "POST",
110 headers: { "Content-Type": "application/json" },
143
144 try {
145 const response = await fetch("/api/get-feedback", {
146 method: "POST",
147 headers: { "Content-Type": "application/json" },
176
177 try {
178 const response = await fetch("/api/get-exam-feedback", {
179 method: "POST",
180 headers: { "Content-Type": "application/json" },
501 currentQuestion,
502 } = await request.json();
503 console.log("OpenAI API Request:", { prompt, topic });
504
505 try {
550 });
551 } else {
552 throw new Error("Invalid API endpoint");
553 }
554
555 const response = completion.choices[0].message.parsed;
556 console.log("OpenAI API Response:", response);
557
558 return new Response(JSON.stringify(response), {
560 });
561 } catch (error) {
562 console.error("Error in OpenAI API call:", error);
563 return new Response(JSON.stringify({ error: error.message }), {
564 status: 500,
600 </script>
601 <style>
602 @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');
603 body {
604 font-family: 'Inter', sans-serif;
12 },
13 {
14 prompt: "weather dashboard for nyc using open-meteo API for NYC with icons",
15 title: "Weather App",
16 code:
6
71. Sign up for [Cerebras](https://cloud.cerebras.ai/)
82. Get a Cerebras API Key
93. Save it in a [Val Town environment variable](https://www.val.town/settings/environment-variables) called `CEREBRAS_API_KEY`
10
11# Todos
212 } catch (error) {
213 Toastify({
214 text: "We may have hit our Cerebras Usage limits. Try again later or fork this and use your own API key.",
215 position: "center",
216 duration: 3000,
1024 };
1025 } else {
1026 const client = new Cerebras({ apiKey: Deno.env.get("CEREBRAS_API_KEY") });
1027 const completion = await client.chat.completions.create({
1028 messages: [
1149 <meta name="viewport" content="width=device-width, initial-scale=1.0">
1150 <title>CerebrasCoder</title>
1151 <link rel="preconnect" href="https://fonts.googleapis.com" />
1152 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1153 <link
1154 href="https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap"
1155 rel="stylesheet"
1156 />
1165 <meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1166 <meta property="og:type" content="website">
1167 <meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
1168
1169
12 },
13 {
14 prompt: "weather dashboard for nyc using open-meteo API for NYC with icons",
15 title: "Weather App",
16 code: