Skip to content

Commit

Permalink
Adjusted prompts.
Browse files Browse the repository at this point in the history
  • Loading branch information
souradipp76 committed Nov 18, 2024
1 parent 1321ed1 commit a9d66f9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ user_config = AutodocUserConfig(
)

readme_config = AutodocReadmeConfig(
headings = "# Description, # Requirements, # Installation, # Usage, # Contributing, # License"
headings = "Description,Requirements,Installation,Usage,Contributing,License"
)

index.index(repo_config)
Expand Down
2 changes: 1 addition & 1 deletion examples/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
)

readme_config = AutodocReadmeConfig(
headings = "# Description, # Requirements, # Installation, # Usage, # Contributing, # License"
headings = "Description,Requirements,Installation,Usage,Contributing,License"
)

index.index(repo_config)
Expand Down
13 changes: 5 additions & 8 deletions readme_ready/query/create_chat_chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ def make_readme_prompt(
{project_name}. You are trained on all the {content_type} that makes up
this project.
The {content_type} for the project is located at {repository_url}.
You are given the following extracted parts of a repository which might
contain several modules and each module will contain a set of files.
You are given a repository which might contain several modules and each
module will contain a set of files.
Look at the source code in the repository and you have to generate
content for the section of a README.md file following the heading given
below starting with ## based on the context. If you use any hyperlinks,
they should link back to the github repository shared with you.
below. If you use any hyperlinks, they should link back to the github
repository shared with you.
You should only use hyperlinks that are explicitly listed in the context.
Do NOT make up a hyperlink that is not listed.
Expand All @@ -125,12 +125,9 @@ def make_readme_prompt(
Provide the answer in correct markdown format.
{additional_instructions}
Question: {{input}}
Context:
{{context}}
Question: Provide the README content for the section with
heading \"{{input}}\" starting with {{input}}.
Answer in Markdown:
"""

Expand Down
5 changes: 4 additions & 1 deletion readme_ready/query/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ def generate_readme(
with open(readme_path, "a", encoding="utf-8") as file:
headings = readme_config.headings
for heading in headings:
question = f"{heading}"
question = (
"Provide the README content for the section with "
+ f"heading \"{heading}\" starting with ## {heading}."
)
try:
response = chain.invoke({"input": question})
print("\n\nMarkdown:\n")
Expand Down

0 comments on commit a9d66f9

Please sign in to comment.