Remove the outdated code/ and expl_struct/
This commit is contained in:
parent
704f2e3b92
commit
b63e48c8a4
@ -1 +0,0 @@
|
||||
description: Generate code with a general template embedded into the prompt.
|
@ -1,28 +0,0 @@
|
||||
As a software developer assistant, your tasks are to:
|
||||
|
||||
- Provide a clear and concise response to address the user's requirements.
|
||||
- Write code and give advice based on given code or information in the <context> if provided.
|
||||
- Follow language-specific best practices and common coding standards.
|
||||
|
||||
When responding:
|
||||
|
||||
1. First summarize the requirements or provided information in your own words.
|
||||
The summary should better be written in bullet points (excluding code).
|
||||
2. When modifying the provided code, include the entire modified functions, but exclude any unmodified functions.
|
||||
If any global statements are changed, include the full global statements; otherwise, do not include them.
|
||||
3. Enclose code or changes within blocks using triple backticks (```), and include the programming language and the file path.
|
||||
For example:
|
||||
```python path=./path/to/file.py
|
||||
print("Hello, World!")
|
||||
```
|
||||
Do your best to deduce the file path based on the given <context> or previous messages.
|
||||
If you are still uncertain about the file path of the code, feel free to omit it.
|
||||
4. Use separate code blocks for different files.
|
||||
5. When providing a suggestion or instruction, begin by explaining the reason behind it.
|
||||
6. You may not receive all the direct information needed for your task.
|
||||
Analyze the given <context> to understand how existing code was written, and use this knowledge for your task.
|
||||
7. Note that not all previous messages or contexts are necessarily relevant.
|
||||
8. Respond in the language of the request.
|
||||
|
||||
You may encounter duplicate or conflicting messages or contexts, and the later ones should be considered as the most accurate.
|
||||
If you need more information, ask for it.
|
@ -1 +0,0 @@
|
||||
description: Generate code with a Python-specific template embedded into the prompt.
|
@ -1,5 +0,0 @@
|
||||
When writing Python code, maintain compliance with PEP-8 guidelines:
|
||||
- Include type hints where appropriate.
|
||||
- Provide docstrings for classes and functions.
|
||||
- Specify an encoding when opening documents. E.g., `open(file_path, encoding="utf-8")`.
|
||||
- Follow other best practices in PEP-8.
|
@ -1,5 +0,0 @@
|
||||
description: Explain the structure of the repository.
|
||||
hint: Help me understand the structure of this repo
|
||||
input: optional
|
||||
steps:
|
||||
- run: $command_python $command_path/main.py "$input"
|
@ -1,44 +0,0 @@
|
||||
import os
|
||||
import sys
|
||||
from typing import Optional
|
||||
|
||||
import click
|
||||
from chat.ask_codebase.assistants.directory_structure.repo_explainer import (
|
||||
RepoStructureExplainer,
|
||||
)
|
||||
|
||||
sys.path.append(os.path.join(os.path.dirname(__file__), "..", "libs"))
|
||||
|
||||
from chatmark import Step # noqa: E402
|
||||
|
||||
Languages = {
|
||||
"en": "English",
|
||||
"zh": "Chinese",
|
||||
}
|
||||
|
||||
|
||||
@click.command()
|
||||
@click.argument("objective", required=False, default=None)
|
||||
@click.option(
|
||||
"-lang",
|
||||
"--language",
|
||||
type=click.Choice(list(Languages.keys()), case_sensitive=False),
|
||||
)
|
||||
def main(objective: Optional[str], language: str):
|
||||
if not objective:
|
||||
objective = "Help me understand the structure of this repo."
|
||||
|
||||
chat_lang = Languages.get(language, None)
|
||||
repo_path = os.getcwd()
|
||||
|
||||
e = RepoStructureExplainer(root_path=repo_path, chat_language=chat_lang)
|
||||
|
||||
with Step("Analyzing codebase..."):
|
||||
answer = e.analyze(user_query=objective)
|
||||
print("Done.", flush=True)
|
||||
|
||||
print(f"\n{answer}\n", flush=True)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
@ -1,5 +0,0 @@
|
||||
description: 解释当前代码仓库的目录结构
|
||||
hint: 请帮助我理解当前仓库的目录结构
|
||||
input: optional
|
||||
steps:
|
||||
- run: $command_python $command_path/../main.py "$input" -lang zh
|
Loading…
x
Reference in New Issue
Block a user