OPENAI OSS 120B Converse Streaming Tool use arguments parser

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

メンテナーはふだん 1 日以内に返信

@notgitika がすでに取り組んでいます。

2026年4月21日 から。

評価

この issue はまだ評価されていません。

説明

Describe the bug
I'm using "openai.gpt-oss-120b-1:0" with converse_stream. Cannot parse toolUser arguments when trigger toolUse

Image

To Reproduce
Just run any toolUse that have toolUser arguments

Issue:
Stop reason: tool_use
[DEBUG TOOL INPUT RAW]: {
":822customer_identity",
Name Doe
[ERROR] JSON decode failed

Expected behavior
should return a valid json for toolUser arguments like
{"name": "john"}

Additional context
My Code:

MODEL_ID = "openai.gpt-oss-120b-1:0"


bedrock_config = Config(
    region_name=AWS_REGION,
    max_pool_connections=100,
    retries={"max_attempts": 3, "mode": "standard"},
    connect_timeout=3,
    read_timeout=60,
    tcp_keepalive=True
)

client = boto3.client(
    "bedrock-runtime",
    region_name=AWS_REGION,
    config=bedrock_config,
    aws_access_key_id=AWS_ACCESS_KEY,
    aws_secret_access_key=AWS_SECRET_KEY
)


class AwsBedRockLLM:

    @classmethod
    def make_stream(
            cls,
            messages,
            model,
            system_message,
            tool_list=None,
            instructions=None,
            agent_id=None,
            call_id=None,
    ):
        system_prompt = instructions if instructions else system_message
        payload = {
            "modelId": model,
            "system": [{"text": system_prompt}] if system_prompt else [],
            "messages": cls.convert_messages_for_bedrock(messages),
            "inferenceConfig": {
                "temperature": 0.5,
                "maxTokens": 800,
                "topP": 0.9
            },
            "performanceConfig": {"latency": "standard"}
        }
        # document here: https://docs.aws.amazon.com/bedrock/latest/userguide/inference-parameters.html

        if tool_list:
            payload["toolConfig"] = {
                "tools": tool_list,
                "toolChoice": {
                    "auto": {}
                }
            }

        response = client.converse_stream(**payload)

        return response


主要言語
Python
スター
786
フォーク
163
平均マージ
4時間
マージ済み PR(30日)
22

環境構築

はじめの一歩

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

aws/bedrock-agentcore-sdk-python のほかの issue

aws/bedrock-agentcore-sdk-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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