adk-python icon indicating copy to clipboard operation
adk-python copied to clipboard

Cannot import HttpAuth and HttpCredentials

Open vv-varun opened this issue 1 year ago • 1 comments

Describe the bug When defining OpenAPIToolset, we cannot import HttpAuth and HttpCredentials because they are not imported in google/adk/auth/__int.py__

To Reproduce Steps to reproduce the behavior, define AuthCredential like this:

http_auth_credential = AuthCredential(
        auth_type=AuthCredentialTypes.HTTP,
        http=HttpAuth(
            scheme='bearer',
            credentials=HttpCredentials(
                token=""
            )
        )
    )

At build time, complier gives error that HttpAuth and HttpCredentials are of unknown type.

Expected behavior It should be possible to import these modules like : from google.adk.auth import OAuth2Auth, HttpAuth, HttpCredentials

Desktop:

  • OS: iOS
  • Python version(python -V): 3.12.6
  • ADK version(pip show google-adk): 1.8.0

vv-varun avatar Jul 30 '25 15:07 vv-varun

thanks for reporting the issue. you can do from google.adk.auth.auth_credential import OAuth2Auth, HttpAuth, HttpCredentials

seanzhou1023 avatar Aug 14 '25 22:08 seanzhou1023