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

# autogen.agentchat.contrib.agent_optimizer.execute_func

<code class="doc-symbol doc-symbol-heading doc-symbol-function" />

#### execute\_func

```python theme={null}
execute_func(
    name,
    packages,
    code,
    **args
) -> 
```

The wrapper for generated functions.

<b>Parameters:</b>

| Name       | Description |
| ---------- | ----------- |
| `name`     |             |
| `packages` |             |
| `code`     |             |
| `**args`   |             |

<br />
