# Code Options

## Configuring Code Options

Adding code options allows you to configure the code to be generated in a way that works for your specific use-case. This includes options for generating the code as a function, and for including the imports from your code when adding custom python code.&#x20;

| Parameter                   | Type                                                                   | Description                                                                                    |
| --------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `as_function`               | `bool`                                                                 | If `True`,  Mito generates a function. If `False`, Mito generates a script.                    |
| `function_name`             | `str`                                                                  | The name of the function Mito generates.                                                       |
| `call_function`             | `bool`                                                                 | If `True` the Mito generated code's last line will call the generated function.                |
| `function_params`           | `Union[Dict[ParamName, ParamValue], ParamSubtype, List[ParamSubtype]]` | A mapping from function parameter name to the original value used in the script.               |
| `import_custom_python_code` | `bool`                                                                 | If `True`, the Mito generated function will import custom importers and spreadsheet functions. |

For example, if you want to generate a function named "my\_function" that receives one input called `file_path`, you could use the following code options:

```python
{
    'as_function': True, 
    'call_function': True, 
    'function_name': 'my_function', 
    'function_params': {'file_path': "original_data.csv"},
    'import_custom_python_code': False, 
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.trymito.io/how-to/code-options.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
