diff options
| author | Xe Iaso <me@xeiaso.net> | 2024-08-27 17:54:42 -0400 |
|---|---|---|
| committer | Xe Iaso <me@xeiaso.net> | 2024-08-27 17:54:42 -0400 |
| commit | 57284a25058002911ee571a576740888b6086313 (patch) | |
| tree | ae863c83e4feb3ba406a75fe4681097510c5e924 /cmd | |
| parent | 374d545192421c08bff8283550525b5fd6600425 (diff) | |
| download | x-57284a25058002911ee571a576740888b6086313.tar.xz x-57284a25058002911ee571a576740888b6086313.zip | |
cmd/mimi: fix tool use
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/mimi/manifest/deployment.yaml | 7 | ||||
| -rw-r--r-- | cmd/mimi/manifest/pvc.yaml | 2 | ||||
| -rw-r--r-- | cmd/mimi/modules/discord/jufra/jufra.go | 2 | ||||
| -rw-r--r-- | cmd/mimi/modules/discord/jufra/system-prompt.txt | 2 | ||||
| -rw-r--r-- | cmd/mimi/modules/discord/jufra/tools.go | 5 |
5 files changed, 14 insertions, 4 deletions
diff --git a/cmd/mimi/manifest/deployment.yaml b/cmd/mimi/manifest/deployment.yaml index 3d92e40..bbd8141 100644 --- a/cmd/mimi/manifest/deployment.yaml +++ b/cmd/mimi/manifest/deployment.yaml @@ -17,6 +17,9 @@ spec: secretName: irc - name: tmp emptyDir: {} + - name: data + persistentVolumeClaim: + claimName: mimi securityContext: fsGroup: 1000 containers: @@ -56,6 +59,8 @@ spec: value: ":9002" - name: OLLAMA_HOST value: "http://ollama" + - name: JUFRA_MIMI_MODEL + value: hermes3:70b volumeMounts: - name: mimi readOnly: true @@ -65,3 +70,5 @@ spec: mountPath: "/run/secrets/irc" - name: tmp mountPath: "/tmp" + - name: data + mountPath: "/data" diff --git a/cmd/mimi/manifest/pvc.yaml b/cmd/mimi/manifest/pvc.yaml index f5c85dd..6542a3d 100644 --- a/cmd/mimi/manifest/pvc.yaml +++ b/cmd/mimi/manifest/pvc.yaml @@ -5,7 +5,7 @@ metadata: spec: accessModes: - ReadWriteMany - storageClassName: longhorn + storageClassName: itsuki resources: requests: storage: 2Gi diff --git a/cmd/mimi/modules/discord/jufra/jufra.go b/cmd/mimi/modules/discord/jufra/jufra.go index c216b8c..9357dd5 100644 --- a/cmd/mimi/modules/discord/jufra/jufra.go +++ b/cmd/mimi/modules/discord/jufra/jufra.go @@ -249,7 +249,7 @@ func (m *Module) messageCreate(s *discordgo.Session, mc *discordgo.MessageCreate Options: map[string]any{ "num_ctx": 65536, }, - //Tools: m.getTools(), + Tools: m.getTools(), } resp, err := m.ollama.Chat(context.Background(), cr) diff --git a/cmd/mimi/modules/discord/jufra/system-prompt.txt b/cmd/mimi/modules/discord/jufra/system-prompt.txt index 4a9fff0..62eed79 100644 --- a/cmd/mimi/modules/discord/jufra/system-prompt.txt +++ b/cmd/mimi/modules/discord/jufra/system-prompt.txt @@ -1 +1 @@ -You are good at programming and a hacker. Your name is Mimi and you work for Techaro. You have brown hair and cat ears. Don't mention either your name, employer, or species unless you are asked directly. Be polite and bubbly. Do not reply in JSON. Don't end sentences in periods unless you are being serious and use lower case when possible.
\ No newline at end of file +You are good at programming and a hacker. Your name is Mimi and you work for Techaro. You have brown hair and cat ears. Don't mention either your name, employer, or species unless you are asked directly. Be polite and bubbly. Do not reply in JSON. Don't end sentences in periods unless you are being serious and use lowercase when possible.
\ No newline at end of file diff --git a/cmd/mimi/modules/discord/jufra/tools.go b/cmd/mimi/modules/discord/jufra/tools.go index 71f7c4c..d14e355 100644 --- a/cmd/mimi/modules/discord/jufra/tools.go +++ b/cmd/mimi/modules/discord/jufra/tools.go @@ -4,6 +4,7 @@ import ( "context" "encoding/json" "errors" + "log/slog" "os" "within.website/x/llm/codeinterpreter/python" @@ -13,7 +14,7 @@ import ( var normalTools = []ollama.Function{ { Name: "code_interpreter", - Description: "Run the given Python code in a sandboxed environment", + Description: "Run the given Python code.", Parameters: ollama.Param{ Type: "object", Properties: ollama.Properties{ @@ -78,6 +79,8 @@ func (m *Module) runPythonCode(ctx context.Context, tc ollama.ToolCall) (*ollama }, nil } + slog.Info("python code ran", "res", res, "args", args) + return &ollama.Message{ Role: "tool", Content: jsonString(res), |
