Skip to content

Commit 6878f85

Browse files
skeptrunedevcdxker
authored andcommitted
cleanup: change default prompt such that LLM does not provide citations by default
1 parent 6f2ad36 commit 6878f85

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

clients/ts-sdk/openapi.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7102,7 +7102,7 @@
71027102
"MESSAGE_TO_QUERY_PROMPT": "Write a 1-2 sentence semantic search query along the lines of a hypothetical response to: \n\n",
71037103
"N_RETRIEVALS_TO_INCLUDE": 8,
71047104
"PRESENCE_PENALTY": 0.0,
7105-
"RAG_PROMPT": "Use the following retrieved documents in your response. Include footnotes in the format of the document number that you used for a sentence in square brackets at the end of the sentences like [^n] where n is the doc number. These are the docs:",
7105+
"RAG_PROMPT": "Use the following retrieved documents to respond briefly and accurately:",
71067106
"SEMANTIC_ENABLED": true,
71077107
"STOP_TOKENS": [
71087108
"\n\n",
@@ -7358,7 +7358,7 @@
73587358
"MESSAGE_TO_QUERY_PROMPT": "Write a 1-2 sentence semantic search query along the lines of a hypothetical response to: \n\n",
73597359
"N_RETRIEVALS_TO_INCLUDE": 8,
73607360
"PRESENCE_PENALTY": 0.0,
7361-
"RAG_PROMPT": "Use the following retrieved documents in your response. Include footnotes in the format of the document number that you used for a sentence in square brackets at the end of the sentences like [^n] where n is the doc number. These are the docs:",
7361+
"RAG_PROMPT": "Use the following retrieved documents to respond briefly and accurately:",
73627362
"SEMANTIC_ENABLED": true,
73637363
"STOP_TOKENS": [
73647364
"\n\n",
@@ -7619,7 +7619,7 @@
76197619
"MESSAGE_TO_QUERY_PROMPT": "Write a 1-2 sentence semantic search query along the lines of a hypothetical response to: \n\n",
76207620
"N_RETRIEVALS_TO_INCLUDE": 8,
76217621
"PRESENCE_PENALTY": 0.0,
7622-
"RAG_PROMPT": "Use the following retrieved documents in your response. Include footnotes in the format of the document number that you used for a sentence in square brackets at the end of the sentences like [^n] where n is the doc number. These are the docs:",
7622+
"RAG_PROMPT": "Use the following retrieved documents to respond briefly and accurately:",
76237623
"SEMANTIC_ENABLED": true,
76247624
"STOP_TOKENS": [
76257625
"\n\n",
@@ -12601,7 +12601,7 @@
1260112601
"MESSAGE_TO_QUERY_PROMPT": "Write a 1-2 sentence semantic search query along the lines of a hypothetical response to: \n\n",
1260212602
"N_RETRIEVALS_TO_INCLUDE": 8,
1260312603
"PRESENCE_PENALTY": 0.0,
12604-
"RAG_PROMPT": "Use the following retrieved documents in your response. Include footnotes in the format of the document number that you used for a sentence in square brackets at the end of the sentences like [^n] where n is the doc number. These are the docs:",
12604+
"RAG_PROMPT": "Use the following retrieved documents to respond briefly and accurately:",
1260512605
"SEMANTIC_ENABLED": true,
1260612606
"STOP_TOKENS": [
1260712607
"\n\n",
@@ -12893,7 +12893,7 @@
1289312893
"MESSAGE_TO_QUERY_PROMPT": "Write a 1-2 sentence semantic search query along the lines of a hypothetical response to: \n\n",
1289412894
"N_RETRIEVALS_TO_INCLUDE": 8,
1289512895
"PRESENCE_PENALTY": 0.0,
12896-
"RAG_PROMPT": "Use the following retrieved documents in your response. Include footnotes in the format of the document number that you used for a sentence in square brackets at the end of the sentences like [^n] where n is the doc number. These are the docs:",
12896+
"RAG_PROMPT": "Use the following retrieved documents to respond briefly and accurately:",
1289712897
"SEMANTIC_ENABLED": true,
1289812898
"STOP_TOKENS": [
1289912899
"\n\n",

server/src/data/models.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,7 +1843,7 @@ pub struct DatasetEventCount {
18431843
"EMBEDDING_BASE_URL": "https://api.openai.com/v1",
18441844
"EMBEDDING_MODEL_NAME": "text-embedding-3-small",
18451845
"MESSAGE_TO_QUERY_PROMPT": "Write a 1-2 sentence semantic search query along the lines of a hypothetical response to: \n\n",
1846-
"RAG_PROMPT": "Use the following retrieved documents in your response. Include footnotes in the format of the document number that you used for a sentence in square brackets at the end of the sentences like [^n] where n is the doc number. These are the docs:",
1846+
"RAG_PROMPT": "Use the following retrieved documents to respond briefly and accurately:",
18471847
"N_RETRIEVALS_TO_INCLUDE": 8,
18481848
"EMBEDDING_SIZE": 1536,
18491849
"DISTANCE_METRIC": "cosine",
@@ -1992,7 +1992,7 @@ pub enum DistanceMetric {
19921992
"EMBEDDING_BASE_URL": "https://api.openai.com/v1",
19931993
"EMBEDDING_MODEL_NAME": "text-embedding-3-small",
19941994
"MESSAGE_TO_QUERY_PROMPT": "Write a 1-2 sentence semantic search query along the lines of a hypothetical response to: \n\n",
1995-
"RAG_PROMPT": "Use the following retrieved documents in your response. Include footnotes in the format of the document number that you used for a sentence in square brackets at the end of the sentences like [^n] where n is the doc number. These are the docs:",
1995+
"RAG_PROMPT": "Use the following retrieved documents to respond briefly and accurately:",
19961996
"N_RETRIEVALS_TO_INCLUDE": 8,
19971997
"EMBEDDING_SIZE": 1536,
19981998
"DISTANCE_METRIC": "cosine",
@@ -2053,7 +2053,7 @@ pub struct DatasetConfiguration {
20532053
"EMBEDDING_BASE_URL": "https://api.openai.com/v1",
20542054
"EMBEDDING_MODEL_NAME": "text-embedding-3-small",
20552055
"MESSAGE_TO_QUERY_PROMPT": "Write a 1-2 sentence semantic search query along the lines of a hypothetical response to: \n\n",
2056-
"RAG_PROMPT": "Use the following retrieved documents in your response. Include footnotes in the format of the document number that you used for a sentence in square brackets at the end of the sentences like [^n] where n is the doc number. These are the docs:",
2056+
"RAG_PROMPT": "Use the following retrieved documents to respond briefly and accurately:",
20572057
"N_RETRIEVALS_TO_INCLUDE": 8,
20582058
"EMBEDDING_SIZE": 1536,
20592059
"DISTANCE_METRIC": "cosine",
@@ -2146,7 +2146,7 @@ impl From<DatasetConfigurationDTO> for DatasetConfiguration {
21462146
EMBEDDING_MODEL_NAME: dto.EMBEDDING_MODEL_NAME.unwrap_or("text-embedding-3-small".to_string()),
21472147
RERANKER_BASE_URL: dto.RERANKER_BASE_URL.unwrap_or("".to_string()),
21482148
MESSAGE_TO_QUERY_PROMPT: dto.MESSAGE_TO_QUERY_PROMPT.unwrap_or("Write a 1-2 sentence semantic search query along the lines of a hypothetical response to: \n\n".to_string()),
2149-
RAG_PROMPT: dto.RAG_PROMPT.unwrap_or("Use the following retrieved documents in your response. Include footnotes in the format of the document number that you used for a sentence in square brackets at the end of the sentences like [^n] where n is the doc number. These are the docs:".to_string()),
2149+
RAG_PROMPT: dto.RAG_PROMPT.unwrap_or("Use the following retrieved documents to respond briefly and accurately:".to_string()),
21502150
N_RETRIEVALS_TO_INCLUDE: dto.N_RETRIEVALS_TO_INCLUDE.unwrap_or(8),
21512151
EMBEDDING_SIZE: dto.EMBEDDING_SIZE.unwrap_or(1536),
21522152
DISTANCE_METRIC: dto.DISTANCE_METRIC.unwrap_or(DistanceMetric::Cosine),
@@ -2216,7 +2216,7 @@ impl Default for DatasetConfiguration {
22162216
EMBEDDING_MODEL_NAME: "text-embedding-3-small".to_string(),
22172217
RERANKER_BASE_URL: "".to_string(),
22182218
MESSAGE_TO_QUERY_PROMPT: "Write a 1-2 sentence semantic search query along the lines of a hypothetical response to: \n\n".to_string(),
2219-
RAG_PROMPT: "Use the following retrieved documents in your response. Include footnotes in the format of the document number that you used for a sentence in square brackets at the end of the sentences like [^n] where n is the doc number. These are the docs:".to_string(),
2219+
RAG_PROMPT: "Use the following retrieved documents to respond briefly and accurately:".to_string(),
22202220
N_RETRIEVALS_TO_INCLUDE: 8,
22212221
EMBEDDING_SIZE: 1536,
22222222
DISTANCE_METRIC: DistanceMetric::Cosine,
@@ -2298,16 +2298,16 @@ impl DatasetConfiguration {
22982298
}).unwrap_or("Write a 1-2 sentence semantic search query along the lines of a hypothetical response to: \n\n".to_string()),
22992299
RAG_PROMPT: configuration
23002300
.get("RAG_PROMPT")
2301-
.unwrap_or(&json!("Use the following retrieved documents in your response. Include footnotes in the format of the document number that you used for a sentence in square brackets at the end of the sentences like [^n] where n is the doc number. These are the docs:".to_string()))
2301+
.unwrap_or(&json!("Use the following retrieved documents to respond briefly and accurately:".to_string()))
23022302
.as_str()
23032303
.map(|s|
23042304
if s.is_empty() {
2305-
"Use the following retrieved documents in your response. Include footnotes in the format of the document number that you used for a sentence in square brackets at the end of the sentences like [^n] where n is the doc number. These are the docs:".to_string()
2305+
"Use the following retrieved documents to respond briefly and accurately:".to_string()
23062306
} else {
23072307
s.to_string()
23082308
}
23092309
)
2310-
.unwrap_or("Use the following retrieved documents in your response. Include footnotes in the format of the document number that you used for a sentence in square brackets at the end of the sentences like [^n] where n is the doc number. These are the docs:".to_string()),
2310+
.unwrap_or("Use the following retrieved documents to respond briefly and accurately:".to_string()),
23112311
N_RETRIEVALS_TO_INCLUDE: configuration
23122312
.get("N_RETRIEVALS_TO_INCLUDE")
23132313
.unwrap_or(&json!(5))

server/src/handlers/dataset_handler.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl FromRequest for DatasetAndOrgWithSubAndPlan {
4949
"EMBEDDING_BASE_URL": "https://api.openai.com/v1",
5050
"EMBEDDING_MODEL_NAME": "text-embedding-3-small",
5151
"MESSAGE_TO_QUERY_PROMPT": "Write a 1-2 sentence semantic search query along the lines of a hypothetical response to: \n\n",
52-
"RAG_PROMPT": "Use the following retrieved documents in your response. Include footnotes in the format of the document number that you used for a sentence in square brackets at the end of the sentences like [^n] where n is the doc number. These are the docs:",
52+
"RAG_PROMPT": "Use the following retrieved documents to respond briefly and accurately:",
5353
"N_RETRIEVALS_TO_INCLUDE": 8,
5454
"EMBEDDING_SIZE": 1536,
5555
"DISTANCE_METRIC": "cosine",
@@ -152,7 +152,7 @@ pub async fn create_dataset(
152152
"EMBEDDING_BASE_URL": "https://api.openai.com/v1",
153153
"EMBEDDING_MODEL_NAME": "text-embedding-3-small",
154154
"MESSAGE_TO_QUERY_PROMPT": "Write a 1-2 sentence semantic search query along the lines of a hypothetical response to: \n\n",
155-
"RAG_PROMPT": "Use the following retrieved documents in your response. Include footnotes in the format of the document number that you used for a sentence in square brackets at the end of the sentences like [^n] where n is the doc number. These are the docs:",
155+
"RAG_PROMPT": "Use the following retrieved documents to respond briefly and accurately:",
156156
"N_RETRIEVALS_TO_INCLUDE": 8,
157157
"EMBEDDING_SIZE": 1536,
158158
"LLM_DEFAULT_MODEL": "gpt-3.5-turbo-1106",

server/src/handlers/organization_handler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ pub async fn remove_user_from_org(
335335
"EMBEDDING_BASE_URL": "https://api.openai.com/v1",
336336
"EMBEDDING_MODEL_NAME": "text-embedding-3-small",
337337
"MESSAGE_TO_QUERY_PROMPT": "Write a 1-2 sentence semantic search query along the lines of a hypothetical response to: \n\n",
338-
"RAG_PROMPT": "Use the following retrieved documents in your response. Include footnotes in the format of the document number that you used for a sentence in square brackets at the end of the sentences like [^n] where n is the doc number. These are the docs:",
338+
"RAG_PROMPT": "Use the following retrieved documents to respond briefly and accurately:",
339339
"N_RETRIEVALS_TO_INCLUDE": 8,
340340
"EMBEDDING_SIZE": 1536,
341341
"LLM_DEFAULT_MODEL": "gpt-3.5-turbo-1106",

0 commit comments

Comments
 (0)