simonw / llm-command-r

Access the Cohere Command R family of models
Apache License 2.0
32 stars 3 forks source link

If llm logs are turned off, using command-r-search gives an error #5

Open kintopp opened 7 months ago

kintopp commented 7 months ago
Traceback (most recent call last):
  File "/Users/abosse/.local/bin/llm", line 10, in <module>
    sys.exit(cli())
             ^^^^^
  File "/Users/abosse/Library/Application Support/pipx/venvs/llm/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/abosse/Library/Application Support/pipx/venvs/llm/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/abosse/Library/Application Support/pipx/venvs/llm/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/abosse/Library/Application Support/pipx/venvs/llm/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/abosse/Library/Application Support/pipx/venvs/llm/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/abosse/Library/Application Support/pipx/venvs/llm/lib/python3.11/site-packages/llm_command_r.py", line 52, in command_r_search
    if (logs_on() or log) and not no_log:
                     ^^^
NameError: name 'log' is not defined

Turn llm logs back on, and all is well.