Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

LLM sometimes generates incorrect Markdown strings, need to improve parse_args logic

オープン
#81 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
backend

調査の方向性

示されている extract_codeblock のロジックから始め、exec_shell の前にバッククォートが2つしかない不正な Markdown 応答を再現します。この応答に必要なパーサーの動作を特定し、その後、有効なコードブロックが引き続き機能し、不正なコマンドが "No API call found" エラーを生成しなくなることを確認します。

索引モデルが issue の本文から書いたものです。

説明

Describe the bug
LLM(I am using GPT-4-mini with Openrouter) sometimes generates commands like this:

  8   │   │   {
    1 │   │   │   "role": "assistant",
    2 │   │   │   "content": "``exec_shell(\"kubectl get pods -n test-social-network\")```"
    3 │   │   },
    4 │   │   {
    5 │   │   │   "role": "env",
    6 │   │   │   "content": "Error parsing response: No API call found!"
    7 │   │   },

Notice that there are only 2 ticks before the exec_shell. It repeats the same mistake for the entire run.

The logic for extracting code block:

    def extract_codeblock(self, response: str) -> str:
        """Extract a markdown code block from a string.

        Args:
            response (str): The response string.

        Returns:
            str: The extracted code block.
        """
        outputlines = response.split("\n")
        indexlines = [i for i, line in enumerate(outputlines) if "```" in line]
        if len(indexlines) < 2:
            return ""
        return "\n".join(outputlines[indexlines[0] + 1 : indexlines[1]])

The function will return an empty string from the above command, thus "No API call" error.

It does not always happen.

Instead of additional prompting, it is more robust to address this issue on the parser side.

主要言語
Python
スター
989
フォーク
176
平均マージ
7日 15時間
マージ済み PR(30日)
3

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/AIOpsLab のほかの issue

microsoft/AIOpsLab の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。