We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[Bug]: CLI doesn't produce an output file
**Describe the bug**
When using the CLI to run an AutoLabel job, no output file is created. There's no mention of how to specify an output file in the CLI documentation and it doesn't look like the CLI implementation supports it.

In some sense this might be a feature request, but it feels like a bug because the CLI is unusable if it doesn't output the labeled data. Please let me know if I'm missing something!

**To Reproduce**
Run any labeling job via CLI and no output file will be created, e.g., 
```bash
autolabel run test_data.csv  autolabel_config.json
```

**Expected behavior**
I would expect an output file with the labeled data.



--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/autolabel/cli/main.py`
Content:
```
1 from typing import Optional
2 from typing_extensions import Annotated
3 import logging
4 
5 import typer
6 
7 from autolabel import LabelingAgent
8 from autolabel.schema import TaskType, ModelProvider, FewShotAlgorithm
9 from autolabel.few_shot import PROVIDER_TO_MODEL
10 from autolabel.dataset import AutolabelDataset
11 
12 from autolabel.cli.config import init, create_config_wizard
13 
14 app = typer.Typer(
15     rich_markup_mode="rich",
16     no_args_is_help=True,
17     help="[bold]Autolabel CLI[/bold] 🏷️",
18 )
19 
20 
21 @app.command(name="config")
22 def config_command(
23     seed: Annotated[
24         Optional[str],
25         typer.Argument(
26             help="Optional seed dataset to help auto-fill the config. Recommended for a more accurate config"
27         ),
28     ] = None,
29 ):
30     """Create a new [bold]config[/bold] file using a wizard 🪄"""
31     create_config_wizard(seed)
32 
33 
34 @app.command(
35     name="init",
36 )
37 def init_command(
38     seed: Annotated[
39         Optional[str],
40         typer.Argument(
41             help="Optional seed dataset to help auto-fill the config. Recommended for a more accurate config"
42         ),
43     ] = None,
44     task_name: Annotated[
45         str,
46         typer.Option(
47             help="Name of the task to create a config for",
48             show_default=False,
49         ),
50     ] = None,
51     task_type: Annotated[
52         str,
53         typer.Option(
54             help=f"Type of task to create. Options: [magenta]{', '.join([t for t in TaskType])}[/magenta]",
55             show_default=False,
56         ),
57     ] = None,
58     dataset_label_column: Annotated[
59         str,
60         typer.Option(
61             "--label-column",
62             help="Name of the column containing the labels",
63             show_default=False,
64             rich_help_panel="Dataset Configuration",
65         ),
66     ] = None,
67     dataset_label_separator: Annotated[
68         str,
69         typer.Option(
70             "--label-separator",
71             help="Separator to use when separating multiple labels for multilabel classification",
72             show_default=False,
73             rich_help_panel="Dataset Configuration",
74         ),
75     ] = None,
76     dataset_explanation_column: Annotated[
77         str,
78         typer.Option(
79             "--explanation-column",
80             help="Name of the column containing the explanations",
81             show_default=False,
82             rich_help_panel="Dataset Configuration",
83         ),
84     ] = None,
85     dataset_text_column: Annotated[
86         str,
87         typer.Option(
88             "--text-column",
89             help="Name of the column containing the text to label",
90             show_default=False,
91             rich_help_panel="Dataset Configuration",
92         ),
93     ] = None,
94     dataset_delimiter: Annotated[
95         str,
96         typer.Option(
97             "--delimiter",
98             help="Delimiter to use when parsing the dataset",
99             show_default=False,
100             rich_help_panel="Dataset Configuration",
101         ),
102     ] = None,  # None means it will be guessed from seed.csv or default to a comma
103     model_provider: Annotated[
104         str,
105         typer.Option(
106             "--provider",
107             help=f"Provider of the model to use. Options: [magenta]{', '.join([p for p in ModelProvider])}[/magenta]",
108             rich_help_panel="Model Configuration",
109         ),
110     ] = "openai",
111     model_name: Annotated[
112         str,
113         typer.Option(
114             "--model",
115             help="Name of the model to use",
116             rich_help_panel="Model Configuration",
117         ),
118     ] = "gpt-3.5-turbo",
119     model_compute_confidence: Annotated[
120         bool,
121         typer.Option(
122             "--compute-confidence",
123             help="Whether to compute confidence scores for each label",
124             show_default=False,
125             rich_help_panel="Model Configuration",
126         ),
127     ] = None,
128     model_logit_bias: Annotated[
129         bool,
130         typer.Option(
131             "--logit-bias",
132             help="Whether to use logit biasing to constrain the model to certain tokens",
133             show_default=False,
134             rich_help_panel="Model Configuration",
135         ),
136     ] = None,
137     embedding_provider: Annotated[
138         str,
139         typer.Option(
140             "--embedding-provider",
141             help=f"Provider of the embedding model to use. Options: [magenta]{', '.join([p for p in PROVIDER_TO_MODEL])}[/magenta]",
142             show_default=False,
143             rich_help_panel="Embedding Configuration",
144         ),
145     ] = None,
146     embedding_model_name: Annotated[
147         str,
148         typer.Option(
149             "--embedding-model",
150             help="Name of the embedding model to use",
151             show_default=False,
152             rich_help_panel="Embedding Configuration",
153         ),
154     ] = None,
155     guess_labels: Annotated[
156         bool,
157         typer.Option(
158             "--guess-labels",
159             help="Whether to guess the labels from the seed dataset. If set, --task-type, --delimiter, and --label-column (and --label-separator for mulitlabel classification) must be defined",
160             rich_help_panel="Prompt Configuration",
161         ),
162     ] = False,
163     prompt_task_guidelines: Annotated[
164         str,
165         typer.Option(
166             "--task-guidelines",
167             help="Guidelines for the task. [code]{labels}[/code] will be replaced with a newline-separated list of labels",
168             show_default=False,
169             rich_help_panel="Prompt Configuration",
170         ),
171     ] = None,
172     prompt_few_shot_examples: Annotated[
173         str,
174         typer.Option(
175             "--few-shot-examples",
176             help="Seed dataset to use for few-shot prompting",
177             show_default=False,
178             rich_help_panel="Prompt Configuration",
179         ),
180     ] = None,
181     prompt_few_shot_selection: Annotated[
182         str,
183         typer.Option(
184             "--few-shot-selection",
185             help=f"What algorithm to use to select examples from the seed dataset. Options: [magenta]{', '.join([a for a in FewShotAlgorithm])}[/magenta]",
186             show_default=False,
187             rich_help_panel="Prompt Configuration",
188         ),
189     ] = None,
190     prompt_few_shot_num: Annotated[
191         int,
192         typer.Option(
193             "--few-shot-num",
194             help="Number of examples to select from the seed dataset",
195             show_default=False,
196             rich_help_panel="Prompt Configuration",
197         ),
198     ] = None,
199     prompt_example_template: Annotated[
200         str,
201         typer.Option(
202             "--example-template",
203             help="Template to use for each example. [code]{column_name}[/code] will be replaced with the corresponding column value for each example",
204             show_default=False,
205             rich_help_panel="Prompt Configuration",
206         ),
207     ] = None,
208     prompt_output_guidelines: Annotated[
209         str,
210         typer.Option(
211             "--output-guidelines",
212             help="Guidelines for the output",
213             show_default=False,
214             rich_help_panel="Prompt Configuration",
215         ),
216     ] = None,
217     prompt_output_format: Annotated[
218         str,
219         typer.Option(
220             "--output-format",
221             help="Format to use for the output",
222             show_default=False,
223             rich_help_panel="Prompt Configuration",
224         ),
225     ] = None,
226     prompt_chain_of_thought: Annotated[
227         bool,
228         typer.Option(
229             "--chain-of-thought",
230             help="Whether to use chain of thought",
231             show_default=False,
232             rich_help_panel="Prompt Configuration",
233         ),
234     ] = None,
235 ):
236     """Generate a new template [bold]config[/bold] file 📄"""
237     init(
238         seed,
239         task_name,
240         task_type,
241         dataset_label_column=dataset_label_column,
242         dataset_label_separator=dataset_label_separator,
243         dataset_explanation_column=dataset_explanation_column,
244         dataset_text_column=dataset_text_column,
245         dataset_delimiter=dataset_delimiter,
246         model_provider=model_provider,
247         model_name=model_name,
248         model_compute_confidence=model_compute_confidence,
249         model_logit_bias=model_logit_bias,
250         embedding_provider=embedding_provider,
251         embedding_model_name=embedding_model_name,
252         guess_labels=guess_labels,
253         prompt_task_guidelines=prompt_task_guidelines,
254         prompt_few_shot_examples=prompt_few_shot_examples,
255         prompt_few_shot_selection=prompt_few_shot_selection,
256         prompt_few_shot_num=prompt_few_shot_num,
257         prompt_example_template=prompt_example_template,
258         prompt_output_guidelines=prompt_output_guidelines,
259         prompt_output_format=prompt_output_format,
260         prompt_chain_of_thought=prompt_chain_of_thought,
261     )
262 
263 
264 def setup_logging(
265     verbose_debug: bool = False,
266     verbose_info: bool = False,
267     quiet_warning: bool = False,
268     quiet_error: bool = False,
269 ):
270     if verbose_debug:
271         log_level = logging.DEBUG
272     elif verbose_info:
273         log_level = logging.INFO
274     elif quiet_warning:
275         log_level = logging.ERROR
276     elif quiet_error:
277         log_level = logging.CRITICAL
278     else:
279         log_level = logging.WARNING
280     logging.getLogger("autolabel").setLevel(log_level)
281     logging.getLogger("langchain").setLevel(log_level)
282 
283 
284 @app.command()
285 def plan(
286     dataset: Annotated[
287         str, typer.Argument(help="Path to dataset to label", show_default=False)
288     ],
289     config: Annotated[
290         str, typer.Argument(help="Path to config file", show_default=False)
291     ],
292     max_items: Annotated[int, typer.Option(help="Max number of items to label")] = None,
293     start_index: Annotated[int, typer.Option(help="Index to start at")] = 0,
294     cache: Annotated[bool, typer.Option(help="Cache results")] = True,
295     verbose_debug: Annotated[
296         bool, typer.Option("--debug", "-vv", help="Verbose (debug log level)")
297     ] = False,
298     verbose_info: Annotated[
299         bool, typer.Option("--info", "-v", help="Verbose (info log level)")
300     ] = False,
301     quiet_warning: Annotated[
302         bool, typer.Option("--error", "-q", help="Quiet (error log level)")
303     ] = False,
304     quiet_error: Annotated[
305         bool, typer.Option("--critical", "-qq", help="Quiet (critical log level)")
306     ] = False,
307 ):
308     """[bold]Plan[/bold] 🔍 a labeling session in accordance with the provided dataset and config file"""
309     setup_logging(verbose_debug, verbose_info, quiet_warning, quiet_error)
310     agent = LabelingAgent(config=config, cache=cache)
311     config = agent.config
312     dataset = AutolabelDataset(dataset, config)
313     agent.plan(dataset, max_items=max_items, start_index=start_index)
314 
315 
316 @app.command()
317 def run(
318     dataset: Annotated[
319         str, typer.Argument(help="Path to dataset to label", show_default=False)
320     ],
321     config: Annotated[
322         str, typer.Argument(help="Path to config file", show_default=False)
323     ],
324     max_items: Annotated[int, typer.Option(help="Max number of items to label")] = None,
325     start_index: Annotated[int, typer.Option(help="Index to start at")] = 0,
326     cache: Annotated[bool, typer.Option(help="Cache results")] = True,
327     verbose_debug: Annotated[
328         bool, typer.Option("--debug", "-vv", help="Verbose (debug log level)")
329     ] = False,
330     verbose_info: Annotated[
331         bool, typer.Option("--info", "-v", help="Verbose (info log level)")
332     ] = False,
333     quiet_warning: Annotated[
334         bool, typer.Option("--error", "-q", help="Quiet (error log level)")
335     ] = False,
336     quiet_error: Annotated[
337         bool, typer.Option("--critical", "-qq", help="Quiet (critical log level)")
338     ] = False,
339 ):
340     """[bold]Run[/bold] ▶️ a labeling session in accordance with the provided dataset and config file"""
341     setup_logging(verbose_debug, verbose_info, quiet_warning, quiet_error)
342     agent = LabelingAgent(config=config, cache=cache)
343     config = agent.config
344     dataset = AutolabelDataset(dataset, config)
345     agent.run(dataset, max_items=max_items, start_index=start_index)
346 
347 
348 if __name__ == "__main__":
349     app()
350
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/src/autolabel/cli/main.py b/src/autolabel/cli/main.py
--- a/src/autolabel/cli/main.py
+++ b/src/autolabel/cli/main.py
@@ -324,6 +324,9 @@
     max_items: Annotated[int, typer.Option(help="Max number of items to label")] = None,
     start_index: Annotated[int, typer.Option(help="Index to start at")] = 0,
     cache: Annotated[bool, typer.Option(help="Cache results")] = True,
+    output_name: Annotated[
+        str, typer.Option(help="Path to output file to save run results to")
+    ] = None,
     verbose_debug: Annotated[
         bool, typer.Option("--debug", "-vv", help="Verbose (debug log level)")
     ] = False,
@@ -342,7 +345,9 @@
     agent = LabelingAgent(config=config, cache=cache)
     config = agent.config
     dataset = AutolabelDataset(dataset, config)
-    agent.run(dataset, max_items=max_items, start_index=start_index)
+    agent.run(
+        dataset, max_items=max_items, output_name=output_name, start_index=start_index
+    )
 
 
 if __name__ == "__main__":

{"golden_diff": "diff --git a/src/autolabel/cli/main.py b/src/autolabel/cli/main.py\n--- a/src/autolabel/cli/main.py\n+++ b/src/autolabel/cli/main.py\n@@ -324,6 +324,9 @@\n     max_items: Annotated[int, typer.Option(help=\"Max number of items to label\")] = None,\n     start_index: Annotated[int, typer.Option(help=\"Index to start at\")] = 0,\n     cache: Annotated[bool, typer.Option(help=\"Cache results\")] = True,\n+    output_name: Annotated[\n+        str, typer.Option(help=\"Path to output file to save run results to\")\n+    ] = None,\n     verbose_debug: Annotated[\n         bool, typer.Option(\"--debug\", \"-vv\", help=\"Verbose (debug log level)\")\n     ] = False,\n@@ -342,7 +345,9 @@\n     agent = LabelingAgent(config=config, cache=cache)\n     config = agent.config\n     dataset = AutolabelDataset(dataset, config)\n-    agent.run(dataset, max_items=max_items, start_index=start_index)\n+    agent.run(\n+        dataset, max_items=max_items, output_name=output_name, start_index=start_index\n+    )\n \n \n if __name__ == \"__main__\":\n", "issue": "[Bug]: CLI doesn't produce an output file\n**Describe the bug**\r\nWhen using the CLI to run an AutoLabel job, no output file is created. There's no mention of how to specify an output file in the CLI documentation and it doesn't look like the CLI implementation supports it.\r\n\r\nIn some sense this might be a feature request, but it feels like a bug because the CLI is unusable if it doesn't output the labeled data. Please let me know if I'm missing something!\r\n\r\n**To Reproduce**\r\nRun any labeling job via CLI and no output file will be created, e.g., \r\n```bash\r\nautolabel run test_data.csv  autolabel_config.json\r\n```\r\n\r\n**Expected behavior**\r\nI would expect an output file with the labeled data.\r\n\r\n\n", "before_files": [{"content": "from typing import Optional\nfrom typing_extensions import Annotated\nimport logging\n\nimport typer\n\nfrom autolabel import LabelingAgent\nfrom autolabel.schema import TaskType, ModelProvider, FewShotAlgorithm\nfrom autolabel.few_shot import PROVIDER_TO_MODEL\nfrom autolabel.dataset import AutolabelDataset\n\nfrom autolabel.cli.config import init, create_config_wizard\n\napp = typer.Typer(\n    rich_markup_mode=\"rich\",\n    no_args_is_help=True,\n    help=\"[bold]Autolabel CLI[/bold] \ud83c\udff7\ufe0f\",\n)\n\n\n@app.command(name=\"config\")\ndef config_command(\n    seed: Annotated[\n        Optional[str],\n        typer.Argument(\n            help=\"Optional seed dataset to help auto-fill the config. Recommended for a more accurate config\"\n        ),\n    ] = None,\n):\n    \"\"\"Create a new [bold]config[/bold] file using a wizard \ud83e\ude84\"\"\"\n    create_config_wizard(seed)\n\n\n@app.command(\n    name=\"init\",\n)\ndef init_command(\n    seed: Annotated[\n        Optional[str],\n        typer.Argument(\n            help=\"Optional seed dataset to help auto-fill the config. Recommended for a more accurate config\"\n        ),\n    ] = None,\n    task_name: Annotated[\n        str,\n        typer.Option(\n            help=\"Name of the task to create a config for\",\n            show_default=False,\n        ),\n    ] = None,\n    task_type: Annotated[\n        str,\n        typer.Option(\n            help=f\"Type of task to create. Options: [magenta]{', '.join([t for t in TaskType])}[/magenta]\",\n            show_default=False,\n        ),\n    ] = None,\n    dataset_label_column: Annotated[\n        str,\n        typer.Option(\n            \"--label-column\",\n            help=\"Name of the column containing the labels\",\n            show_default=False,\n            rich_help_panel=\"Dataset Configuration\",\n        ),\n    ] = None,\n    dataset_label_separator: Annotated[\n        str,\n        typer.Option(\n            \"--label-separator\",\n            help=\"Separator to use when separating multiple labels for multilabel classification\",\n            show_default=False,\n            rich_help_panel=\"Dataset Configuration\",\n        ),\n    ] = None,\n    dataset_explanation_column: Annotated[\n        str,\n        typer.Option(\n            \"--explanation-column\",\n            help=\"Name of the column containing the explanations\",\n            show_default=False,\n            rich_help_panel=\"Dataset Configuration\",\n        ),\n    ] = None,\n    dataset_text_column: Annotated[\n        str,\n        typer.Option(\n            \"--text-column\",\n            help=\"Name of the column containing the text to label\",\n            show_default=False,\n            rich_help_panel=\"Dataset Configuration\",\n        ),\n    ] = None,\n    dataset_delimiter: Annotated[\n        str,\n        typer.Option(\n            \"--delimiter\",\n            help=\"Delimiter to use when parsing the dataset\",\n            show_default=False,\n            rich_help_panel=\"Dataset Configuration\",\n        ),\n    ] = None,  # None means it will be guessed from seed.csv or default to a comma\n    model_provider: Annotated[\n        str,\n        typer.Option(\n            \"--provider\",\n            help=f\"Provider of the model to use. Options: [magenta]{', '.join([p for p in ModelProvider])}[/magenta]\",\n            rich_help_panel=\"Model Configuration\",\n        ),\n    ] = \"openai\",\n    model_name: Annotated[\n        str,\n        typer.Option(\n            \"--model\",\n            help=\"Name of the model to use\",\n            rich_help_panel=\"Model Configuration\",\n        ),\n    ] = \"gpt-3.5-turbo\",\n    model_compute_confidence: Annotated[\n        bool,\n        typer.Option(\n            \"--compute-confidence\",\n            help=\"Whether to compute confidence scores for each label\",\n            show_default=False,\n            rich_help_panel=\"Model Configuration\",\n        ),\n    ] = None,\n    model_logit_bias: Annotated[\n        bool,\n        typer.Option(\n            \"--logit-bias\",\n            help=\"Whether to use logit biasing to constrain the model to certain tokens\",\n            show_default=False,\n            rich_help_panel=\"Model Configuration\",\n        ),\n    ] = None,\n    embedding_provider: Annotated[\n        str,\n        typer.Option(\n            \"--embedding-provider\",\n            help=f\"Provider of the embedding model to use. Options: [magenta]{', '.join([p for p in PROVIDER_TO_MODEL])}[/magenta]\",\n            show_default=False,\n            rich_help_panel=\"Embedding Configuration\",\n        ),\n    ] = None,\n    embedding_model_name: Annotated[\n        str,\n        typer.Option(\n            \"--embedding-model\",\n            help=\"Name of the embedding model to use\",\n            show_default=False,\n            rich_help_panel=\"Embedding Configuration\",\n        ),\n    ] = None,\n    guess_labels: Annotated[\n        bool,\n        typer.Option(\n            \"--guess-labels\",\n            help=\"Whether to guess the labels from the seed dataset. If set, --task-type, --delimiter, and --label-column (and --label-separator for mulitlabel classification) must be defined\",\n            rich_help_panel=\"Prompt Configuration\",\n        ),\n    ] = False,\n    prompt_task_guidelines: Annotated[\n        str,\n        typer.Option(\n            \"--task-guidelines\",\n            help=\"Guidelines for the task. [code]{labels}[/code] will be replaced with a newline-separated list of labels\",\n            show_default=False,\n            rich_help_panel=\"Prompt Configuration\",\n        ),\n    ] = None,\n    prompt_few_shot_examples: Annotated[\n        str,\n        typer.Option(\n            \"--few-shot-examples\",\n            help=\"Seed dataset to use for few-shot prompting\",\n            show_default=False,\n            rich_help_panel=\"Prompt Configuration\",\n        ),\n    ] = None,\n    prompt_few_shot_selection: Annotated[\n        str,\n        typer.Option(\n            \"--few-shot-selection\",\n            help=f\"What algorithm to use to select examples from the seed dataset. Options: [magenta]{', '.join([a for a in FewShotAlgorithm])}[/magenta]\",\n            show_default=False,\n            rich_help_panel=\"Prompt Configuration\",\n        ),\n    ] = None,\n    prompt_few_shot_num: Annotated[\n        int,\n        typer.Option(\n            \"--few-shot-num\",\n            help=\"Number of examples to select from the seed dataset\",\n            show_default=False,\n            rich_help_panel=\"Prompt Configuration\",\n        ),\n    ] = None,\n    prompt_example_template: Annotated[\n        str,\n        typer.Option(\n            \"--example-template\",\n            help=\"Template to use for each example. [code]{column_name}[/code] will be replaced with the corresponding column value for each example\",\n            show_default=False,\n            rich_help_panel=\"Prompt Configuration\",\n        ),\n    ] = None,\n    prompt_output_guidelines: Annotated[\n        str,\n        typer.Option(\n            \"--output-guidelines\",\n            help=\"Guidelines for the output\",\n            show_default=False,\n            rich_help_panel=\"Prompt Configuration\",\n        ),\n    ] = None,\n    prompt_output_format: Annotated[\n        str,\n        typer.Option(\n            \"--output-format\",\n            help=\"Format to use for the output\",\n            show_default=False,\n            rich_help_panel=\"Prompt Configuration\",\n        ),\n    ] = None,\n    prompt_chain_of_thought: Annotated[\n        bool,\n        typer.Option(\n            \"--chain-of-thought\",\n            help=\"Whether to use chain of thought\",\n            show_default=False,\n            rich_help_panel=\"Prompt Configuration\",\n        ),\n    ] = None,\n):\n    \"\"\"Generate a new template [bold]config[/bold] file \ud83d\udcc4\"\"\"\n    init(\n        seed,\n        task_name,\n        task_type,\n        dataset_label_column=dataset_label_column,\n        dataset_label_separator=dataset_label_separator,\n        dataset_explanation_column=dataset_explanation_column,\n        dataset_text_column=dataset_text_column,\n        dataset_delimiter=dataset_delimiter,\n        model_provider=model_provider,\n        model_name=model_name,\n        model_compute_confidence=model_compute_confidence,\n        model_logit_bias=model_logit_bias,\n        embedding_provider=embedding_provider,\n        embedding_model_name=embedding_model_name,\n        guess_labels=guess_labels,\n        prompt_task_guidelines=prompt_task_guidelines,\n        prompt_few_shot_examples=prompt_few_shot_examples,\n        prompt_few_shot_selection=prompt_few_shot_selection,\n        prompt_few_shot_num=prompt_few_shot_num,\n        prompt_example_template=prompt_example_template,\n        prompt_output_guidelines=prompt_output_guidelines,\n        prompt_output_format=prompt_output_format,\n        prompt_chain_of_thought=prompt_chain_of_thought,\n    )\n\n\ndef setup_logging(\n    verbose_debug: bool = False,\n    verbose_info: bool = False,\n    quiet_warning: bool = False,\n    quiet_error: bool = False,\n):\n    if verbose_debug:\n        log_level = logging.DEBUG\n    elif verbose_info:\n        log_level = logging.INFO\n    elif quiet_warning:\n        log_level = logging.ERROR\n    elif quiet_error:\n        log_level = logging.CRITICAL\n    else:\n        log_level = logging.WARNING\n    logging.getLogger(\"autolabel\").setLevel(log_level)\n    logging.getLogger(\"langchain\").setLevel(log_level)\n\n\n@app.command()\ndef plan(\n    dataset: Annotated[\n        str, typer.Argument(help=\"Path to dataset to label\", show_default=False)\n    ],\n    config: Annotated[\n        str, typer.Argument(help=\"Path to config file\", show_default=False)\n    ],\n    max_items: Annotated[int, typer.Option(help=\"Max number of items to label\")] = None,\n    start_index: Annotated[int, typer.Option(help=\"Index to start at\")] = 0,\n    cache: Annotated[bool, typer.Option(help=\"Cache results\")] = True,\n    verbose_debug: Annotated[\n        bool, typer.Option(\"--debug\", \"-vv\", help=\"Verbose (debug log level)\")\n    ] = False,\n    verbose_info: Annotated[\n        bool, typer.Option(\"--info\", \"-v\", help=\"Verbose (info log level)\")\n    ] = False,\n    quiet_warning: Annotated[\n        bool, typer.Option(\"--error\", \"-q\", help=\"Quiet (error log level)\")\n    ] = False,\n    quiet_error: Annotated[\n        bool, typer.Option(\"--critical\", \"-qq\", help=\"Quiet (critical log level)\")\n    ] = False,\n):\n    \"\"\"[bold]Plan[/bold] \ud83d\udd0d a labeling session in accordance with the provided dataset and config file\"\"\"\n    setup_logging(verbose_debug, verbose_info, quiet_warning, quiet_error)\n    agent = LabelingAgent(config=config, cache=cache)\n    config = agent.config\n    dataset = AutolabelDataset(dataset, config)\n    agent.plan(dataset, max_items=max_items, start_index=start_index)\n\n\n@app.command()\ndef run(\n    dataset: Annotated[\n        str, typer.Argument(help=\"Path to dataset to label\", show_default=False)\n    ],\n    config: Annotated[\n        str, typer.Argument(help=\"Path to config file\", show_default=False)\n    ],\n    max_items: Annotated[int, typer.Option(help=\"Max number of items to label\")] = None,\n    start_index: Annotated[int, typer.Option(help=\"Index to start at\")] = 0,\n    cache: Annotated[bool, typer.Option(help=\"Cache results\")] = True,\n    verbose_debug: Annotated[\n        bool, typer.Option(\"--debug\", \"-vv\", help=\"Verbose (debug log level)\")\n    ] = False,\n    verbose_info: Annotated[\n        bool, typer.Option(\"--info\", \"-v\", help=\"Verbose (info log level)\")\n    ] = False,\n    quiet_warning: Annotated[\n        bool, typer.Option(\"--error\", \"-q\", help=\"Quiet (error log level)\")\n    ] = False,\n    quiet_error: Annotated[\n        bool, typer.Option(\"--critical\", \"-qq\", help=\"Quiet (critical log level)\")\n    ] = False,\n):\n    \"\"\"[bold]Run[/bold] \u25b6\ufe0f a labeling session in accordance with the provided dataset and config file\"\"\"\n    setup_logging(verbose_debug, verbose_info, quiet_warning, quiet_error)\n    agent = LabelingAgent(config=config, cache=cache)\n    config = agent.config\n    dataset = AutolabelDataset(dataset, config)\n    agent.run(dataset, max_items=max_items, start_index=start_index)\n\n\nif __name__ == \"__main__\":\n    app()\n", "path": "src/autolabel/cli/main.py"}], "after_files": [{"content": "from typing import Optional\nfrom typing_extensions import Annotated\nimport logging\n\nimport typer\n\nfrom autolabel import LabelingAgent\nfrom autolabel.schema import TaskType, ModelProvider, FewShotAlgorithm\nfrom autolabel.few_shot import PROVIDER_TO_MODEL\nfrom autolabel.dataset import AutolabelDataset\n\nfrom autolabel.cli.config import init, create_config_wizard\n\napp = typer.Typer(\n    rich_markup_mode=\"rich\",\n    no_args_is_help=True,\n    help=\"[bold]Autolabel CLI[/bold] \ud83c\udff7\ufe0f\",\n)\n\n\n@app.command(name=\"config\")\ndef config_command(\n    seed: Annotated[\n        Optional[str],\n        typer.Argument(\n            help=\"Optional seed dataset to help auto-fill the config. Recommended for a more accurate config\"\n        ),\n    ] = None,\n):\n    \"\"\"Create a new [bold]config[/bold] file using a wizard \ud83e\ude84\"\"\"\n    create_config_wizard(seed)\n\n\n@app.command(\n    name=\"init\",\n)\ndef init_command(\n    seed: Annotated[\n        Optional[str],\n        typer.Argument(\n            help=\"Optional seed dataset to help auto-fill the config. Recommended for a more accurate config\"\n        ),\n    ] = None,\n    task_name: Annotated[\n        str,\n        typer.Option(\n            help=\"Name of the task to create a config for\",\n            show_default=False,\n        ),\n    ] = None,\n    task_type: Annotated[\n        str,\n        typer.Option(\n            help=f\"Type of task to create. Options: [magenta]{', '.join([t for t in TaskType])}[/magenta]\",\n            show_default=False,\n        ),\n    ] = None,\n    dataset_label_column: Annotated[\n        str,\n        typer.Option(\n            \"--label-column\",\n            help=\"Name of the column containing the labels\",\n            show_default=False,\n            rich_help_panel=\"Dataset Configuration\",\n        ),\n    ] = None,\n    dataset_label_separator: Annotated[\n        str,\n        typer.Option(\n            \"--label-separator\",\n            help=\"Separator to use when separating multiple labels for multilabel classification\",\n            show_default=False,\n            rich_help_panel=\"Dataset Configuration\",\n        ),\n    ] = None,\n    dataset_explanation_column: Annotated[\n        str,\n        typer.Option(\n            \"--explanation-column\",\n            help=\"Name of the column containing the explanations\",\n            show_default=False,\n            rich_help_panel=\"Dataset Configuration\",\n        ),\n    ] = None,\n    dataset_text_column: Annotated[\n        str,\n        typer.Option(\n            \"--text-column\",\n            help=\"Name of the column containing the text to label\",\n            show_default=False,\n            rich_help_panel=\"Dataset Configuration\",\n        ),\n    ] = None,\n    dataset_delimiter: Annotated[\n        str,\n        typer.Option(\n            \"--delimiter\",\n            help=\"Delimiter to use when parsing the dataset\",\n            show_default=False,\n            rich_help_panel=\"Dataset Configuration\",\n        ),\n    ] = None,  # None means it will be guessed from seed.csv or default to a comma\n    model_provider: Annotated[\n        str,\n        typer.Option(\n            \"--provider\",\n            help=f\"Provider of the model to use. Options: [magenta]{', '.join([p for p in ModelProvider])}[/magenta]\",\n            rich_help_panel=\"Model Configuration\",\n        ),\n    ] = \"openai\",\n    model_name: Annotated[\n        str,\n        typer.Option(\n            \"--model\",\n            help=\"Name of the model to use\",\n            rich_help_panel=\"Model Configuration\",\n        ),\n    ] = \"gpt-3.5-turbo\",\n    model_compute_confidence: Annotated[\n        bool,\n        typer.Option(\n            \"--compute-confidence\",\n            help=\"Whether to compute confidence scores for each label\",\n            show_default=False,\n            rich_help_panel=\"Model Configuration\",\n        ),\n    ] = None,\n    model_logit_bias: Annotated[\n        bool,\n        typer.Option(\n            \"--logit-bias\",\n            help=\"Whether to use logit biasing to constrain the model to certain tokens\",\n            show_default=False,\n            rich_help_panel=\"Model Configuration\",\n        ),\n    ] = None,\n    embedding_provider: Annotated[\n        str,\n        typer.Option(\n            \"--embedding-provider\",\n            help=f\"Provider of the embedding model to use. Options: [magenta]{', '.join([p for p in PROVIDER_TO_MODEL])}[/magenta]\",\n            show_default=False,\n            rich_help_panel=\"Embedding Configuration\",\n        ),\n    ] = None,\n    embedding_model_name: Annotated[\n        str,\n        typer.Option(\n            \"--embedding-model\",\n            help=\"Name of the embedding model to use\",\n            show_default=False,\n            rich_help_panel=\"Embedding Configuration\",\n        ),\n    ] = None,\n    guess_labels: Annotated[\n        bool,\n        typer.Option(\n            \"--guess-labels\",\n            help=\"Whether to guess the labels from the seed dataset. If set, --task-type, --delimiter, and --label-column (and --label-separator for mulitlabel classification) must be defined\",\n            rich_help_panel=\"Prompt Configuration\",\n        ),\n    ] = False,\n    prompt_task_guidelines: Annotated[\n        str,\n        typer.Option(\n            \"--task-guidelines\",\n            help=\"Guidelines for the task. [code]{labels}[/code] will be replaced with a newline-separated list of labels\",\n            show_default=False,\n            rich_help_panel=\"Prompt Configuration\",\n        ),\n    ] = None,\n    prompt_few_shot_examples: Annotated[\n        str,\n        typer.Option(\n            \"--few-shot-examples\",\n            help=\"Seed dataset to use for few-shot prompting\",\n            show_default=False,\n            rich_help_panel=\"Prompt Configuration\",\n        ),\n    ] = None,\n    prompt_few_shot_selection: Annotated[\n        str,\n        typer.Option(\n            \"--few-shot-selection\",\n            help=f\"What algorithm to use to select examples from the seed dataset. Options: [magenta]{', '.join([a for a in FewShotAlgorithm])}[/magenta]\",\n            show_default=False,\n            rich_help_panel=\"Prompt Configuration\",\n        ),\n    ] = None,\n    prompt_few_shot_num: Annotated[\n        int,\n        typer.Option(\n            \"--few-shot-num\",\n            help=\"Number of examples to select from the seed dataset\",\n            show_default=False,\n            rich_help_panel=\"Prompt Configuration\",\n        ),\n    ] = None,\n    prompt_example_template: Annotated[\n        str,\n        typer.Option(\n            \"--example-template\",\n            help=\"Template to use for each example. [code]{column_name}[/code] will be replaced with the corresponding column value for each example\",\n            show_default=False,\n            rich_help_panel=\"Prompt Configuration\",\n        ),\n    ] = None,\n    prompt_output_guidelines: Annotated[\n        str,\n        typer.Option(\n            \"--output-guidelines\",\n            help=\"Guidelines for the output\",\n            show_default=False,\n            rich_help_panel=\"Prompt Configuration\",\n        ),\n    ] = None,\n    prompt_output_format: Annotated[\n        str,\n        typer.Option(\n            \"--output-format\",\n            help=\"Format to use for the output\",\n            show_default=False,\n            rich_help_panel=\"Prompt Configuration\",\n        ),\n    ] = None,\n    prompt_chain_of_thought: Annotated[\n        bool,\n        typer.Option(\n            \"--chain-of-thought\",\n            help=\"Whether to use chain of thought\",\n            show_default=False,\n            rich_help_panel=\"Prompt Configuration\",\n        ),\n    ] = None,\n):\n    \"\"\"Generate a new template [bold]config[/bold] file \ud83d\udcc4\"\"\"\n    init(\n        seed,\n        task_name,\n        task_type,\n        dataset_label_column=dataset_label_column,\n        dataset_label_separator=dataset_label_separator,\n        dataset_explanation_column=dataset_explanation_column,\n        dataset_text_column=dataset_text_column,\n        dataset_delimiter=dataset_delimiter,\n        model_provider=model_provider,\n        model_name=model_name,\n        model_compute_confidence=model_compute_confidence,\n        model_logit_bias=model_logit_bias,\n        embedding_provider=embedding_provider,\n        embedding_model_name=embedding_model_name,\n        guess_labels=guess_labels,\n        prompt_task_guidelines=prompt_task_guidelines,\n        prompt_few_shot_examples=prompt_few_shot_examples,\n        prompt_few_shot_selection=prompt_few_shot_selection,\n        prompt_few_shot_num=prompt_few_shot_num,\n        prompt_example_template=prompt_example_template,\n        prompt_output_guidelines=prompt_output_guidelines,\n        prompt_output_format=prompt_output_format,\n        prompt_chain_of_thought=prompt_chain_of_thought,\n    )\n\n\ndef setup_logging(\n    verbose_debug: bool = False,\n    verbose_info: bool = False,\n    quiet_warning: bool = False,\n    quiet_error: bool = False,\n):\n    if verbose_debug:\n        log_level = logging.DEBUG\n    elif verbose_info:\n        log_level = logging.INFO\n    elif quiet_warning:\n        log_level = logging.ERROR\n    elif quiet_error:\n        log_level = logging.CRITICAL\n    else:\n        log_level = logging.WARNING\n    logging.getLogger(\"autolabel\").setLevel(log_level)\n    logging.getLogger(\"langchain\").setLevel(log_level)\n\n\n@app.command()\ndef plan(\n    dataset: Annotated[\n        str, typer.Argument(help=\"Path to dataset to label\", show_default=False)\n    ],\n    config: Annotated[\n        str, typer.Argument(help=\"Path to config file\", show_default=False)\n    ],\n    max_items: Annotated[int, typer.Option(help=\"Max number of items to label\")] = None,\n    start_index: Annotated[int, typer.Option(help=\"Index to start at\")] = 0,\n    cache: Annotated[bool, typer.Option(help=\"Cache results\")] = True,\n    verbose_debug: Annotated[\n        bool, typer.Option(\"--debug\", \"-vv\", help=\"Verbose (debug log level)\")\n    ] = False,\n    verbose_info: Annotated[\n        bool, typer.Option(\"--info\", \"-v\", help=\"Verbose (info log level)\")\n    ] = False,\n    quiet_warning: Annotated[\n        bool, typer.Option(\"--error\", \"-q\", help=\"Quiet (error log level)\")\n    ] = False,\n    quiet_error: Annotated[\n        bool, typer.Option(\"--critical\", \"-qq\", help=\"Quiet (critical log level)\")\n    ] = False,\n):\n    \"\"\"[bold]Plan[/bold] \ud83d\udd0d a labeling session in accordance with the provided dataset and config file\"\"\"\n    setup_logging(verbose_debug, verbose_info, quiet_warning, quiet_error)\n    agent = LabelingAgent(config=config, cache=cache)\n    config = agent.config\n    dataset = AutolabelDataset(dataset, config)\n    agent.plan(dataset, max_items=max_items, start_index=start_index)\n\n\n@app.command()\ndef run(\n    dataset: Annotated[\n        str, typer.Argument(help=\"Path to dataset to label\", show_default=False)\n    ],\n    config: Annotated[\n        str, typer.Argument(help=\"Path to config file\", show_default=False)\n    ],\n    max_items: Annotated[int, typer.Option(help=\"Max number of items to label\")] = None,\n    start_index: Annotated[int, typer.Option(help=\"Index to start at\")] = 0,\n    cache: Annotated[bool, typer.Option(help=\"Cache results\")] = True,\n    output_name: Annotated[\n        str, typer.Option(help=\"Path to output file to save run results to\")\n    ] = None,\n    verbose_debug: Annotated[\n        bool, typer.Option(\"--debug\", \"-vv\", help=\"Verbose (debug log level)\")\n    ] = False,\n    verbose_info: Annotated[\n        bool, typer.Option(\"--info\", \"-v\", help=\"Verbose (info log level)\")\n    ] = False,\n    quiet_warning: Annotated[\n        bool, typer.Option(\"--error\", \"-q\", help=\"Quiet (error log level)\")\n    ] = False,\n    quiet_error: Annotated[\n        bool, typer.Option(\"--critical\", \"-qq\", help=\"Quiet (critical log level)\")\n    ] = False,\n):\n    \"\"\"[bold]Run[/bold] \u25b6\ufe0f a labeling session in accordance with the provided dataset and config file\"\"\"\n    setup_logging(verbose_debug, verbose_info, quiet_warning, quiet_error)\n    agent = LabelingAgent(config=config, cache=cache)\n    config = agent.config\n    dataset = AutolabelDataset(dataset, config)\n    agent.run(\n        dataset, max_items=max_items, output_name=output_name, start_index=start_index\n    )\n\n\nif __name__ == \"__main__\":\n    app()\n", "path": "src/autolabel/cli/main.py"}]}