Skip to content

Commit

Permalink
Remove init-db command, refs #68
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Jul 12, 2023
1 parent fa67b3f commit 54881eb
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 32 deletions.
12 changes: 0 additions & 12 deletions docs/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ Options:
Commands:
prompt* Execute a prompt
init-db Ensure the logs.db SQLite database exists
install Install packages from PyPI into the same environment as LLM
keys Manage stored API keys for different models
logs Tools for exploring logged prompts and responses
Expand Down Expand Up @@ -89,17 +88,6 @@ Options:
--save TEXT Save prompt with this template name
--help Show this message and exit.
```
### llm init-db --help
```
Usage: llm init-db [OPTIONS]
Ensure the logs.db SQLite database exists
All subsequent prompts will be logged to this database.
Options:
--help Show this message and exit.
```
### llm keys --help
```
Usage: llm keys [OPTIONS] COMMAND [ARGS]...
Expand Down
20 changes: 0 additions & 20 deletions llm/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,22 +284,6 @@ def load_conversation(conversation_id: Optional[str]) -> Optional[Conversation]:
return conversation


@cli.command()
def init_db():
"""
Ensure the logs.db SQLite database exists
All subsequent prompts will be logged to this database.
"""
path = logs_db_path()
if path.exists():
return
# Ensure directory exists
path.parent.mkdir(parents=True, exist_ok=True)
db = sqlite_utils.Database(path)
db.vacuum()


@cli.group()
def keys():
"Manage stored API keys for different models"
Expand Down Expand Up @@ -665,10 +649,6 @@ def get_history(chat_id):
if chat_id is None:
return None, []
log_path = logs_db_path()
if not log_path.exists():
raise click.ClickException(
"This feature requires logging. Run `llm init-db` to create logs.db"
)
db = sqlite_utils.Database(log_path)
migrate(db)
if chat_id == -1:
Expand Down

0 comments on commit 54881eb

Please sign in to comment.