jiggy-ai / pair Goto Github PK
View Code? Open in Web Editor NEWREPL environment for GPT pair programming
License: Apache License 2.0
REPL environment for GPT pair programming
License: Apache License 2.0
for documentation Or reference code purpose.
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...".
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
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'
I see a lot of recent activity in this repository.
When you think it's appropriate, you can submit it to https://github.com/radi-cho/awesome-gpt4/.
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'
/status
should tell me, if OPEN_API_KEY is set (and if it works) and which model will be used.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.