opensouls / terminal-copilot

A smart terminal assistant that helps you find the right command.
Apache License 2.0
573 stars 43 forks source link

build_conversation should take usermessage=None as default input #49

Closed jose-moran closed 10 months ago

jose-moran commented 11 months ago

Referencing this: https://github.com/opensouls/terminal-copilot/blob/50c1f6cd5cadbccc84b2d88a43501fac6e284152/copilot/messages_builder.py#L65

Running on MacOS with zsh and using Python 3.11. Typically, I get this:

❯ copilot list directory
Traceback (most recent call last):
  File "/Users/jmoran/anaconda3/bin/copilot", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/jmoran/anaconda3/lib/python3.11/site-packages/copilot/main.py", line 74, in main
    conversation = build_conversation(context)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: build_conversation() missing 1 required positional argument: 'usermessage'

But this is an easy fix: I imagine that the python version this was tested is <3.11. I suggest changing the function definition's first line to

def build_conversation(context: Context, usermessage: Optional[str]=None) -> Conversation:

which works fine for me (although I am not sure yet this doesn't break something else).

github-actions[bot] commented 11 months ago

Hey! Thanks for sharing feedback with the community!

hariveliki commented 10 months ago

@jose-moran THX

JoelKronander commented 10 months ago

fixed by PR