Giter Site home page Giter Site logo

pair's People

Contributors

amy-why avatar wskish avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pair's Issues

/url doesnt support 'content type: text/plain'

Using pair and running /url https://raw.githubusercontent.com/goharbor/harbor/main/api/v2.0/swagger.yaml it fails to retrieve the document with errors:

2023-06-25 23:47:42.715 | WARNING  | pair_ai.extract:get_url_text:62 - https://raw.githubusercontent.com/goharbor/harbor/main/api/v2.0/swagger.yaml
2023-06-25 23:47:42.716 | WARNING  | pair_ai.retry:f_retry:40 - Exception: Unsupported content type: text/plain; charset=utf-8
2023-06-25 23:47:42.716 | INFO     | pair_ai.retry:f_retry:41 - retrying in 0.5 seconds

Thanks

ChatContext got unexpected argument

This looks really awesome! However, it's not working for me.
After a fresh install with pip install pair_ai, I get this error:

$ pair                                    
Traceback (most recent call last):
  File "/Users/daviddavini/Code/patchgpt/venv/bin/pair", line 5, in <module>
    from pair_ai.pair import repl
  File "/Users/daviddavini/Code/patchgpt/venv/lib/python3.11/site-packages/pair_ai/pair.py", line 29, in <module>
    chat_ctx = ChatContext(min_response_tokens=800,  # leave room for at least this much
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: ChatContext.__init__() got an unexpected keyword argument 'max_context_assistant_messages'

Issue with first launching pair (deprecated pydantic?)

I am running into an issue: I installed pair with pip and there appeared to be no problem. I try to launch (exporting the necessary variables) and then get this error, whether I try to open a pair or with a file. Can you please advise?

(pair) antonio @ ~/Documents/endorse $ pair 
Traceback (most recent call last):
  File "/Users/antonio/anaconda3/envs/pair/bin/pair", line 5, in <module>
    from pair_ai.pair import repl
  File "/Users/antonio/anaconda3/envs/pair/lib/python3.9/site-packages/pair_ai/pair.py", line 4, in <module>
    from chatstack import ChatContext, UserMessage
  File "/Users/antonio/anaconda3/envs/pair/lib/python3.9/site-packages/chatstack/__init__.py", line 2, in <module>
    from .chatstack import SystemMessage, ContextMessage, UserMessage, ChatRoleMessage, AssistantMessage, ChatContext
  File "/Users/antonio/anaconda3/envs/pair/lib/python3.9/site-packages/chatstack/chatstack.py", line 14, in <module>
    class ChatRoleMessage(BaseModel):
  File "/Users/antonio/anaconda3/envs/pair/lib/python3.9/site-packages/chatstack/chatstack.py", line 23, in ChatRoleMessage
    def compute_tokens(cls, values) -> int:
  File "/Users/antonio/anaconda3/envs/pair/lib/python3.9/site-packages/pydantic/deprecated/class_validators.py", line 222, in root_validator
    return root_validator()(*__args)  # type: ignore
  File "/Users/antonio/anaconda3/envs/pair/lib/python3.9/site-packages/pydantic/deprecated/class_validators.py", line 228, in root_validator
    raise PydanticUserError(
pydantic.errors.PydanticUserError: If you use `@root_validator` with pre=False (the default) you MUST specify `skip_on_failure=True`. Note that `@root_validator` is deprecated and should be replaced with `@model_validator`.


For further information visit https://errors.pydantic.dev/2.0.3/u/root-validator-pre-skip
(pair) antonio @ ~/Documents/endorse $ pair test.py 
Traceback (most recent call last):
  File "/Users/antonio/anaconda3/envs/pair/bin/pair", line 5, in <module>
    from pair_ai.pair import repl
  File "/Users/antonio/anaconda3/envs/pair/lib/python3.9/site-packages/pair_ai/pair.py", line 4, in <module>
    from chatstack import ChatContext, UserMessage
  File "/Users/antonio/anaconda3/envs/pair/lib/python3.9/site-packages/chatstack/__init__.py", line 2, in <module>
    from .chatstack import SystemMessage, ContextMessage, UserMessage, ChatRoleMessage, AssistantMessage, ChatContext
  File "/Users/antonio/anaconda3/envs/pair/lib/python3.9/site-packages/chatstack/chatstack.py", line 14, in <module>
    class ChatRoleMessage(BaseModel):
  File "/Users/antonio/anaconda3/envs/pair/lib/python3.9/site-packages/chatstack/chatstack.py", line 23, in ChatRoleMessage
    def compute_tokens(cls, values) -> int:
  File "/Users/antonio/anaconda3/envs/pair/lib/python3.9/site-packages/pydantic/deprecated/class_validators.py", line 222, in root_validator
    return root_validator()(*__args)  # type: ignore
  File "/Users/antonio/anaconda3/envs/pair/lib/python3.9/site-packages/pydantic/deprecated/class_validators.py", line 228, in root_validator
    raise PydanticUserError(
pydantic.errors.PydanticUserError: If you use `@root_validator` with pre=False (the default) you MUST specify `skip_on_failure=True`. Note that `@root_validator` is deprecated and should be replaced with `@model_validator`.

For further information visit https://errors.pydantic.dev/2.0.3/u/root-validator-pre-skip

/file fails hard, if it receives a directory by accident

I have a file called config.ru``config/config.rb and when typing this, I might end up pressing <ENTER> while I haven't finished typing. This means /file config would be executed.

This leads to an exception and pair exits right away

/file config
Traceback (most recent call last):
  File "/usr/local/bin/pair", line 8, in <module>
    sys.exit(repl())
             ^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pair_ai/pair.py", line 64, in repl
    with open(file_path, 'r') as file:
         ^^^^^^^^^^^^^^^^^^^^
IsADirectoryError: [Errno 21] Is a directory: 'config'

Diff detection regex is incorrect

The regex re.search(r'```diff(.*?)```', cr.text, re.DOTALL)" is searching for a marker that is part of Github's proprietary Markdown syntax to enable code highlighting.

The base prompt is asking for output compatible with the patch command, so pair is not detecting any of the code diffs that I generate unless I start them with "generate a github markdown diff...".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.