This is probably a user error, but i wrote two functions with the same name in multiple .py files and llm barfed with strange-looking sqlite errors, and I needed to spend way more time than necessary to figure that out.
It would be nice if llm can detect these as errors and display more intuitively.
➜ llm prompt -T llm_time -T llm_time hi
Hello! How can I assist you today?
Traceback (most recent call last):
File "/Users/miyagawa/.local/bin/llm", line 8, in <module>
sys.exit(cli())
^^^^^
File "/Users/miyagawa/.local/pipx/venvs/llm/lib/python3.12/site-packages/click/core.py", line 1442, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/miyagawa/.local/pipx/venvs/llm/lib/python3.12/site-packages/click/core.py", line 1363, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/Users/miyagawa/.local/pipx/venvs/llm/lib/python3.12/site-packages/click/core.py", line 1830, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/miyagawa/.local/pipx/venvs/llm/lib/python3.12/site-packages/click/core.py", line 1226, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/miyagawa/.local/pipx/venvs/llm/lib/python3.12/site-packages/click/core.py", line 794, in invoke
return callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/miyagawa/.local/pipx/venvs/llm/lib/python3.12/site-packages/llm/cli.py", line 923, in prompt
response.log_to_db(db)
File "/Users/miyagawa/.local/pipx/venvs/llm/lib/python3.12/site-packages/llm/models.py", line 1585, in log_to_db
sync_response.log_to_db(db)
File "/Users/miyagawa/.local/pipx/venvs/llm/lib/python3.12/site-packages/llm/models.py", line 918, in log_to_db
db["tool_responses"].insert(
File "/Users/miyagawa/.local/pipx/venvs/llm/lib/python3.12/site-packages/sqlite_utils/db.py", line 3219, in insert
return self.insert_all(
^^^^^^^^^^^^^^^^
File "/Users/miyagawa/.local/pipx/venvs/llm/lib/python3.12/site-packages/sqlite_utils/db.py", line 3351, in insert_all
self.insert_chunk(
File "/Users/miyagawa/.local/pipx/venvs/llm/lib/python3.12/site-packages/sqlite_utils/db.py", line 3109, in insert_chunk
result = self.db.execute(query, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/miyagawa/.local/pipx/venvs/llm/lib/python3.12/site-packages/sqlite_utils/db.py", line 533, in execute
return self.conn.execute(sql, parameters)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sqlite3.IntegrityError: UNIQUE constraint failed: tool_responses.tool_id, tool_responses.response_id
This is probably a user error, but i wrote two functions with the same name in multiple
.pyfiles and llm barfed with strange-looking sqlite errors, and I needed to spend way more time than necessary to figure that out.It would be nice if llm can detect these as errors and display more intuitively.