eli64s / readme-ai

README file generator, powered by large language model APIs 👾
MIT License
1.34k stars 143 forks source link

Add additional repo metadata to llm prompts. #69

Closed eli64s closed 8 months ago

eli64s commented 8 months ago

Restructure LLM prompts and add additional repository metadata to give the model more overall context of the user's codebase.

For example, the prompt to generate the project overview summary is as follows:

overview = """Generate a <=100 word summary that describes the capabilities of the repository {0}.
Focus on the project's use-case and value proposition, not its technical details.
Do not refer to the project using the URL provided. Below are more details of the
project for you can get a deep understanding of the codebase and its components.
Repository Details:
\nDirectory Tree: {1}\nDependencies: {2}\nCode Summaries: {3}\n
"""

The prompt is injected with the repository URL, a directory tree, list of project dependencies, and the previous code summaries the model generated.