From 50cdba30525518e142f5f7d0686ac5fc2617cb65 Mon Sep 17 00:00:00 2001 From: shenchucheng <60704484+shenchucheng@users.noreply.github.com> Date: Mon, 7 Aug 2023 10:16:00 +0800 Subject: [PATCH] Update write_docstring.py to make the template of the prompt more clear --- metagpt/actions/write_docstring.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/metagpt/actions/write_docstring.py b/metagpt/actions/write_docstring.py index cc4d7d904..db1928872 100644 --- a/metagpt/actions/write_docstring.py +++ b/metagpt/actions/write_docstring.py @@ -23,7 +23,9 @@ class ExampleError(Exception): ``` ### Output Example -```python{example}``` +```python +{example} +``` ''' # https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html @@ -120,9 +122,9 @@ class ExampleError(Exception): ''' _python_docstring_style = { - "google": PYTHON_DOCSTRING_EXAMPLE_GOOGLE, - "numpy": PYTHON_DOCSTRING_EXAMPLE_NUMPY, - "sphinx": PYTHON_DOCSTRING_EXAMPLE_SPHINX, + "google": PYTHON_DOCSTRING_EXAMPLE_GOOGLE.strip(), + "numpy": PYTHON_DOCSTRING_EXAMPLE_NUMPY.strip(), + "sphinx": PYTHON_DOCSTRING_EXAMPLE_SPHINX.strip(), }