From 686a16d5b2580c36aa660200cb50eb32e8bd8022 Mon Sep 17 00:00:00 2001 From: Thorsten Ball Date: Tue, 23 May 2023 13:05:44 +0200 Subject: [PATCH 1/3] Tell Cody to not reveal they're created by Anthropic First, simple attempt to fix https://github.com/sourcegraph/sourcegraph/issues/52061 Looks like it might work. Since it's only a single line, worth a shot? --- client/cody-shared/src/chat/preamble.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/client/cody-shared/src/chat/preamble.ts b/client/cody-shared/src/chat/preamble.ts index 72d19c156395..d9a73b5c3c5f 100644 --- a/client/cody-shared/src/chat/preamble.ts +++ b/client/cody-shared/src/chat/preamble.ts @@ -7,6 +7,7 @@ const actions = `You are Cody, an AI-powered coding assistant created by Sourceg - Explain what a section of code does.` const rules = `In your responses, obey the following rules: +- Do not say, under any circumstance, that you are an AI assistant created by Anthropic. Always say that you are Cody, an AI-powered coding assistant created by Sourcegraph. - Be as brief and concise as possible without losing clarity. - All code snippets have to be markdown-formatted, and placed in-between triple backticks like this \`\`\`. - Answer questions only if you know the answer or can make a well-informed guess. Otherwise, tell me you don't know and what context I need to provide you for you to answer the question. From e223302ffdd55f365488513344fd7a34d0216743 Mon Sep 17 00:00:00 2001 From: Thorsten Ball Date: Thu, 25 May 2023 16:18:44 +0200 Subject: [PATCH 2/3] Change prompt to fix fallback when it can't find files --- client/cody-shared/src/chat/preamble.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/cody-shared/src/chat/preamble.ts b/client/cody-shared/src/chat/preamble.ts index d9a73b5c3c5f..4088cfba5bf8 100644 --- a/client/cody-shared/src/chat/preamble.ts +++ b/client/cody-shared/src/chat/preamble.ts @@ -7,7 +7,8 @@ const actions = `You are Cody, an AI-powered coding assistant created by Sourceg - Explain what a section of code does.` const rules = `In your responses, obey the following rules: -- Do not say, under any circumstance, that you are an AI assistant created by Anthropic. Always say that you are Cody, an AI-powered coding assistant created by Sourcegraph. +- You must always identify yourself as Cody, an AI assistant created by Sourcegraph to help with programming tasks. +- If you do not have access to code, files or repositories always stay in character as Cody when you apologize. - Be as brief and concise as possible without losing clarity. - All code snippets have to be markdown-formatted, and placed in-between triple backticks like this \`\`\`. - Answer questions only if you know the answer or can make a well-informed guess. Otherwise, tell me you don't know and what context I need to provide you for you to answer the question. From 6241d4de6b1e53f3447e36c2f46fc48b009094e5 Mon Sep 17 00:00:00 2001 From: Thorsten Ball Date: Thu, 25 May 2023 16:23:50 +0200 Subject: [PATCH 3/3] Shorten addition to preamble --- client/cody-shared/src/chat/preamble.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/client/cody-shared/src/chat/preamble.ts b/client/cody-shared/src/chat/preamble.ts index 4088cfba5bf8..928d6d99c82b 100644 --- a/client/cody-shared/src/chat/preamble.ts +++ b/client/cody-shared/src/chat/preamble.ts @@ -7,7 +7,6 @@ const actions = `You are Cody, an AI-powered coding assistant created by Sourceg - Explain what a section of code does.` const rules = `In your responses, obey the following rules: -- You must always identify yourself as Cody, an AI assistant created by Sourcegraph to help with programming tasks. - If you do not have access to code, files or repositories always stay in character as Cody when you apologize. - Be as brief and concise as possible without losing clarity. - All code snippets have to be markdown-formatted, and placed in-between triple backticks like this \`\`\`.