Skip to content

Commit e12a7a7

Browse files
committed
changed ctx_prompt in sys_prompt
1 parent e3bea35 commit e12a7a7

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

docs/content/advanced/springai.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export OPENAI_EMBEDDING_MODEL=text-embedding-3-small
4141
export OLLAMA_CHAT_MODEL="llama3.1"
4242
export OLLAMA_EMBEDDING_MODEL=mxbai-embed-large
4343
export OLLAMA_BASE_URL="http://<OLLAMA_SERVER>:11434"
44-
export CONTEXT_INSTR=" You are an assistant for question-answering tasks. Use the retrieved Documents and history to answer the question as accurately and comprehensively as possible. Keep your answer grounded in the facts of the Documents, be concise, and reference the Documents where possible. If you don't know the answer, just say that you are sorry as you don't haven't enough information. "
44+
export SYS_INSTR=" You are an assistant for question-answering tasks. Use the retrieved Documents and history to answer the question as accurately and comprehensively as possible. Keep your answer grounded in the facts of the Documents, be concise, and reference the Documents where possible. If you don't know the answer, just say that you are sorry as you don't haven't enough information. "
4545
export TOP_K=4
4646
export VECTOR_STORE=TEXT_EMBEDDING_3_SMALL_8191_1639_COSINE
4747
export PROVIDER=openai

src/client/content/config/tabs/settings.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,31 +173,31 @@ def spring_ai_conf_check(ll_model: dict, embed_model: dict) -> str:
173173
def spring_ai_obaas(src_dir, file_name, provider, ll_config, embed_config):
174174
"""Get the users CTX Prompt"""
175175

176-
ctx_prompt = next(
176+
sys_prompt = next(
177177
item["prompt"]
178178
for item in state.prompt_configs
179179
if item["name"] == state.client_settings["prompts"]["sys"] and item["category"] == "sys"
180180
)
181-
logger.info(f"Prompt used in export:\n{ctx_prompt}")
181+
logger.info(f"Prompt used in export:\n{sys_prompt}")
182182
with open(src_dir / "templates" / file_name, "r", encoding="utf-8") as template:
183183
template_content = template.read()
184184

185185
database_lookup = st_common.state_configs_lookup("database_configs", "name")
186186

187187
formatted_content = template_content.format(
188188
provider=provider,
189-
ctx_prompt=f"{ctx_prompt}",
189+
sys_prompt=f"{sys_prompt}",
190190
ll_model=ll_config,
191191
vector_search=embed_config,
192192
database_config=database_lookup[state.client_settings["database"]["alias"]],
193193
)
194194

195195
if file_name.endswith(".yaml"):
196-
ctx_prompt = json.dumps(ctx_prompt, indent=True) # Converts it into a valid JSON string (preserving quotes)
196+
sys_prompt = json.dumps(sys_prompt, indent=True) # Converts it into a valid JSON string (preserving quotes)
197197

198198
formatted_content = template_content.format(
199199
provider=provider,
200-
ctx_prompt=ctx_prompt,
200+
sys_prompt=sys_prompt,
201201
ll_model=ll_config,
202202
vector_search=embed_config,
203203
database_config=database_lookup[state.client_settings["database"]["alias"]],

src/client/spring_ai/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export OPENAI_EMBEDDING_MODEL=text-embedding-3-small
3232
export OLLAMA_CHAT_MODEL="llama3.1"
3333
export OLLAMA_EMBEDDING_MODEL=mxbai-embed-large
3434
export OLLAMA_BASE_URL="http://<OLLAMA_SERVER>:11434"
35-
export CONTEXT_INSTR=" You are an assistant for question-answering tasks. Use the retrieved Documents and history to answer the question as accurately and comprehensively as possible. Keep your answer grounded in the facts of the Documents, be concise, and reference the Documents where possible. If you don't know the answer, just say that you are sorry as you don't haven't enough information. "
35+
export SYS_INSTR=" You are an assistant for question-answering tasks. Use the retrieved Documents and history to answer the question as accurately and comprehensively as possible. Keep your answer grounded in the facts of the Documents, be concise, and reference the Documents where possible. If you don't know the answer, just say that you are sorry as you don't haven't enough information. "
3636
export TOP_K=4
3737
export VECTOR_STORE=TEXT_EMBEDDING_3_SMALL_8191_1639_COSINE
3838
export PROVIDER=openai

src/client/spring_ai/src/main/java/org/springframework/ai/openai/samples/helloworld/Config.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public String legacyTable(@Value("${aims.vectortable.name}") String table) {
3535
}
3636

3737
@Bean
38-
public String contextInstr(@Value("${aims.context_instr}") String instr) {
38+
public String contextInstr(@Value("${aims.sys_instr}") String instr) {
3939
return instr;
4040
}
4141

src/client/spring_ai/src/main/resources/application-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ spring:
5252
options:
5353
model: ${OLLAMA_EMBEDDING_MODEL}
5454
aims:
55-
context_instr: ${CONTEXT_INSTR}
55+
sys_instr: ${SYS_INSTR}
5656
vectortable:
5757
name: ${VECTOR_STORE}
5858
rag_params:

src/client/spring_ai/templates/obaas.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ spring:
4141
options:
4242
model: \"{vector_search[id]}\"
4343
aims:
44-
context_instr: \"{ctx_prompt}\"
44+
sys_instr: \"{sys_prompt}\"
4545
vectortable:
4646
name: {vector_search[vector_store]}
4747
rag_params:

src/client/spring_ai/templates/start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export DB_USERNAME="{database_config[user]}"
3838
export DB_PASSWORD="{database_config[password]}"
3939
export DISTANCE_TYPE="{vector_search[distance_metric]}"
4040
export INDEX_TYPE="{vector_search[index_type]}"
41-
export CONTEXT_INSTR="{ctx_prompt}"
41+
export SYS_INSTR="{sys_prompt}"
4242
export TOP_K="{vector_search[top_k]}"
4343

4444
export VECTOR_STORE="{vector_search[vector_store]}"

0 commit comments

Comments
 (0)