Two docstrings in openapi_tool document parameters the signatures do not accept
維護者通常 3 天內回覆
評估
- 難度
- 1/5
- 預估耗時
- 1 小時以內
- 新手友好度
- 88/100
- Issue 類型
- 文件
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- python
研究方向
閱讀 src/google/adk/tools/openapi_tool/openapi_spec_parser/rest_api_tool.py:352 和 src/google/adk/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.py:69 中的 docstring,並對照相應的方法簽章。更新第一處,將 parsed_operation_str 描述為 JSON 字串,並從第二處刪除不存在的引數 auth_scheme。當兩個 Args 區段都與其簽章和型別一致時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
Two docstrings in google/adk document parameters that the signatures do not accept
Both are in the OpenAPI tooling under src/google/adk/tools/openapi_tool/. Neither affects behaviour; both mislead anyone reading the reference for the tool-building path.
1. RestApiTool.from_parsed_operation_str — wrong name and wrong type
src/google/adk/tools/openapi_tool/openapi_spec_parser/rest_api_tool.py:352
@classmethod
def from_parsed_operation_str(
cls, parsed_operation_str: str
) -> "RestApiTool":
"""Initializes the RestApiTool from a dict.
Args:
parsed: A dict representation of a ParsedOperation object.
...
operation = ParsedOperation.model_validate_json(parsed_operation_str)
The parameter is parsed_operation_str, and it is a JSON string (model_validate_json), not a dict. Both halves of the sentence are stale: the name and the type.
2. OAuth2CredentialExchanger.generate_auth_token — documents a parameter that is not there
src/google/adk/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.py:69
def generate_auth_token(
self,
auth_credential: Optional[AuthCredential] = None,
) -> AuthCredential:
"""Generates an auth token from the authorization response.
Args:
auth_scheme: The OpenID Connect or OAuth2 auth scheme.
auth_credential: The auth credential.
auth_scheme is not a parameter of this method (the scheme was consumed by AuthCredential earlier in the flow). auth_credential is.
Suggested diff
--- a/src/google/adk/tools/openapi_tool/openapi_spec_parser/rest_api_tool.py
+++ b/src/google/adk/tools/openapi_tool/openapi_spec_parser/rest_api_tool.py
@@
- """Initializes the RestApiTool from a dict.
+ """Initializes the RestApiTool from a serialized ParsedOperation.
Args:
- parsed: A dict representation of a ParsedOperation object.
+ parsed_operation_str: A JSON string representation of a ParsedOperation object.
--- a/src/google/adk/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.py
+++ b/src/google/adk/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.py
@@
Args:
- auth_scheme: The OpenID Connect or OAuth2 auth scheme.
auth_credential: The auth credential.
How this was found
A static check over Google-style Args: blocks that reports entries whose name is not an argument of the enclosing function; the two rows above were then read against the signatures by hand. A repo-wide run also flagged application_integration_toolset.py and the _execute_sql_* helpers in the BigQuery integration, but those are **kwargs forwarding and a nested-section parse, i.e. not defects, so they are excluded here.
Why an issue and not a PR
CONTRIBUTING.md requires a signed Google CLA before a PR, and the google-cla check fails for this account (confirmed on a separate Google repository — google/XNNPACK#11910 shows cla/google failing until the agreement is signed). If you would rather have the patch directly, I can open the PR as soon as the CLA is signed on my side; otherwise this report is everything needed for the two-line fix.
- 主要語言
- Python
- 星號
- 22.3k
- 分支
- 4.4k
- 平均合併
- 1 天 2 小時
- 30 天內合併 PR
- 6
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
google/adk-python 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
google/adk-python#8360 ·
維護者通常 3 天內回覆
-
難度 2/5 1-3 小時 新手友好度 82/100
google/adk-python#8359 ·
維護者通常 3 天內回覆
-
Can pin to litellm version be changed?可能已有人在做 @llalitkumarrr 於 10 天前認領。 未關閉models
難度 1/5 1 小時以內 新手友好度 65/100
google/adk-python#8129 · 2 則留言 · 已指派 1 人 ·
維護者通常 3 天內回覆
-
OpenAPI tools ignore operation- and path-level server overrides可能已有人在做 @sanketpatil06 於 14 天前認領。 未關閉tools
難度 2/5 1-3 小時 新手友好度 75/100
google/adk-python#8064 · 4 則留言 · 已指派 1 人 ·
維護者通常 3 天內回覆
-
`adk run` does not support arrow keys or input history可能已有人在做 @llalitkumarrr 於 17 天前認領。 未關閉cli
難度 1/5 1-3 小時 新手友好度 84/100
google/adk-python#8022 · 2 則留言 · 已指派 1 人 ·
維護者通常 3 天內回覆
查看 google/adk-python 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
vllm-project/vllm#70030 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
TigreGotico/tugaphone#408 ·
維護者通常 1 天內回覆
-
t: bug
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 3 天內回覆
-
needs-triage
難度 1/5 1 小時以內 新手友好度 85/100
Azure/azure-sdk-for-python#50155 · 1 個 reaction ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 66/100
維護者通常 1 天內回覆