The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
cleanup(docs-gpt): prompt formatting
Greg Richardsonabcca19115b9
diff --git a/supabase/functions/clippy-search/index.ts b/supabase/functions/clippy-search/index.tsindex 19773944ab1..5b4a33d464e 100644--- a/supabase/functions/clippy-search/index.ts+++ b/supabase/functions/clippy-search/index.ts@@ -1,6 +1,7 @@import { serve } from 'https://deno.land/[email protected]/http/server.ts'import 'https://deno.land/x/[email protected]/mod.ts'import { createClient } from 'https://esm.sh/@supabase/[email protected]'+import { oneLine, stripIndent } from 'https://esm.sh/[email protected]'import GPT3Tokenizer from 'https://esm.sh/[email protected]'import { Configuration, CreateCompletionRequest, OpenAIApi } from 'https://esm.sh/[email protected]'import { ApplicationError, UserError } from './errors.ts'@@ -106,17 +107,25 @@ serve(async (req) => {contextText += `${content.trim()}\n---\n`}- const prompt = `You are a very enthusiastic Supabase representative who loves to help people! Given the following sections from the Supabase documentation, answer the question using only that information, outputted in markdown format. If you are unsure and the answer is not explicitly written in the documentation, say "Sorry, I don't know how to help with that."--Context sections:-${contextText}--Question: """-${sanitizedQuery}-"""--Answer as markdown (including related code snippets if available):-`+ const prompt = stripIndent`+ ${oneLine`+ You are a very enthusiastic Supabase representative who loves+ to help people! Given the following sections from the Supabase+ documentation, answer the question using only that information,+ outputted in markdown format. If you are unsure and the answer+ is not explicitly written in the documentation, say+ "Sorry, I don't know how to help with that."+ `}++ Context sections:+ ${contextText}++ Question: """+ ${sanitizedQuery}+ """++ Answer as markdown (including related code snippets if available):+ `const completionOptions: CreateCompletionRequest = {model: 'text-davinci-003',