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

# Job Methods

> Reference documentation for Job Methods.

### Listing jobs

```Python theme={null}
list_jobs(self)
```

List all jobs associated with the API key.

>

**Returns:** list: A list of job details.

### Getting job status

```Python theme={null}
get_job_status(self, job_id: str)
```

Get the status of a job by its ID.

>

**Parameters:**

* `job_id` (str): The ID of the job to retrieve the status for.

>

**Returns:** dict: The status of the job.

### Getting job results

```Python theme={null}
get_job_results(self, job_id: str, include_inputs: bool = False, include_cumulative_logprobs: bool = False, with_original_df: pl.DataFrame | pd.DataFrame = None, output_column: str = 'inference_result')
```

Get the results of a job by its ID.

>

**Parameters:**

* `job_id` (str): The ID of the job to retrieve the results for.
* `include_inputs` (bool, optional): Whether to include the inputs in the results. Defaults to False.
* `include_cumulative_logprobs` (bool, optional): Whether to include the cumulative logprobs in the results. Defaults to False.
* `with_original_df` (Union\[pl.DataFrame, pd.DataFrame], optional): Original DataFrame to join results with. Defaults to None.
* `output_column` (str, optional): Name of the column containing results. Defaults to "inference\_result".
* `disable_cache` (bool, optional): Whether to disable reading from or writing to the local job results cache. Defaults to False.
* `unpack_json` (bool, optional): If the output\_column is formatted as a JSON string, decides whether to unpack the top level JSON fields in the results into separate columns. Defaults to True.

>

**Returns:** Union\[pl.DataFrame, pd.DataFrame]: Results as a DataFrame.

>

* If `with_original_df` is provided: Returns the same type as the input DataFrame with results added as a new column
* If `with_original_df` is None: Returns a polars DataFrame by default

>

The DataFrame will contain:

>

* `inputs` column (if `include_inputs=True`). Each cell contains the input string given to the model.
* `inference_result` column (or custom name via `output_column`)
* `cumulative_logprobs` column (if `include_cumulative_logprobs=True`)

>

**Example:**

>

```python theme={null}
# Get just the results
results = sutro.get_job_results(job_id)
# Returns: pl.DataFrame with one column 'inference_result'

# Get results with inputs
results = sutro.get_job_results(job_id, include_inputs=True)
# Returns: pl.DataFrame with columns ['inputs', 'inference_result']

# Add results back to original DataFrame
df_with_results = sutro.get_job_results(job_id, with_original_df=original_df)
# Returns: Same type as original_df with 'inference_result' column added. Matches the return shape of .infer(...) when stay_attached=True.
```

### Cancelling jobs

```Python theme={null}
cancel_job(self, job_id: str)
```

Cancel a job by its ID.

>

**Parameters:**

* `job_id` (str): The ID of the job to cancel.

>

**Returns:** dict: The status of the job cancellation.
