From f136a093ac998fa80c470ae2c6aeb6759112d171 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Pokorn=C3=BD?= Date: Tue, 1 Oct 2024 16:19:54 +0200 Subject: [PATCH] feat(code-interpreter): update to 0.0.11 (#41) --- docker-compose.yml | 1 + examples/agents/bee.ts | 8 ++++++-- .../k8s/bee-code-interpreter.yaml | 14 ++++++++++++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 5d60cfbb..3e855cce 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,6 +15,7 @@ services: volumes: - k3s-containerd:/var/lib/rancher/k3s/agent/containerd - ./infra/bee-code-interpreter/k8s:/var/lib/rancher/k3s/server/manifests + - ${CODE_INTEPRETER_TMPDIR:-./examples/tmp/code_interpreter}:/storage ports: - "50051:30051" healthcheck: diff --git a/examples/agents/bee.ts b/examples/agents/bee.ts index 50737d34..07a197b0 100644 --- a/examples/agents/bee.ts +++ b/examples/agents/bee.ts @@ -23,6 +23,10 @@ const llm = new OllamaChatLLM({ const codeInterpreterUrl = process.env.CODE_INTERPRETER_URL; const __dirname = dirname(fileURLToPath(import.meta.url)); +const codeInterpreterTmpdir = + process.env.CODE_INTEPRETER_TMPDIR ?? "./examples/tmp/code_interpreter"; +const localTmpdir = process.env.LOCAL_TMPDIR ?? "./examples/tmp/local"; + const agent = new BeeAgent({ llm, memory: new TokenMemory({ llm }), @@ -38,8 +42,8 @@ const agent = new BeeAgent({ new PythonTool({ codeInterpreter: { url: codeInterpreterUrl }, storage: new LocalPythonStorage({ - interpreterWorkingDir: `${__dirname}/../tmp/code_interpreter`, - localWorkingDir: `${__dirname}/../tmp/local`, + interpreterWorkingDir: `${__dirname}/../../${codeInterpreterTmpdir}`, + localWorkingDir: `${__dirname}/../../${localTmpdir}`, }), }), ] diff --git a/infra/bee-code-interpreter/k8s/bee-code-interpreter.yaml b/infra/bee-code-interpreter/k8s/bee-code-interpreter.yaml index 28a6d26f..2be8566a 100644 --- a/infra/bee-code-interpreter/k8s/bee-code-interpreter.yaml +++ b/infra/bee-code-interpreter/k8s/bee-code-interpreter.yaml @@ -35,12 +35,22 @@ spec: serviceAccountName: code-interpreter-sa containers: - name: code-interpreter - image: docker.io/iambeeagent/bee-code-interpreter:0.0.7 + image: docker.io/iambeeagent/bee-code-interpreter:0.0.11 ports: - containerPort: 50051 env: - name: APP_EXECUTOR_IMAGE - value: docker.io/iambeeagent/bee-code-executor:0.0.7 + value: docker.io/iambeeagent/bee-code-executor:0.0.11 + - name: APP_FILE_STORAGE_PATH + value: /storage + volumeMounts: + - name: storage-volume + mountPath: /storage + volumes: + - name: storage-volume + hostPath: + path: /storage + type: Directory --- apiVersion: v1 kind: Service