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

Ensure things don't break if you load a conversation from an uninstalled model #92

Closed
simonw opened this issue Jul 11, 2023 · 3 comments
Labels
bug Something isn't working enhancement New feature or request
Milestone

Comments

@simonw
Copy link
Owner

simonw commented Jul 11, 2023

Refs:

If someone installs a plugin, logs some responses from it, then uninstalls the plugin, stuff should not break.

@simonw simonw added the enhancement New feature or request label Jul 11, 2023
@simonw simonw added this to the 0.5 milestone Jul 11, 2023
@simonw
Copy link
Owner Author

simonw commented Jul 12, 2023

I tried running a markov prompt and then uninstalling llm-markov and then running this:

llm -c hello               

Got this error:

Traceback (most recent call last):
  File "/Users/simon/Dropbox/Development/llm/llm/__init__.py", line 80, in get_model
    return aliases[name]
KeyError: 'markov'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/simon/.local/share/virtualenvs/llm-p4p8CDpq/bin/llm", line 33, in <module>
    sys.exit(load_entry_point('llm', 'console_scripts', 'llm')())
  File "/Users/simon/.local/share/virtualenvs/llm-p4p8CDpq/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/Users/simon/.local/share/virtualenvs/llm-p4p8CDpq/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/Users/simon/.local/share/virtualenvs/llm-p4p8CDpq/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/simon/.local/share/virtualenvs/llm-p4p8CDpq/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/simon/.local/share/virtualenvs/llm-p4p8CDpq/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/Users/simon/Dropbox/Development/llm/llm/cli.py", line 187, in prompt
    conversation = load_conversation(conversation_id)
  File "/Users/simon/Dropbox/Development/llm/llm/cli.py", line 274, in load_conversation
    conversation = Conversation.from_row(row)
  File "/Users/simon/Dropbox/Development/llm/llm/models.py", line 60, in from_row
    model=get_model(row["model"]),
  File "/Users/simon/Dropbox/Development/llm/llm/__init__.py", line 82, in get_model
    raise UnknownModelError(name)
llm.UnknownModelError: 'markov'

@simonw simonw added the bug Something isn't working label Jul 12, 2023
@simonw
Copy link
Owner Author

simonw commented Jul 12, 2023

I think running llm -c against a non-existent model should indeed throw an error, just maybe not that noisily.

@simonw
Copy link
Owner Author

simonw commented Jul 12, 2023

This will do:

% llm -c hello
Error: 'Unknown model: markov'

@simonw simonw closed this as completed in 7bef414 Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant