Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commandline and REPL to automatically delete session #909

Closed
InfImpDrive opened this issue Oct 6, 2024 · 3 comments
Closed

Commandline and REPL to automatically delete session #909

InfImpDrive opened this issue Oct 6, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@InfImpDrive
Copy link

InfImpDrive commented Oct 6, 2024

Describe the solution you'd like

There is already ways to create a session both by command line and via REPL:

aichat --session TEST_SESSION --save-session

However, there seems to be no way to do targeted deletion of named sessions.
Could be any of:

aichat --session TEST_SESSION --delete-session
or
aichat --delete TEST_SESSION
or
other similar (And equivalent REPL that automatically deletes a known specific named session).

Additional context

This is useful for scripts that create a session automatically. In many cases, it is preferable to clear the existing named session (from a previous script run) before beginning a new session that is carried across a series of aichat commands.

@InfImpDrive InfImpDrive added the enhancement New feature or request label Oct 6, 2024
@sigoden
Copy link
Owner

sigoden commented Oct 6, 2024

It is recommended to locate the sessions_dir and then delete the session YAML files to remove the sessions.

Alternatively, create a completely new temp directory each time as the sessions_dir.

AICHAT_SESSIONS_DIR=/tmp/sessions01 aichat 

@sigoden sigoden closed this as completed Oct 6, 2024
@sigoden
Copy link
Owner

sigoden commented Oct 6, 2024

This paradigm applies to roles, sessions, rags, and agents.

@sigoden
Copy link
Owner

sigoden commented Oct 14, 2024

Since #922 merged, you can use --empty-session instead of deleting the session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants