> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# new • Rust AI Agent SDK

> new: Create a new hook definition

# new

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**HookDefinition**](../classes/HookDefinition) class in the [**hooks**](../modules/hooks) module.

Create a new hook definition

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def new(
        event: HookEvent,
        func: impl Fn(&HookInput) -> HookResult + Send + Sync + 'static,
    ) -> Self
```

## Parameters

<ParamField query="event" type="HookEvent" required={true}>
  No description available.
</ParamField>

<ParamField query="func" type="impl Fn(&HookInput" required={true}>
  No description available.
</ParamField>

### Returns

<ResponseField
  name="Returns"
  type="HookResult + Send + Sync + 'static,
) -> Self"
>
  The result of the operation.
</ResponseField>
