diff --git a/core/llm/templates/chat.ts b/core/llm/templates/chat.ts
index bb0945042..f9f748da3 100644
--- a/core/llm/templates/chat.ts
+++ b/core/llm/templates/chat.ts
@@ -1,6 +1,16 @@
import { ChatMessage } from "../..";
import { stripImages } from "../countTokens";
+
+/**
+ * @description Template for LLAMA2 messages:
+ *
+ * [INST] <>
+ * {{ system_prompt }}
+ * <>
+ *
+ * {{ user_msg_1 }} [/INST] {{ model_answer_1 }} [INST] {{ user_msg_2 }} [/INST] {{ model_answer_2 }} [INST] {{ user_msg_3 }} [/INST]
+ */
function llama2TemplateMessages(msgs: ChatMessage[]): string {
if (msgs.length === 0) {
return "";
@@ -21,14 +31,9 @@ function llama2TemplateMessages(msgs: ChatMessage[]): string {
}
if (hasSystem) {
- const systemMessage = `
- <>
- ${msgs[0].content}
- <>
-
- `;
+ const systemMessage = `<>\n ${msgs[0].content}\n<>\n\n`;
if (msgs.length > 1) {
- prompt += `[INST] ${systemMessage}${msgs[1].content} [/INST]`;
+ prompt += `[INST] ${systemMessage} ${msgs[1].content} [/INST]`;
} else {
prompt += `[INST] ${systemMessage} [/INST]`;
return prompt;
@@ -39,7 +44,7 @@ function llama2TemplateMessages(msgs: ChatMessage[]): string {
if (msgs[i].role === "user") {
prompt += `[INST] ${msgs[i].content} [/INST]`;
} else {
- prompt += msgs[i].content + " ";
+ prompt += msgs[i].content + "\n";
}
}
diff --git a/docs/docs/walkthroughs/codebase-embeddings.md b/docs/docs/walkthroughs/codebase-embeddings.md
index e3dadf9ea..b06c246ee 100644
--- a/docs/docs/walkthroughs/codebase-embeddings.md
+++ b/docs/docs/walkthroughs/codebase-embeddings.md
@@ -96,13 +96,42 @@ We also support other methods of generating embeddings, which can be configured
### OpenAI
-OpenAI's [ada-002 embeddings](https://platform.openai.com/docs/guides/embeddings) are high dimensional embeddings that give great performance on both text and code.
+OpenAI's [embeddings](https://platform.openai.com/docs/guides/embeddings) are high dimensional embeddings that give great performance on both text and code.
+
+Configuration for text-embedding-3-small Model
+The text-embedding-3-small model offers an outstanding balance between performance and efficiency, suitable for a versatile range of applications.
```json title="~/.continue/config.json"
{
"embeddingsProvider": {
"provider": "openai",
- "model": "text-embedding-ada-002", // optional, defaults to "text-embedding-ada-002"
+ "model": "text-embedding-3-small",
+ "apiBase": "" // optional, defaults to OpenAI's API
+ }
+}
+```
+
+Configuration for text-embedding-3-large Model
+For those requiring the highest level of embedding detail and precision, the text-embedding-3-large model is the better choice.
+
+```json title="~/.continue/config.json"
+{
+ "embeddingsProvider": {
+ "provider": "openai",
+ "model": "text-embedding-3-large",
+ "apiBase": "" // optional, defaults to OpenAI's API
+ }
+}
+```
+
+Legacy Model Configuration
+For certain scenarios, you may still find the text-embedding-ada-002 model relevant. Below is the configuration example:
+
+```json title="~/.continue/config.json"
+{
+ "embeddingsProvider": {
+ "provider": "openai",
+ "model": "text-embedding-ada-002",
"apiBase": "" // optional, defaults to OpenAI's API
}
}