Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(embeddings): use framework embeddings, refactor ai providers #143

Merged
merged 3 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,7 @@ RUN_BULLMQ_WORKERS=runs,runs-cleanup,vectorStores-cleanup,vectorStores-fileProce
# --- BACKEND SECTION ---

# LLM backend, possible values are: ollama, openai, watsonx, bam, ibm-vllm
LLM_BACKEND=watsonx

# Embedding backend, possible values are: ollama, openai, watsonx, bam, caikit
EMBEDDING_BACKEND=watsonx
AI_BACKEND=watsonx
jezekra1 marked this conversation as resolved.
Show resolved Hide resolved

# Extraction backend, possible values are: docling, unstructured-opensource, unstructured-api
EXTRACTION_BACKEND=docling
Expand Down
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
src/**/grpc/types/**
dist/
playground/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ pnpm mikro-orm seeder:run
cp .env.example .env
```

- Add values the env vars: CRYPTO_CIPHER_KEY, LLM_BACKEND, EMBEDDING_BACKEND and API key for which ever provider you have chosen.
- Add values the env vars: CRYPTO_CIPHER_KEY, AI_BACKEND and API key for which ever provider you have chosen.

- Run the bee-api:

Expand Down
7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"author": "IBM Corp.",
"type": "module",
"scripts": {
"build": "vite build && cp -R src/embedding/adapters/caikit/grpc/protos dist/embedding/adapters/caikit/grpc/protos",
"build": "vite build",
"start": "node --enable-source-maps --experimental-loader=@opentelemetry/instrumentation/hook.mjs --import ./dist/opentelemetry.js ./dist/server.js",
"start:dev": "tsx watch src/server.ts | pino-pretty --singleLine",
"start:dev:nowatch": "tsx src/server.ts | pino-pretty --singleLine",
Expand All @@ -20,7 +20,6 @@
"lint": "eslint ./",
"lint:fix": "eslint --fix ./",
"ts:check": "tsc --noEmit",
"grpc:generate-types": "proto-loader-gen-types --defaults --keepCase --oneofs --longs=Number --enums=String --grpcLib=@grpc/grpc-js --outDir=./src/embedding/adapters/caikit/grpc/types ./src/embedding/adapters/caikit/grpc/protos/*.proto",
"copyright": "./scripts/copyright.sh",
"release": "release-it"
},
Expand All @@ -33,8 +32,6 @@
"@fastify/type-provider-json-schema-to-ts": "^3.0.0",
"@godaddy/terminus": "^4.12.1",
"@googleapis/customsearch": "^3.2.0",
"@grpc/grpc-js": "^1.12.2",
"@grpc/proto-loader": "^0.7.13",
"@ibm-generative-ai/node-sdk": "^3.2.4",
"@mikro-orm/core": "6.2.9",
"@mikro-orm/migrations-mongodb": "6.2.9",
Expand All @@ -49,7 +46,7 @@
"@zilliz/milvus2-sdk-node": "^2.4.4",
"ajv": "^8.17.1",
"axios": "^1.7.7",
"bee-agent-framework": "0.0.54",
"bee-agent-framework": "0.0.55",
"bullmq": "^5.34.6",
"bullmq-otel": "^1.0.1",
"cache-manager": "^5.7.6",
Expand Down
22 changes: 10 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions seeders/DatabaseSeeder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { ref, type EntityManager } from '@mikro-orm/core';
import { type EntityManager, ref } from '@mikro-orm/core';
import { Seeder } from '@mikro-orm/seeder';

import { OrganizationUserRole, ProjectRole } from '@/administration/entities/constants';
Expand All @@ -30,7 +30,8 @@ import { ProjectApiKey } from '@/administration/entities/project-api-key.entity'
import { API_KEY_PREFIX, scryptSecret } from '@/auth/utils';
import { IBM_ORGANIZATION_OWNER_ID } from '@/config';
import { redactProjectKeyValue } from '@/administration/helpers';
import { Agent, getDefaultModel } from '@/runs/execution/constants';
import { Agent } from '@/runs/execution/constants';
import { defaultAIProvider } from '@/runs/execution/provider';

const USER_EXTERNAL_ID = 'test';
const PROJECT_API_KEY = `${API_KEY_PREFIX}testkey`;
Expand Down Expand Up @@ -91,7 +92,7 @@ export class DatabaseSeeder extends Seeder {
redactedValue: redactProjectKeyValue(PROJECT_API_KEY)
});
const beeAssistant = new Assistant({
model: getDefaultModel(),
model: defaultAIProvider.createAssistantBackend().modelId,
agent: Agent.BEE,
tools: [
{
Expand Down Expand Up @@ -120,7 +121,7 @@ export class DatabaseSeeder extends Seeder {
}
});
const streamlitAssistant = new Assistant({
model: getDefaultModel(),
model: defaultAIProvider.createAssistantBackend().modelId,
agent: Agent.STREAMLIT,
tools: [],
name: 'Builder Assistant',
Expand Down
Loading
Loading