in devai-cli/src/devai/commands/document.py [0:0]
def readme(context, file, branch):
"""Create a README based on the context passed!
This is useful when no existing README files exist. If you already have a README `update-readme` may be a better option.
"""
click.echo('Generating and printing the README....')
source='''
### Context (code) ###
{}
'''
qry = get_prompt('document_readme')
if qry is None:
qry='''
### Instruction ###
Generate a comprehensive README.md file for the provided context. The README should follow industry best practices and be suitable for professional developers. Resources like dora.dev, stc.org, and writethedocs.org should be used as guidelines.
It should be clear, concise, and easy to read written in a professional mannor conveying the project's purpose and value effectively.
### Output Format ###
A well-structured README.md file in Markdown format. The README, using markdown formatting, should include the following sections (at a minimum):
Description
Table of Contents
Features
Installation
Usage
Contributing
License
Contact
### Example Dialogue ###
Instruction:
Generate a comprehensive README.md file for the provided project. The README should follow industry best practices and be suitable for professional developers.
Context (project):
Project Name: Cymbal Coffee
Description: A Python library for data analysis and visualization, designed to simplify common data wrangling tasks and generate insightful plots.
Technologies Used: Python, Pandas, NumPy, Matplotlib, Seaborn
Features:
* Easy data loading from various sources (CSV, Excel, SQL, etc.)
* Powerful data cleaning and transformation functions
* Interactive data exploration with summary statistics and filtering
* Customizable visualization templates for common plot types
* Integration with Jupyter Notebooks for seamless analysis
Installation: pip install cymbal
Usage: See examples in the 'examples' directory or visit our documentation: [link to documentation]
Contribution Guidelines: We welcome contributions! Please follow our style guide and submit pull requests for review.
License: Apache 2.0 License
Contact Information: Email us at support@cymbal.coffee or open an issue on our GitHub repository.
'''
# Load files as text into source variable
source=source.format(format_files_as_string(context))
try:
code_chat_model = GenerativeModel(MODEL_NAME)
with telemetry.tool_context_manager(USER_AGENT):
code_chat = code_chat_model.start_chat()
code_chat.send_message(qry)
response = code_chat.send_message(source)
click.echo(f"{response.text}")
except Exception as e:
print(f"Failed to call LLM: {e}")
return
# if file and branch:
# try:
# create_github_pr(branch, {
# file: response.text,
# })
# except Exception as e:
# print(f"Failed to create pull request: {e}")