Skip to content

Commit

Permalink
fix: added some comments, and strip.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Nov 5, 2023
1 parent c8fbb1e commit d2f65d2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions gptme/tools/reduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def reduce_log(

def truncate_msg(msg: Message, lines_pre=10, lines_post=10) -> Message | None:
"""Truncates message codeblocks to the first and last `lines_pre` and `lines_post` lines, keeping the rest as `[...]`."""
# TODO: also truncate long <details> (as can be found in GitHub issue comments)
content_staged = msg.content

# Truncate long codeblocks
Expand Down
2 changes: 2 additions & 0 deletions scripts/describe_api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Describes the API of a given Python file such that a LLM can easily get a summary of the API in a codefile (and later an entire project).
NOTE: this is easier to do with ctags
"""
import click
import jedi
Expand Down
6 changes: 6 additions & 0 deletions scripts/strip.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#gh issue view $ISSUE_NUMBER > issue.md
#gh issue view $ISSUE_NUMBER -c > comments.md

# strip long <details>...</details> from issue.md and comments.md
perl -0777 -i -pe 's/\n<details>.*?<\/details>//sg' issue.md
perl -0777 -i -pe 's/\n<details>.*?<\/details>//sg' comments.md

0 comments on commit d2f65d2

Please sign in to comment.