Skip to content

Incorrect type definition for tools on vertexai.agent_engines.LangchainAgent #5786

@ShivMunagala

Description

@ShivMunagala

Submitting this issue before opening a PR to resolve it.

In vertexai.agent_engines.templates.langchain.py, the type definition for tools in the LangchainAgent class is Optional[Sequence["_ToolLike"]] = None,. However, _ToolLike is defined as _ToolsType, which itself is defined as _ToolsType = Sequence[_ToolType], so we are unnecessarily getting nested sequences. This causes mypy to give an error saying it expects elements (tools) of LangchainAgent(tools=[...]) to be of type Sequence.

Environment details

  • OS type and version: macOS Sequoia 15.6.1
  • Python version: 3.11.6
  • pip version: 25.2
  • google-cloud-aiplatform version: 1.111.

Metadata

Metadata

Assignees

Labels

api: vertex-aiIssues related to the googleapis/python-aiplatform API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions