# Class Runner

#### Hierarchy (View Summary)

- Runner
  - InMemoryRunner

- Defined in runner/runner.ts:57

## Constructors

### constructor

- new Runner(input: RunnerConfig): Runner

  #### Parameters

  - input: RunnerConfig

  #### Returns Runner

  - Defined in runner/runner.ts:66

## Properties

### `Readonly` agent

agent: BaseAgent

- Defined in runner/runner.ts:59

### `Readonly` appName

appName: string

- Defined in runner/runner.ts:58

### `Optional` `Readonly` artifactService

artifactService?: BaseArtifactService

- Defined in runner/runner.ts:61

### `Optional` `Readonly` credentialService

credentialService?: BaseCredentialService

- Defined in runner/runner.ts:64

### `Optional` `Readonly` memoryService

memoryService?: BaseMemoryService

- Defined in runner/runner.ts:63

### `Readonly` pluginManager

pluginManager: PluginManager

- Defined in runner/runner.ts:60

### `Readonly` sessionService

sessionService: BaseSessionService

- Defined in runner/runner.ts:62

## Methods

### runAsync

- runAsync(
  params: {
  newMessage: Content;
  runConfig?: RunConfig;
  sessionId: string;
  stateDelta?: Record<string, unknown>;
  userId: string;
  },
  ): AsyncGenerator<Event, void, undefined>

  Runs the agent with the given message, and returns an async generator of events.

  #### Parameters

  - params: {
    newMessage: Content;
    runConfig?: RunConfig;
    sessionId: string;
    stateDelta?: Record<string, unknown>;
    userId: string;
    }

    - ##### newMessage: Content

      A new message to append to the session.

    - ##### `Optional` runConfig?: RunConfig

      The run config for the agent.

    - ##### sessionId: string

      The session ID of the session.

    - ##### `Optional` stateDelta?: Record<string, unknown>

      An optional state delta to apply to the session.

    - ##### userId: string

      The user ID of the session.

  #### Returns AsyncGenerator<Event, void, undefined>

  #### Yields

  The events generated by the agent.

  - Defined in runner/runner.ts:126

### runEphemeral

- runEphemeral(
  params: {
  newMessage: Content;
  runConfig?: RunConfig;
  stateDelta?: Record<string, unknown>;
  userId: string;
  },
  ): AsyncGenerator<Event, void, undefined>

  Runs the agent with a new, ephemeral session.

  #### Parameters

  - params: {
    newMessage: Content;
    runConfig?: RunConfig;
    stateDelta?: Record<string, unknown>;
    userId: string;
    }

    - ##### newMessage: Content

      A new message to append to the session.

    - ##### `Optional` runConfig?: RunConfig

      The run config for the agent.

    - ##### `Optional` stateDelta?: Record<string, unknown>

      An optional state delta to apply to the session.

    - ##### userId: string

      The user ID of the session.

  #### Returns AsyncGenerator<Event, void, undefined>

  #### Yields

  The Events generated by the agent.

  - Defined in runner/runner.ts:85