database#

Attributes#

db

Functions#

db_init([path, url])

db_status()

db_ls([collection_name, peek])

List the current database's collections

db_add(collection_name, model_name[, input_dir, ...])

Add a collection to the database

db_rm(collection_name, confirm)

Remove a collection from the database

Module Contents#

database.db#
database.db_init(path=str(janus_dir / 'chroma.db'), url='')#
Parameters:
  • path (typing_extensions.Annotated[str, typer.Option('--path', '-p', help='The path to the database file.')]) –

  • url (typing_extensions.Annotated[str, typer.Option('--url', '-u', help='The URL of the database if the database is running externally.')]) –

Return type:

None

database.db_status()#
database.db_ls(collection_name=None, peek=None)#

List the current database’s collections

Parameters:
  • collection_name (typing_extensions.Annotated[Optional[str], typer.Argument(help='The name of the collection.')]) –

  • peek (typing_extensions.Annotated[Optional[int], typer.Option('--peek', '-p', help='Peek at N entries for a specific collection.')]) –

Return type:

None

database.db_add(collection_name, model_name, input_dir='./', input_lang='python', max_tokens=4096)#

Add a collection to the database

Parameters:
  • collection_name (typing_extensions.Annotated[str, typer.Argument(help='The name of the collection.')]) – The name of the collection to add

  • model_name (typing_extensions.Annotated[str, typer.Argument(help='The name of the embedding model.')]) – The name of the embedding model to use

  • input_dir (typing_extensions.Annotated[str, typer.Option('--input', '-i', help='The directory containing the source code to be added.')]) – The directory containing the source code to be added

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

  • max_tokens (typing_extensions.Annotated[int, typer.Option('--max-tokens', '-m', help='The maximum number of tokens for each chunk of input source code.')]) – The maximum number of tokens for each chunk of input source code

Return type:

None

database.db_rm(collection_name, confirm)#

Remove a collection from the database

Parameters:
  • collection_name (typing_extensions.Annotated[str, typer.Argument(help='The name of the collection.')]) – The name of the collection to remove

  • confirm (typing_extensions.Annotated[bool, typer.Option('--yes', '-y', help='Confirm the removal of the collection.')]) –

Return type:

None