Skip to content

Commit

Permalink
Add support for Agents/Assistants (#2286)
Browse files Browse the repository at this point in the history
  • Loading branch information
misscoded authored Oct 17, 2024
1 parent 70debca commit 1ebd657
Show file tree
Hide file tree
Showing 7 changed files with 1,204 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ import { StringIndexed } from './types/helpers';
// eslint-disable-next-line import/order
import allSettled = require('promise.allsettled'); // eslint-disable-line @typescript-eslint/no-require-imports
import { FunctionCompleteFn, FunctionFailFn, CustomFunction, CustomFunctionMiddleware } from './CustomFunction';
import { Assistant } from './Assistant';
// eslint-disable-next-line @typescript-eslint/no-require-imports, import/no-commonjs
const packageJson = require('../package.json'); // eslint-disable-line @typescript-eslint/no-var-requires

Expand Down Expand Up @@ -519,6 +520,17 @@ export default class App<AppCustomContext extends StringIndexed = StringIndexed>
return this;
}

/**
* Register Assistant middleware
*
* @param assistant global assistant middleware function
*/
public assistant(assistant: Assistant): this {
const m = assistant.getMiddleware();
this.middleware.push(m);
return this;
}

/**
* Register WorkflowStep middleware
*
Expand Down
492 changes: 492 additions & 0 deletions src/Assistant.spec.ts

Large diffs are not rendered by default.

Loading

0 comments on commit 1ebd657

Please sign in to comment.