ai-docstring icon indicating copy to clipboard operation
ai-docstring copied to clipboard

Error: Request failed with status code 403

Open maxludden opened this issue 2 years ago • 3 comments

Error: Request failed with status code 403

Anytime I've tried to use autodocstring in VS Code, it generates a docstring with arguments, inserts it, successfully inserts the docstring the produces and error code 403.

Versions (please complete the following information):

  • autoDocstring Version: v0.1.3
  • Operating System: Mac OS 14.1 (23B74)
  • Vscode Version: 1.84.1 (Universal)

Original Code (with line to generate on):

class TableOfContents(BaseModel):
    """Super Gene's Table of Contents."""
    chapters: List[TocChapter] = []
    
    def __init__(
        self,
        html: Path = TOC_HTML_PATH,
        save: bool = True,
        verbose: bool = False) -> None:
       """${cursor}"""

Expected Result:

class TableOfContents(BaseModel):
    """Super Gene's Table of Contents."""
    chapters: List[TocChapter] = []
    
    def __init__(
        self,
        html: Path = TOC_HTML_PATH,
        save: bool = True,
        verbose: bool = False) -> None:
        """The table of contents.

        Args:
            html (Path, optional): The path to the table of contents html file. Defaults to 
                  TOC_HTML_PATH.
            save (bool, optional): Whether to save the table of contents to disk after initializing 
                  it. Defaults to True.
            verbose (bool, optional): Whether to print logging messages to the console. Defaults 
                 to False.
        """

Actual Result:

class TableOfContents(BaseModel):
    """Super Gene's Table of Contents."""
    chapters: List[TocChapter] = []
    
    def __init__(
        self,
        html: Path = TOC_HTML_PATH,
        save: bool = True,
        verbose: bool = False) -> None:
        """AI is creating summary for __init__

        Args:
            html (Path, optional): [description]. Defaults to TOC_HTML_PATH.
            save (bool, optional): [description]. Defaults to True.
            verbose (bool, optional): [description]. Defaults to False.
        """

Stack trace: If an error was reported by autodocstring please copy the stack trace from the autoDocstring output channel.

[INFO 07:09:30.485] ai-docstring was activated
[INFO 09:38:20.492] Generating Docstring at line: 124
[INFO 09:38:20.496] Docstring generated:
        """${1:AI is creating summary for parse_dict}

        Args:
            arg (${2:dict[str, int}): ${3:[description]}
            verbose (${4:bool}, optional): ${5:[description]}. Defaults to False.

        Raises:
            TypeError: ${6:[description]}
            ValueError: ${7:[description]}
            ValueError: ${8:[description]}
            ValueError: ${9:[description]}

        Returns:
            ${10:[type]}: ${11:[description]}
        """
[INFO 09:38:20.496] Inserting at position: 124 0
[INFO 09:38:20.503] Successfully inserted docstring
[ERROR 09:38:20.510] Error: Request failed with status code 403
[INFO 11:58:35.684] Generating Docstring at line: 225
[INFO 11:58:35.688] Docstring generated:
        """${1:AI is creating summary for __init__}

        Args:
            html (${2:Path}, optional): ${3:[description]}. Defaults to TOC_HTML_PATH.
            save (${4:bool}, optional): ${5:[description]}. Defaults to True.
            verbose (${6:bool}, optional): ${7:[description]}. Defaults to False.
        """
[INFO 11:58:35.688] Inserting at position: 225 0
[INFO 11:58:35.735] Successfully inserted docstring
[ERROR 11:58:35.741] Error: Request failed with status code 403

Additional context Add any other context about the problem here.

maxludden avatar Nov 09 '23 17:11 maxludden

I get only AI is creating summary for ${class} output where ${class} is the name of the class when I generate docstring in Python.

lulunac27a avatar Dec 08 '23 19:12 lulunac27a

same issue, is this repo still actively supporting by someone?

eric-easyhealth avatar Jul 04 '24 07:07 eric-easyhealth

I have the same issue as @lulunac27a

bsassoli avatar Aug 04 '24 12:08 bsassoli