mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 09:14:59 +00:00
wip
This commit is contained in:
parent
6e03d2f214
commit
c8e8967d45
2 changed files with 13 additions and 7 deletions
|
@ -1,33 +1,34 @@
|
||||||
import argparse
|
import argparse
|
||||||
import json
|
import json
|
||||||
|
|
||||||
import markdown
|
import markdown
|
||||||
|
|
||||||
import tiktoken
|
import tiktoken
|
||||||
from prompt_toolkit.completion import Completion
|
|
||||||
|
|
||||||
from aider import prompts
|
from aider import models, prompts
|
||||||
|
from aider.dump import dump # noqa: F401
|
||||||
|
from aider.sendchat import simple_send_with_retries
|
||||||
|
|
||||||
from .dump import dump # noqa: F401
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("filename", help="Markdown file to parse")
|
parser.add_argument("filename", help="Markdown file to parse")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
with open(args.filename, 'r') as f:
|
with open(args.filename, "r") as f:
|
||||||
text = f.read()
|
text = f.read()
|
||||||
|
|
||||||
md = markdown.Markdown()
|
md = markdown.Markdown()
|
||||||
tree = md.parse(text)
|
tree = md.parse(text)
|
||||||
|
|
||||||
for element in tree.getiterator():
|
for element in tree.getiterator():
|
||||||
if element.tag in ['h1', 'h4'] and element.text is not None:
|
if element.tag in ["h1", "h4"] and element.text is not None:
|
||||||
print(element.text)
|
print(element.text)
|
||||||
elif element.tag == 'blockquote':
|
elif element.tag == "blockquote":
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
print(element.text)
|
print(element.text)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
||||||
|
|
|
@ -24,3 +24,8 @@ And got this output:
|
||||||
|
|
||||||
{output}
|
{output}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# CHAT HISTORY
|
||||||
|
summarize = """
|
||||||
|
Summarize the conversation.
|
||||||
|
"""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue