# Type Alias SingleBeforeModelCallback

SingleBeforeModelCallback: (
params: { context: Context; request: LlmRequest },
) => LlmResponse | undefined | Promise<LlmResponse | undefined>

A callback that runs before a request is sent to the model.

#### Type Declaration

- - (
    params: { context: Context; request: LlmRequest },
    ): LlmResponse | undefined | Promise<LlmResponse | undefined>

  - #### Parameters

    - params: { context: Context; request: LlmRequest }

      - ##### context: Context

        The current callback context.

      - ##### request: LlmRequest

        The raw model request. Callback can mutate the request.

    #### Returns LlmResponse | undefined | Promise<LlmResponse | undefined>

    The content to return to the user. When present, the model call will be skipped and the provided content will be returned to user.

- Defined in agents/llm_agent.ts:88