aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2024-09-13 09:17:33 -0400
committerXe Iaso <me@xeiaso.net>2024-09-13 09:17:33 -0400
commitad25d4075754210cab5e76540740ee96d0b68f6d (patch)
treea1167994ff981772a07eb49df8338bba35e5ad33
parent8f5901e8db2de662915994df0a98c6cd72ee4774 (diff)
downloadx-ad25d4075754210cab5e76540740ee96d0b68f6d.tar.xz
x-ad25d4075754210cab5e76540740ee96d0b68f6d.zip
cmd/mimi: strawberry
Signed-off-by: Xe Iaso <me@xeiaso.net>
-rw-r--r--cmd/mimi/manifest/deployment.yaml4
-rw-r--r--cmd/mimi/modules/discord/jufra/system-prompt.txt4
-rw-r--r--cmd/mimi/modules/discord/jufra/tools.go3
-rw-r--r--llm/codeinterpreter/python/python.go10
4 files changed, 10 insertions, 11 deletions
diff --git a/cmd/mimi/manifest/deployment.yaml b/cmd/mimi/manifest/deployment.yaml
index ff7defd..ce69ee0 100644
--- a/cmd/mimi/manifest/deployment.yaml
+++ b/cmd/mimi/manifest/deployment.yaml
@@ -58,9 +58,9 @@ spec:
- name: HTTP_ADDR
value: ":9002"
- name: OLLAMA_HOST
- value: "http://ollama"
+ value: "http://ollama.ollama.svc.alrest.xeserv.us"
- name: JUFRA_MIMI_MODEL
- value: "hermes3:70b"
+ value: "hermes3"
- name: JUFRA_FLUX_HOST
value: "http://flux"
- name: JUFRA_CONTEXT_WINDOW
diff --git a/cmd/mimi/modules/discord/jufra/system-prompt.txt b/cmd/mimi/modules/discord/jufra/system-prompt.txt
index 645611f..cdf51b9 100644
--- a/cmd/mimi/modules/discord/jufra/system-prompt.txt
+++ b/cmd/mimi/modules/discord/jufra/system-prompt.txt
@@ -4,4 +4,6 @@ If you are asked to draw or illustrate something, use the draw_image tool.
If you are asked to write python code, run it with code_interpreter.
-If you are asked to draw yourself, use this description: a brown-haired anime woman with a pixie cut, brown eyes, and cat ears \ No newline at end of file
+If you are asked to draw yourself, use this description: a brown-haired anime woman with a pixie cut, brown eyes, and cat ears.
+
+If you are asked to count the number of letters in a word, do it by writing a python program and run it with code_interpreter. \ 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 07e26b6..8b7d674 100644
--- a/cmd/mimi/modules/discord/jufra/tools.go
+++ b/cmd/mimi/modules/discord/jufra/tools.go
@@ -88,6 +88,9 @@ func (m *Module) runPythonCode(ctx context.Context, tc ollama.ToolCall) (*ollama
defer os.RemoveAll(tmpdir)
+ ctx, cancel := context.WithTimeout(ctx, 30*time.Second)
+ defer cancel()
+
res, err := python.Run(ctx, tmpdir, args.Code)
if err != nil {
return &ollama.Message{
diff --git a/llm/codeinterpreter/python/python.go b/llm/codeinterpreter/python/python.go
index c90d9f6..78dd8b4 100644
--- a/llm/codeinterpreter/python/python.go
+++ b/llm/codeinterpreter/python/python.go
@@ -32,11 +32,9 @@ func init() {
}
type Result struct {
- UserCode string
Stdout string
Stderr string
PlatformError string
- Instruction string
}
func Run(ctx context.Context, tmpDir, userCode string) (*Result, error) {
@@ -66,11 +64,9 @@ func Run(ctx context.Context, tmpDir, userCode string) (*Result, error) {
mod, err := r.InstantiateModule(ctx, code, config)
if err != nil {
result := &Result{
- UserCode: userCode,
Stdout: fout.String(),
Stderr: ferr.String(),
PlatformError: err.Error(),
- Instruction: "Include the user code and any stderr or platform errors in code fences.",
}
return result, err
}
@@ -78,9 +74,7 @@ func Run(ctx context.Context, tmpDir, userCode string) (*Result, error) {
defer mod.Close(ctx)
return &Result{
- UserCode: userCode,
- Stdout: fout.String(),
- Stderr: ferr.String(),
- Instruction: "Include the user code, output, and any stderr or platform errors in code fences.",
+ Stdout: fout.String(),
+ Stderr: ferr.String(),
}, nil
}