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

Improve context by providing a repo map; Add Vertex AI integration; Add Greedy action parser for more robust code block action syntax #373

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ var/
wheels/
pip-wheel-metadata/
share/python-wheels/
workspace/
*.egg-info/
.installed.cfg
*.egg
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ AZURE_OPENAI_ENDPOINT: 'Azure OpenAI Endpoint Here if using Azure OpenAI Model'
AZURE_OPENAI_DEPLOYMENT: 'Azure OpenAI Deployment Here if using Azure OpenAI Model'
AZURE_OPENAI_API_VERSION: 'Azure OpenAI API Version Here if using Azure OpenAI Model'
OPENAI_API_BASE_URL: 'LM base URL here if using Local or alternative api Endpoint'
```
```
</details>

See the following links for tutorials on obtaining [Anthropic](https://docs.anthropic.com/claude/reference/getting-started-with-the-api), [OpenAI](https://platform.openai.com/docs/quickstart/step-2-set-up-your-api-key), and [Github](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) tokens.
Expand Down
29 changes: 29 additions & 0 deletions aiderrepomap/dump.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import json
import traceback


def cvt(s):
if isinstance(s, str):
return s
try:
return json.dumps(s, indent=4)
except TypeError:
return str(s)


def dump(*vals):
# http:https://docs.python.org/library/traceback.html
stack = traceback.extract_stack()
vars = stack[-2][3]

# strip away the call to dump()
vars = "(".join(vars.split("(")[1:])
vars = ")".join(vars.split(")")[:-1])

vals = [cvt(v) for v in vals]
has_newline = sum(1 for v in vals if "\n" in v)
if has_newline:
print("%s:" % vars)
print(", ".join(vals))
else:
print("%s:" % vars, ", ".join(vals))
Loading