google / google/adk-python

BaseAuthenticatedTool saves invalid credentials

Đang mở
#3,016 1 bình luận 0 reaction 3 người được giao Được @klateefa nhận Xem trên GitHub
needs review tools
Ngôn ngữ chính
Python
Star
21.5k
Fork
4k
Merge trung bình
1 ngày 22 giờ
Pull request đã merge (30 ngày)
31

Mô tả

**Is your feature request related to a problem? Please describe.**
The BaseAuthenticatedTool `run_async` implementation obtains credentials from the tool context using the credential manager, which saves the credential for the session, before calling the tool implementation. This means that no future uses of the tool will ask for authentication, even if the user accidentally provided invalid credentials (such as an invalid username/password combo, or a token for a user account instead of an admin account).

This is problematic for automatic tool implementations like MCPTool and OpenAPITool. While a custom tool can remove the credentials from context if necessary (see https://google.github.io/adk-docs/tools/authentication/#authentication-logic-within-the-tool-function), these implementations don't allow a user to re-authenticate on failure.

**Describe the solution you'd like**
Some mechanism for removing credentials from the context when a tool responds with an unauthorized or forbidden error.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.