Skip to content

Commit

Permalink
mark _summarize_prompt() private
Browse files Browse the repository at this point in the history
  • Loading branch information
Quantisan committed Sep 28, 2023
1 parent 03f678c commit 2f45bc2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mind_palace/welcome.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def parse_abstracts(nodes) -> List[str]:
]


def summarize_prompt(abstracts: List[str]):
def _summarize_prompt(abstracts: List[str]):
bullet_points = "\n".join([f"* {text}" for text in abstracts])
return {
"system": (
Expand All @@ -27,7 +27,7 @@ def summarize_prompt(abstracts: List[str]):


def summarize(gpt_model, texts: List[str]):
prompt = summarize_prompt(texts)
prompt = _summarize_prompt(texts)
messages = [
ChatMessage(role="system", content=prompt["system"]),
ChatMessage(role="user", content=prompt["user"]),
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_welcome.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_parse_abstracts():

def test_summarize_prompt():
abstracts = ["this is abstract", "second abstract"]
prompt = w.summarize_prompt(abstracts)
prompt = w._summarize_prompt(abstracts)
assert isinstance(prompt, dict)
assert isinstance(prompt["system"], str)
assert re.search(r"'''\* this is abstract\n\* second abstract'''", prompt["user"])
Expand Down

0 comments on commit 2f45bc2

Please sign in to comment.