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

Add logging of queries and response to Sqlite #27

Open
ncoop57 opened this issue Jan 31, 2025 · 14 comments
Open

Add logging of queries and response to Sqlite #27

ncoop57 opened this issue Jan 31, 2025 · 14 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@ncoop57
Copy link
Contributor

ncoop57 commented Jan 31, 2025

I would like a flag --log that when provided will save the user's query and AI's response to a local sqlite database. The database should have 1 table and should have four columns: timestamp, query, response, and model.

Timestamp will be the time the query was sent off and the model will be the model used to generate the response. We might want to add an additional column for the mode that shell sage was in such as sassy or command.

The database should be saved to the user's home directory such as at ~/.shell_sage/log_db/.

@ncoop57 ncoop57 added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Jan 31, 2025
@aditya0yadav
Copy link

hello nathan
can i work on this one

i have a required knowledge for this one

@ncoop57
Copy link
Contributor Author

ncoop57 commented Feb 1, 2025

hello nathan
can i work on this one

i have a required knowledge for this one

Awesome! Lmk if you have any questions 🤓🤓

@aditya0yadav
Copy link

do i need to be assigned on this or i can start working on this

@ncoop57
Copy link
Contributor Author

ncoop57 commented Feb 1, 2025

Just assigned ya, feel free to start whenever 🤓 @aditya0yadav

@aditya0yadav
Copy link

i have one doubt
ChatGPT and Claude APIs can be quite costly, which might make users hesitate before using them for terminal-based chats. Why not consider using the Gemini API for basic tasks? It's completely free, and while it's not on par with ChatGPT or Claude in terms of coding capabilities, it still offers a solid alternative for simpler use cases.

@ncoop57
Copy link
Contributor Author

ncoop57 commented Feb 1, 2025

You can use gemini with shell sage, you just need to use it via the openai api endpoint: https://ai.google.dev/gemini-api/docs/openai
@aditya0yadav

@ncoop57
Copy link
Contributor Author

ncoop57 commented Feb 1, 2025

Though, tbh I have found gemini models to be quite bad when used in shell sage. Not sure if it is a prompting issue or training issue, but the outputs it gives are usually useless. The only model's I have been happy with are claude and deepseek

@shuane
Copy link

shuane commented Feb 2, 2025

If it helps, SimonW's LLM app does a nice job of logging LLM interactions and includes other useful info - see https://github.com/simonw/llm/blob/main/llm/models.py

@aditya0yadav
Copy link

thanks for the reference

@aditya0yadav
Copy link

I have a query: Do we need to save the data when --log is specifically used? or all the data

@ncoop57
Copy link
Contributor Author

ncoop57 commented Feb 4, 2025

I have a query: Do we need to save the data when --log is specifically used? or all the data

It should save it whenever --log is used and there should be a config option where you can leave it turned on and the location it will be saved to @aditya0yadav

@aditya0yadav
Copy link

for saving response and other in the database
should i create database with a sql script wth some func
or use some orm

@aditya0yadav
Copy link

hello
i also wanna know
i also add the code in notebook file
i am facing difficulties in creating python file with that

please help me solve this doubt of mine

@aditya0yadav
Copy link

hello i also wanna know i also add the code in notebook file i am facing difficulties in creating python file with that

please help me solve this doubt of mine

sorry doubt is solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants