Skip to content

Commit 4abc017

Browse files
authored
feat: system instructions (#81)
1 parent 62a9fad commit 4abc017

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ require('goose').setup({
119119
"cogito:14b"
120120
}
121121
--]]
122-
}
122+
},
123+
system_instructions = "" -- Provide additional system instructions to customize the agent's behavior
123124
})
124125
```
125126

lua/goose/config.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ M.defaults = {
6767
context = {
6868
cursor_data = false, -- Send cursor position and current line content as context data
6969
},
70+
system_instructions = "", -- Provide additional system instructions to customize the agent's behavior
7071
}
7172

7273
-- Active configuration

lua/goose/job.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
local context = require("goose.context")
55
local state = require("goose.state")
6+
local config = require("goose.config")
67
local Job = require('plenary.job')
78

89
local M = {}
@@ -12,6 +13,12 @@ function M.build_args(prompt)
1213
local message = context.format_message(prompt)
1314
local args = { "run", "--text", message }
1415

16+
local system_instructions = config.get("system_instructions")
17+
if system_instructions and system_instructions ~= "" then
18+
table.insert(args, "--system")
19+
table.insert(args, system_instructions)
20+
end
21+
1522
if state.active_session then
1623
table.insert(args, "--name")
1724
table.insert(args, state.active_session.name)

0 commit comments

Comments
 (0)