From e154ee6f8c403c0255dc0b667e8f6d8665cab817 Mon Sep 17 00:00:00 2001 From: Tomas Dvorak Date: Mon, 13 Jan 2025 19:37:15 +0100 Subject: [PATCH] =?UTF-8?q?feat!:=20bump=20bee-=C4=85gent-framework=20amd?= =?UTF-8?q?=20bee-code-interpreter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomas Dvorak --- .env.template | 8 +--- README.md | 2 +- docker-compose.yml | 2 +- infra/bee-code-interpreter.yaml | 10 ++--- package-lock.json | 71 ++------------------------------- package.json | 2 +- src/helpers/llm.ts | 9 ----- 7 files changed, 14 insertions(+), 90 deletions(-) diff --git a/.env.template b/.env.template index 2d835b4..7fd329d 100644 --- a/.env.template +++ b/.env.template @@ -1,4 +1,4 @@ -# LLM Provider (watsonx/ollama/openai/groq/bam) +# LLM Provider (watsonx/ollama/openai/groq) LLM_BACKEND="ollama" ## WatsonX @@ -19,10 +19,6 @@ LLM_BACKEND="ollama" # GROQ_API_KEY="" # GROQ_MODEL="llama-3.1-70b-versatile" -## BAM -# GENAI_API_KEY="" -# GENAI_MODEL="meta-llama/llama-3-1-70b-instruct" - ## Azure OpenAI # OPENAI_MODEL="gpt-4o-mini" # OPENAI_API_VERSION="2024-08-01-preview" @@ -36,7 +32,7 @@ LLM_BACKEND="ollama" # VERTEXAI_PROJECT="" # Tools -CODE_INTERPRETER_URL="http://127.0.0.1:50051" +CODE_INTERPRETER_URL="http://127.0.0.1:50081" # Framework related BEE_FRAMEWORK_LOG_PRETTY=true diff --git a/README.md b/README.md index 218d718..a4f1cf9 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ The [Bee Code Interpreter](https://github.com/i-am-bee/bee-code-interpreter) is > [!NOTE] > -> Code Interpreter runs on `http://127.0.0.1:50051`. +> Code Interpreter runs on `http://127.0.0.1:50081`. ## 🔎 Observability diff --git a/docker-compose.yml b/docker-compose.yml index 1298630..3dba5a1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,7 +20,7 @@ services: - ${CODE_INTEPRETER_TMPDIR:-./tmp/code_interpreter_target}:/storage - ./infra/bee-code-interpreter.yaml:/var/lib/rancher/k3s/server/manifests/bee-code-interpreter.yaml ports: - - "50051:30051" + - "50081:30051" healthcheck: test: "kubectl get pod code-interpreter | grep Running" interval: 10s diff --git a/infra/bee-code-interpreter.yaml b/infra/bee-code-interpreter.yaml index ce4218f..03e85c1 100644 --- a/infra/bee-code-interpreter.yaml +++ b/infra/bee-code-interpreter.yaml @@ -35,12 +35,12 @@ spec: serviceAccountName: code-interpreter-sa containers: - name: code-interpreter - image: icr.io/i-am-bee/bee-code-interpreter:0.0.28 + image: icr.io/i-am-bee/bee-code-interpreter:0.0.29 ports: - - containerPort: 50051 + - containerPort: 50081 env: - name: APP_EXECUTOR_IMAGE - value: icr.io/i-am-bee/bee-code-executor:0.0.28 + value: icr.io/i-am-bee/bee-code-executor:0.0.29 - name: APP_FILE_STORAGE_PATH value: /storage - name: APP_EXECUTOR_POD_QUEUE_TARGET_LENGTH @@ -61,8 +61,8 @@ metadata: spec: type: NodePort ports: - - port: 50051 - targetPort: 50051 + - port: 50081 + targetPort: 50081 nodePort: 30051 selector: app: code-interpreter diff --git a/package-lock.json b/package-lock.json index b4cb979..c30fe53 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "@google-cloud/vertexai": "^1.9.2", "@ibm-generative-ai/node-sdk": "^3.2.4", "@opentelemetry/sdk-node": "^0.57.0", - "bee-agent-framework": "^0.0.56", + "bee-agent-framework": "^0.0.57", "bee-observe-connector": "^0.0.6", "dotenv": "^16.4.5", "groq-sdk": "^0.7.0", @@ -77,34 +77,6 @@ "node": ">=6.9.0" } }, - "node_modules/@bufbuild/protobuf": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-1.10.0.tgz", - "integrity": "sha512-QDdVFLoN93Zjg36NoQPZfsVH9tZew7wKDKyV5qRdj8ntT4wQCOradQjRaTdwMhWUYsgKsvCINKKm87FdEk96Ag==" - }, - "node_modules/@connectrpc/connect": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/@connectrpc/connect/-/connect-1.6.1.tgz", - "integrity": "sha512-KchMDNtU4CDTdkyf0qG7ugJ6qHTOR/aI7XebYn3OTCNagaDYWiZUVKgRgwH79yeMkpNgvEUaXSK7wKjaBK9b/Q==", - "peerDependencies": { - "@bufbuild/protobuf": "^1.10.0" - } - }, - "node_modules/@connectrpc/connect-node": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/@connectrpc/connect-node/-/connect-node-1.6.1.tgz", - "integrity": "sha512-DxcD1wsF/aX9GegjAtl7VbpiZNjVJozy87VbaFoN6AF0Ln1Q757r5dgV59Gz0wmlk5f17txUsrEr1f2inlnnAg==", - "dependencies": { - "undici": "^5.28.4" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@bufbuild/protobuf": "^1.10.0", - "@connectrpc/connect": "1.6.1" - } - }, "node_modules/@esbuild/aix-ppc64": { "version": "0.23.1", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.23.1.tgz", @@ -626,14 +598,6 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@fastify/busboy": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", - "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", - "engines": { - "node": ">=14" - } - }, "node_modules/@google-cloud/vertexai": { "version": "1.9.2", "resolved": "https://registry.npmjs.org/@google-cloud/vertexai/-/vertexai-1.9.2.tgz", @@ -2020,18 +1984,15 @@ ] }, "node_modules/bee-agent-framework": { - "version": "0.0.56", - "resolved": "https://registry.npmjs.org/bee-agent-framework/-/bee-agent-framework-0.0.56.tgz", - "integrity": "sha512-ve22/E60e8ckZatonNZYhc+lwHbXlaylvzqc7TyIxHSxHlcTYnn0TRtKO1BjV4UZePjjojwMDTpnFYb8NhmX+w==", + "version": "0.0.57", + "resolved": "https://registry.npmjs.org/bee-agent-framework/-/bee-agent-framework-0.0.57.tgz", + "integrity": "sha512-Ne4ZIb/h2R2kWTXAW+FEe+xQrZQQHhooFoahE2gzxFXgJZP5v4XuuMEKFc2Epa534Mh6TCvazntmFT23qgmTiQ==", "dependencies": { "@ai-zen/node-fetch-event-source": "^2.1.4", - "@connectrpc/connect": "^1.6.1", - "@connectrpc/connect-node": "^1.6.1", "@opentelemetry/api": "^1.9.0", "@streamparser/json": "^0.0.21", "ajv": "^8.17.1", "ajv-formats": "^3.0.1", - "bee-proto": "0.0.2", "duck-duck-scrape": "^2.2.7", "fast-xml-parser": "^4.5.0", "header-generator": "^2.1.57", @@ -2062,7 +2023,6 @@ "@googleapis/customsearch": "^3.2.0", "@grpc/grpc-js": "^1.11.3", "@grpc/proto-loader": "^0.7.13", - "@ibm-generative-ai/node-sdk": "~3.2.4", "@langchain/community": ">=0.2.28", "@langchain/core": ">=0.2.27", "@modelcontextprotocol/sdk": "^1.0.4", @@ -2094,9 +2054,6 @@ "@grpc/proto-loader": { "optional": true }, - "@ibm-generative-ai/node-sdk": { - "optional": true - }, "@langchain/community": { "optional": true }, @@ -2156,15 +2113,6 @@ "bee-agent-framework": ">=0.0.27 <0.1.0" } }, - "node_modules/bee-proto": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/bee-proto/-/bee-proto-0.0.2.tgz", - "integrity": "sha512-UgBcejkBslLdR39ozpDtX6gjD3OgB1pZS7GDO4v2CfthZhddwfzco/BdEd5IdeMX9d+srX7LgsBGOtn48djNWg==", - "dependencies": { - "@bufbuild/protobuf": "^1.10.0", - "@connectrpc/connect": "^1.4.0" - } - }, "node_modules/bignumber.js": { "version": "9.1.2", "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", @@ -5633,17 +5581,6 @@ } } }, - "node_modules/undici": { - "version": "5.28.4", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz", - "integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==", - "dependencies": { - "@fastify/busboy": "^2.0.0" - }, - "engines": { - "node": ">=14.0" - } - }, "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", diff --git a/package.json b/package.json index be9dc41..db40d5d 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@google-cloud/vertexai": "^1.9.2", "@ibm-generative-ai/node-sdk": "^3.2.4", "@opentelemetry/sdk-node": "^0.57.0", - "bee-agent-framework": "^0.0.56", + "bee-agent-framework": "^0.0.57", "bee-observe-connector": "^0.0.6", "dotenv": "^16.4.5", "groq-sdk": "^0.7.0", diff --git a/src/helpers/llm.ts b/src/helpers/llm.ts index c068944..fe19ece 100644 --- a/src/helpers/llm.ts +++ b/src/helpers/llm.ts @@ -2,8 +2,6 @@ import { ChatLLM, ChatLLMOutput } from "bee-agent-framework/llms/chat"; import { getEnv, parseEnv } from "bee-agent-framework/internals/env"; import { z } from "zod"; import { WatsonXChatLLM } from "bee-agent-framework/adapters/watsonx/chat"; -import { BAMChatLLM } from "bee-agent-framework/adapters/bam/chat"; -import { Client as BAMSDK } from "@ibm-generative-ai/node-sdk"; import { OpenAIChatLLM } from "bee-agent-framework/adapters/openai/chat"; import { OllamaChatLLM } from "bee-agent-framework/adapters/ollama/chat"; import { GroqChatLLM } from "bee-agent-framework/adapters/groq/chat"; @@ -12,7 +10,6 @@ import { Ollama } from "ollama"; import Groq from "groq-sdk"; export const Providers = { - BAM: "bam", WATSONX: "watsonx", OLLAMA: "ollama", OPENAI: "openai", @@ -23,12 +20,6 @@ export const Providers = { type Provider = (typeof Providers)[keyof typeof Providers]; export const LLMFactories: Record ChatLLM> = { - [Providers.BAM]: () => - BAMChatLLM.fromPreset(getEnv("GENAI_MODEL") || "meta-llama/llama-3-1-70b-instruct", { - client: new BAMSDK({ - apiKey: getEnv("GENAI_API_KEY"), - }), - }), [Providers.GROQ]: () => new GroqChatLLM({ modelId: getEnv("GROQ_MODEL") || "llama-3.1-70b-versatile",