> ## 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.captainagent.ToolBuilder

<h2 id="autogen.agentchat.contrib.captainagent.ToolBuilder" class="doc doc-heading">
  <code class="doc-symbol doc-symbol-heading doc-symbol-class" />

  <span class="doc doc-object-name doc-class-name">ToolBuilder</span>
</h2>

```python theme={null}
ToolBuilder(
    corpus_root,
    retriever='all-mpnet-base-v2',
    type='default'
)
```

<b>Parameters:</b>

| Name                            | Description |
| ------------------------------- | ----------- |
| `corpus_root`                   |             |
| `retriever='all-mpnet-base-v2'` |             |
| `type='default'`                |             |

### Class Attributes

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

#### TOOL\_PROMPT\_DEFAULT

<br />

<br />

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

#### TOOL\_PROMPT\_USER\_DEFINED

<br />

<br />

### Instance Methods

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

#### bind

```python theme={null}
bind(
    self,
    agent: AssistantAgent,
    functions: str
) -> 
```

Binds the function to the agent so that agent is aware of it.

<b>Parameters:</b>

| Name        | Description                                                            |
| ----------- | ---------------------------------------------------------------------- |
| `agent`     | **Type:** [AssistantAgent](/docs/api-reference/autogen/AssistantAgent) |
| `functions` | **Type:** str                                                          |

<br />

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

#### bind\_user\_proxy

```python theme={null}
bind_user_proxy(
    self,
    agent: UserProxyAgent,
    tool_root: str | list
) -> 
```

Updates user proxy agent with a executor so that code executor can successfully execute function-related code.<br />Returns an updated user proxy.

<b>Parameters:</b>

| Name        | Description                                                            |
| ----------- | ---------------------------------------------------------------------- |
| `agent`     | **Type:** [UserProxyAgent](/docs/api-reference/autogen/UserProxyAgent) |
| `tool_root` | **Type:** str \| list                                                  |

<br />

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

#### retrieve

```python theme={null}
retrieve(
    self,
    query,
    top_k=3
) -> 
```

<b>Parameters:</b>

| Name      | Description |
| --------- | ----------- |
| `query`   |             |
| `top_k=3` |             |

<br />
