Search
Code3,285
1. When a new message is posted in a configured Slack channel (ie. #bugs, or #support), Slack sends an event to this Val2. The val makes an OpenAI call to determine if the message is a bug 3. If it is, then it searches GitHub for semantically related open issues with a separate OpenAI call4. It posts a comment in the Slack thread with links to related GitHub issues, with a "Relevance Score"
*/import { OpenAI } from "https://esm.town/v/std/openai";import { Octokit } from "https://esm.sh/@octokit/rest@20.0.2";import { WebClient } from "https://esm.sh/@slack/web-api@7.0.2";async function isBugReportLLM(text: string): Promise<boolean> { try { // Check if OpenAI API key is available if (!Deno.env.get("OPENAI_API_KEY")) { console.warn("OpenAI API key not found - bug detection disabled"); return false; } const openai = new OpenAI(); const completion = await openai.chat.completions.create({ messages: [ {async function findRelatedIssues(slackMessage: string, issues: any[]): Promise<any[]> { try { // Check if OpenAI API key is available if (!Deno.env.get("OPENAI_API_KEY")) { return []; } }).join("\n\n"); const openai = new OpenAI(); const completion = await openai.chat.completions.create({ messages: [ {
1. When a new message is posted in a configured Slack channel (ie. #bugs, or #support), Slack sends an event to this Val2. The val makes an OpenAI call to determine if the message is a bug 3. If it is, then it searches GitHub for semantically related open issues with a separate OpenAI call4. It posts a comment in the Slack thread with links to related GitHub issues, with a "Relevance Score"
export default async function(req: Request) { const { OpenAI } = await import("https://esm.town/v/std/openai"); const { PDFExtract } = await import("npm:pdf.js-extract"); const action = url.searchParams.get("action"); const sourceUrl = import.meta.url.replace("esm.town", "val.town"); const openai = new OpenAI(); const MAX_TEXT_SUGGEST = 20000; const MAX_TEXT_ANALYZE = 30000; agentName: string, ): Promise<object> { log.push({ agent: agentName, type: "step", message: `Calling OpenAI gpt-4o...` }); try { const response = await openai.chat.completions.create({ model: "gpt-4o", messages: [{ role: "system", content: systemPrompt }, { role: "user", content: userMessage }],
Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.### OpenAI```tsimport { OpenAI } from "https://esm.town/v/std/openai";const openai = new OpenAI();const completion = await openai.chat.completions.create({messages: [{ role: "user", content: "Say hello in a creative way" },
Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.### OpenAI```tsimport { OpenAI } from "https://esm.town/v/std/openai";const openai = new OpenAI();const completion = await openai.chat.completions.create({ messages: [ { role: "user", content: "Say hello in a creative way" },
Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.### OpenAI```tsimport { OpenAI } from "https://esm.town/v/std/openai";const openai = new OpenAI();const completion = await openai.chat.completions.create({ messages: [ { role: "user", content: "Say hello in a creative way" },
Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.### OpenAI```tsimport { OpenAI } from "https://esm.town/v/std/openai";const openai = new OpenAI();const completion = await openai.chat.completions.create({ messages: [ { role: "user", content: "Say hello in a creative way" },
Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.### OpenAI```tsimport { OpenAI } from "https://esm.town/v/std/openai";const openai = new OpenAI();const completion = await openai.chat.completions.create({ messages: [ { role: "user", content: "Say hello in a creative way" },
Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.### OpenAI```tsimport { OpenAI } from "https://esm.town/v/std/openai";const openai = new OpenAI();const completion = await openai.chat.completions.create({ messages: [ { role: "user", content: "Say hello in a creative way" },
reconsumeralization
import { OpenAI } from "https://esm.town/v/std/openai";
import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
/**
* Practical Implementation of Collective Content Intelligence
* Bridging advanced AI with collaborative content creation
*/
exp
kwhinnery_openai
lost1991
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",
No docs found