aggregate#

Functions#

aggregate(input_dir, language, output_dir, llm_name[, ...])

Module Contents#

aggregate.aggregate(input_dir, language, output_dir, llm_name, failure_dir=None, max_prompts=10, overwrite=False, temperature=0.7, collection=None, splitter_type='file', intermediate_converters=['Documenter'])#
Parameters:
  • input_dir (typing_extensions.Annotated[pathlib.Path, typer.Option('--input', '-i', help='The directory containing the source code to be translated. The files should all be in one flat directory.')]) –

  • language (typing_extensions.Annotated[str, typer.Option('--language', '-l', help='The language of the source code.', click_type=click.Choice(sorted(LANGUAGES)))]) –

  • output_dir (typing_extensions.Annotated[pathlib.Path, typer.Option('--output-dir', '-o', help='The directory to store the translated code in.')]) –

  • llm_name (typing_extensions.Annotated[str, typer.Option('--llm', '-L', help="The custom name of the model set with 'janus llm add'.")]) –

  • failure_dir (typing_extensions.Annotated[Optional[pathlib.Path], typer.Option('--failure-directory', '-f', help='The directory to store failure files during translation')]) –

  • max_prompts (typing_extensions.Annotated[int, typer.Option('--max-prompts', '-m', help='The maximum number of times to prompt a model on one functional block before exiting the application. This is to prevent wasting too much money.')]) –

  • overwrite (typing_extensions.Annotated[bool, typer.Option('--overwrite/--preserve', help='Whether to overwrite existing files in the output directory')]) –

  • temperature (typing_extensions.Annotated[float, typer.Option('--temperature', '-t', help='Sampling temperature.', min=0, max=2)]) –

  • collection (typing_extensions.Annotated[str, typer.Option('--collection', '-c', help='If set, will put the translated result into a Chroma DB collection with the name provided.')]) –

  • splitter_type (typing_extensions.Annotated[str, typer.Option('-S', '--splitter', help='Name of custom splitter to use', click_type=click.Choice(list(CUSTOM_SPLITTERS.keys())))]) –

  • intermediate_converters (typing_extensions.Annotated[List[str], typer.Option('-C', '--converter', help='Name of an intermediate converter to use', click_type=click.Choice([c.__name__ for c in get_subclasses(Converter)]))]) –