> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-sdk-add-methods-properties.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Sweep methods

## <Badge color="yellow" size="lg" shape="rounded">Class</Badge> wandb.apis.public.Sweep

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Sweep.agent()

Query an agent by ID for this sweep.

```python theme={null}
self,
agent_id: 'str'
```

##### Arguments

<ResponseField name="agent_id" type="str">
  The ID of the agent to look up.
</ResponseField>

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Sweep.agents()

Query the list of all agents for this sweep.

```python theme={null}
self
```

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Sweep.best\_run()

Return the best run sorted by the metric defined in config or the order passed in.

```python theme={null}
(self, order=None)
```

##### Arguments

<ResponseField name="order" type="" />

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Sweep.get()

Execute a query against the cloud backend.

```python theme={null}
(api: 'Api',
entity: 'str | None' = None,
project: 'str | None' = None,
sid: 'str | None' = None,
order: 'str | None' = None,
query: 'str | None' = None, **kwargs)
```

##### Arguments

<ResponseField name="api" type="Api">
  The W\&B API instance.
</ResponseField>

<ResponseField name="entity" type="str | None">
  The entity (username or team) that owns the project.
</ResponseField>

<ResponseField name="project" type="str | None">
  The name of the project to fetch sweep from.
</ResponseField>

<ResponseField name="sid" type="str | None">
  The sweep ID to query.
</ResponseField>

<ResponseField name="order" type="str | None">
  The order in which the sweep's runs are returned.
</ResponseField>

<ResponseField name="query" type="str | None">
  The query to use to execute the query.
</ResponseField>

<ResponseField name="kwargs" type="" />

## <Badge color="blue" size="lg" shape="rounded">method</Badge> Sweep.to\_html()

Generate HTML containing an iframe displaying this sweep.

```python theme={null}
self,
height: 'int' = 420,
hidden: 'bool' = False
```

##### Arguments

<ResponseField name="height" type="int" />

<ResponseField name="hidden" type="bool" />
