Skip to content

Commit 6b28229

Browse files
committed
pass default system prompt into UI
1 parent 950645f commit 6b28229

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

refact-agent/engine/src/caps.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ pub struct CodeAssistantCaps {
148148
pub running_models: Vec<String>, // check there if a model is available or not, not in other places
149149
#[serde(default)]
150150
pub caps_version: i64, // need to reload if it increases on server, that happens when server configuration changes
151-
// #[serde(default)]
152-
// pub code_chat_default_system_prompt: String,
151+
#[serde(default)]
152+
pub code_chat_default_system_prompt: String,
153153

154154
#[serde(default)]
155155
pub customization: String, // on self-hosting server, allows to customize yaml_configs & friends for all engineers

refact-agent/gui/src/components/ChatForm/PromptSelect.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
useAppDispatch,
77
useAppSelector,
88
useGetPromptsQuery,
9+
useGetCapsQuery,
910
} from "../../hooks";
1011
import { getSelectedSystemPrompt } from "../../features/Chat/Thread/selectors";
1112
import { setSystemPrompt } from "../../features/Chat/Thread/actions";
@@ -30,8 +31,10 @@ export const PromptSelect: React.FC = () => {
3031
[onSetSelectedSystemPrompt, promptsRequest.data],
3132
);
3233

34+
const caps = useGetCapsQuery();
35+
const default_system_prompt = caps.data?.code_chat_default_system_prompt ?? "default";
3336
const val = useMemo(
34-
() => Object.keys(selectedSystemPrompt)[0] ?? "default",
37+
() => Object.keys(selectedSystemPrompt)[0] ?? default_system_prompt,
3538
[selectedSystemPrompt],
3639
);
3740

0 commit comments

Comments
 (0)