diff --git a/packages/core/elizaConfig.example.yaml b/packages/core/elizaConfig.example.yaml index 8c582244b79..f20259e63f8 100644 --- a/packages/core/elizaConfig.example.yaml +++ b/packages/core/elizaConfig.example.yaml @@ -1,6 +1,6 @@ # Load custom actions from the actions directory -# Close this into a elizaConfig.yaml file that is ignored by git +# Clone this into a elizaConfig.yaml file that is ignored by git # Paths are relative to the core/src directory diff --git a/packages/core/src/core/defaultCharacter.ts b/packages/core/src/core/defaultCharacter.ts index 3c811871d8b..9638c37c20b 100644 --- a/packages/core/src/core/defaultCharacter.ts +++ b/packages/core/src/core/defaultCharacter.ts @@ -1,4 +1,4 @@ -import { Character, ModelProvider } from "./types.ts"; +import { Character, ModelProvider, Clients } from "./types.ts"; export const defaultCharacter: Character = { name: "Eliza", @@ -6,7 +6,8 @@ export const defaultCharacter: Character = { clients: [], modelProvider: ModelProvider.LLAMALOCAL, settings: { - secrets: {}, + secrets: { + }, voice: { model: "en_US-hfc_female-medium", }, diff --git a/packages/core/src/services/OllamaService.ts b/packages/core/src/services/OllamaService.ts index 524c3471343..e031f6d3207 100644 --- a/packages/core/src/services/OllamaService.ts +++ b/packages/core/src/services/OllamaService.ts @@ -35,16 +35,21 @@ class OllamaService { private isProcessing: boolean = false; private constructor() { - debug('Constructing OllamaService'); - dotenv.config(); - this.modelName = process.env.OLLAMA_MODEL || 'llama3.2'; - this.openai = new OpenAI({ - baseURL: process.env.OLLAMA_SERVER_URL || 'http://localhost:11434/v1', - apiKey: 'ollama', - dangerouslyAllowBrowser: true - }); - debug(`Using model: ${this.modelName}`); - debug('OpenAI client initialized'); + try { + debug('Constructing OllamaService'); + dotenv.config(); + this.modelName = process.env.OLLAMA_MODEL || 'llama3.2'; + this.openai = new OpenAI({ + baseURL: process.env.OLLAMA_SERVER_URL || 'http://localhost:11434/v1', + apiKey: 'ollama', + dangerouslyAllowBrowser: true + }); + debug(`Using model: ${this.modelName}`); + debug('OpenAI client initialized'); + } catch (error) { + debug('Failed to initialize OllamaService:', error); + throw new Error(`Failed to initialize Ollama service: ${error}`); + } } public static getInstance(): OllamaService { diff --git a/packages/core/src/services/llama.ts b/packages/core/src/services/llama.ts index e213ec300ac..853cce07db6 100644 --- a/packages/core/src/services/llama.ts +++ b/packages/core/src/services/llama.ts @@ -11,11 +11,13 @@ class LlamaService implements ILlamaService { private delegate: ILlamaService; private constructor() { - const provider = settings.LOCAL_LLAMA_PROVIDER; + const provider = process.env.LOCAL_LLAMA_PROVIDER; console.log("provider: ", provider) if (provider === ModelProvider.OLLAMA) { + console.log("running ollama") this.delegate = OllamaService.getInstance(); } else { + console.log("running llama-cpp") this.delegate = LlamaCppService.getInstance(); } } diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index 84cf46532cd..12307c9f236 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -29,4 +29,4 @@ }, "include": ["src/**/*"], "exclude": ["node_modules", "dist", "src/**/*.d.ts", "types/**/*.test.ts"] -} +} \ No newline at end of file diff --git a/packages/plugin-image-generation/tsconfig.json b/packages/plugin-image-generation/tsconfig.json index eaa78145aa3..ddce25b9a91 100644 --- a/packages/plugin-image-generation/tsconfig.json +++ b/packages/plugin-image-generation/tsconfig.json @@ -1,8 +1,15 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "outDir": "dist", - "rootDir": "./src" + "outDir": "dist", + "rootDir": ".", + "module": "ESNext", + "moduleResolution": "Bundler", + "types": ["node"] }, - "include": ["src"] -} + "include": ["src"], + "references": [ + { "path": "../core" } + ] + } + \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8e52635862d..8bb1eadc858 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -199,7 +199,7 @@ importers: version: 0.0.13 ai: specifier: ^3.4.23 - version: 3.4.33(openai@4.69.0(encoding@0.1.13)(zod@3.23.8))(react@18.2.0)(sswr@2.1.0(svelte@5.1.11))(svelte@5.1.11)(vue@3.5.12(typescript@5.6.3))(zod@3.23.8) + version: 3.4.33(openai@4.69.0(encoding@0.1.13)(zod@3.23.8))(react@18.2.0)(sswr@2.1.0(svelte@5.1.12))(svelte@5.1.12)(vue@3.5.12(typescript@5.6.3))(zod@3.23.8) alawmulaw: specifier: 6.0.0 version: 6.0.0 @@ -5110,8 +5110,8 @@ packages: cross-fetch@4.0.0: resolution: {integrity: sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==} - cross-spawn@7.0.3: - resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + cross-spawn@7.0.4: + resolution: {integrity: sha512-9KdyVPPtLHjPAD7tcuzSFs64UfHlLJt7U6qP4/bFVLyjLceyizj6s6jO6YBaV5d0G7g/9KnY/dOpLR4Rcg8YDg==} engines: {node: '>= 8'} crypto-hash@1.3.0: @@ -10628,8 +10628,8 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - svelte@5.1.11: - resolution: {integrity: sha512-XpPcUBKCg2c+L0nDTkv0ekc8LOHMzN328MNOeAHt4sRcX5AROU9tkqwL35VvE6srt8RpmnzsXBGDwyRB5TSbuw==} + svelte@5.1.12: + resolution: {integrity: sha512-U9BwbSybb9QAKAHg4hl61hVBk97U2QjUKmZa5++QEGoi6Nml6x6cC9KmNT1XObGawToN3DdLpdCs/Z5Yl5IXjQ==} engines: {node: '>=18'} svg-parser@2.0.4: @@ -11756,13 +11756,13 @@ snapshots: transitivePeerDependencies: - zod - '@ai-sdk/svelte@0.0.57(svelte@5.1.11)(zod@3.23.8)': + '@ai-sdk/svelte@0.0.57(svelte@5.1.12)(zod@3.23.8)': dependencies: '@ai-sdk/provider-utils': 1.0.22(zod@3.23.8) '@ai-sdk/ui-utils': 0.0.50(zod@3.23.8) - sswr: 2.1.0(svelte@5.1.11) + sswr: 2.1.0(svelte@5.1.12) optionalDependencies: - svelte: 5.1.11 + svelte: 5.1.12 transitivePeerDependencies: - zod @@ -16514,13 +16514,13 @@ snapshots: clean-stack: 2.2.0 indent-string: 4.0.0 - ai@3.4.33(openai@4.69.0(encoding@0.1.13)(zod@3.23.8))(react@18.2.0)(sswr@2.1.0(svelte@5.1.11))(svelte@5.1.11)(vue@3.5.12(typescript@5.6.3))(zod@3.23.8): + ai@3.4.33(openai@4.69.0(encoding@0.1.13)(zod@3.23.8))(react@18.2.0)(sswr@2.1.0(svelte@5.1.12))(svelte@5.1.12)(vue@3.5.12(typescript@5.6.3))(zod@3.23.8): dependencies: '@ai-sdk/provider': 0.0.26 '@ai-sdk/provider-utils': 1.0.22(zod@3.23.8) '@ai-sdk/react': 0.0.70(react@18.2.0)(zod@3.23.8) '@ai-sdk/solid': 0.0.54(zod@3.23.8) - '@ai-sdk/svelte': 0.0.57(svelte@5.1.11)(zod@3.23.8) + '@ai-sdk/svelte': 0.0.57(svelte@5.1.12)(zod@3.23.8) '@ai-sdk/ui-utils': 0.0.50(zod@3.23.8) '@ai-sdk/vue': 0.0.59(vue@3.5.12(typescript@5.6.3))(zod@3.23.8) '@opentelemetry/api': 1.9.0 @@ -16532,8 +16532,8 @@ snapshots: optionalDependencies: openai: 4.69.0(encoding@0.1.13)(zod@3.23.8) react: 18.2.0 - sswr: 2.1.0(svelte@5.1.11) - svelte: 5.1.11 + sswr: 2.1.0(svelte@5.1.12) + svelte: 5.1.12 zod: 3.23.8 transitivePeerDependencies: - solid-js @@ -17691,7 +17691,7 @@ snapshots: cross-env@7.0.3: dependencies: - cross-spawn: 7.0.3 + cross-spawn: 7.0.4 cross-fetch@3.1.5(encoding@0.1.13): dependencies: @@ -17711,7 +17711,7 @@ snapshots: transitivePeerDependencies: - encoding - cross-spawn@7.0.3: + cross-spawn@7.0.4: dependencies: path-key: 3.1.1 shebang-command: 2.0.0 @@ -18590,7 +18590,7 @@ snapshots: '@types/json-schema': 7.0.15 ajv: 6.12.6 chalk: 4.1.2 - cross-spawn: 7.0.3 + cross-spawn: 7.0.4 debug: 4.3.7(supports-color@5.5.0) escape-string-regexp: 4.0.0 eslint-scope: 8.2.0 @@ -18727,7 +18727,7 @@ snapshots: execa@5.0.0: dependencies: - cross-spawn: 7.0.3 + cross-spawn: 7.0.4 get-stream: 6.0.0 human-signals: 2.1.0 is-stream: 2.0.0 @@ -18739,7 +18739,7 @@ snapshots: execa@5.1.1: dependencies: - cross-spawn: 7.0.3 + cross-spawn: 7.0.4 get-stream: 6.0.1 human-signals: 2.1.0 is-stream: 2.0.1 @@ -18751,7 +18751,7 @@ snapshots: execa@8.0.1: dependencies: - cross-spawn: 7.0.3 + cross-spawn: 7.0.4 get-stream: 8.0.1 human-signals: 5.0.0 is-stream: 3.0.0 @@ -18831,7 +18831,7 @@ snapshots: extract-zip@2.0.1: dependencies: - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.4 get-stream: 5.2.0 yauzl: 2.10.0 optionalDependencies: @@ -19025,7 +19025,7 @@ snapshots: foreground-child@3.3.0: dependencies: - cross-spawn: 7.0.3 + cross-spawn: 7.0.4 signal-exit: 4.1.0 forever-agent@0.6.1: {} @@ -21963,7 +21963,7 @@ snapshots: chmodrp: 1.0.2 cmake-js: 7.3.0 cross-env: 7.0.3 - cross-spawn: 7.0.3 + cross-spawn: 7.0.4 env-var: 7.5.0 filenamify: 6.0.0 fs-extra: 11.2.0 @@ -23359,7 +23359,7 @@ snapshots: address: 1.2.2 browserslist: 4.24.2 chalk: 4.1.2 - cross-spawn: 7.0.3 + cross-spawn: 7.0.4 detect-port-alt: 1.1.6 escape-string-regexp: 4.0.0 filesize: 8.0.7 @@ -24398,9 +24398,9 @@ snapshots: dependencies: minipass: 7.1.2 - sswr@2.1.0(svelte@5.1.11): + sswr@2.1.0(svelte@5.1.12): dependencies: - svelte: 5.1.11 + svelte: 5.1.12 swrev: 4.0.0 stack-utils@2.0.6: @@ -24574,7 +24574,7 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} - svelte@5.1.11: + svelte@5.1.12: dependencies: '@ampproject/remapping': 2.3.0 '@jridgewell/sourcemap-codec': 1.5.0