Skip to content

Commit

Permalink
Merge pull request #46 from FellouAI/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
veasion authored Feb 5, 2025
2 parents be43a10 + dbf8bc9 commit 4e4fadb
Show file tree
Hide file tree
Showing 38 changed files with 1,475 additions and 447 deletions.
1 change: 1 addition & 0 deletions eko-browser-extension-template
Submodule eko-browser-extension-template added at 53e406
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eko-ai/eko",
"version": "1.0.8",
"version": "1.0.9",
"description": "Empowering language to transform human words into action.",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
Expand Down Expand Up @@ -102,6 +102,5 @@
},
"engines": {
"node": ">=18.0.0"
},
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
}
8 changes: 6 additions & 2 deletions publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ npm config get registry
npm config set registry=https://registry.npmjs.org

echo 'Login'
npm login
npm login

# npm version patch
# npm version minor
# npm version major

echo "Publish..."
npm publish
npm publish --access=public

npm run docs

Expand Down
6 changes: 3 additions & 3 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default [
tsconfig: './tsconfig.json',
declaration: true,
declarationDir: 'dist',
include: ['src/types/*', 'src/extension/**/*'],
include: ['src/types/*', 'src/extension/**/*', 'src/universal_tools/**/*'],
exclude: ['src/extension/script']
}),
copy({
Expand Down Expand Up @@ -115,7 +115,7 @@ export default [
tsconfig: './tsconfig.json',
declaration: true,
declarationDir: 'dist',
include: ['src/types/*', 'src/nodejs/**/*']
include: ['src/types/*', 'src/nodejs/**/*', 'src/universal_tools/**/*']
})
]
},
Expand All @@ -135,7 +135,7 @@ export default [
tsconfig: './tsconfig.json',
declaration: true,
declarationDir: 'dist',
include: ['src/types/*', 'src/nodejs/**/*']
include: ['src/types/*', 'src/nodejs/**/*', 'src/universal_tools/**/*']
}),
replace({
preventAssignment: true,
Expand Down
27 changes: 24 additions & 3 deletions src/core/eko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
ClaudeConfig,
OpenaiConfig,
WorkflowCallback,
NodeOutput,
} from '../types';
import { ToolRegistry } from './tool-registry';

Expand Down Expand Up @@ -69,13 +70,33 @@ export class Eko {
return workflow;
}

public async execute(workflow: Workflow, callback?: WorkflowCallback): Promise<NodeOutput[]> {
// Inject LLM provider at workflow level
workflow.llmProvider = this.llmProvider;

// Process each node's action
for (const node of workflow.nodes) {
if (node.action.type === 'prompt') {
// Inject LLM provider
node.action.llmProvider = this.llmProvider;

// Resolve tools
node.action.tools = node.action.tools.map(tool => {
if (typeof tool === 'string') {
return this.toolRegistry.getTool(tool);
}
return tool;
});
}
}

return await workflow.execute(callback);
}

public async cancel(workflow: Workflow): Promise<void> {
return await workflow.cancel();
}

public async execute(workflow: Workflow, callback?: WorkflowCallback): Promise<void> {
return await workflow.execute(callback);
}

public async modify(workflow: Workflow, prompt: string): Promise<Workflow> {
const generator = this.workflowGeneratorMap.get(workflow) as WorkflowGenerator;
Expand Down
Loading

0 comments on commit 4e4fadb

Please sign in to comment.