googleapis / googleapis/python-genai

AttributeError: module 'google.genai.types' has no attribute 'FileSearchTool'

Open
#1,670 3 comments 0 reactions 1 assignee Claimed by @Venkaiahbabuneelam View on GitHub
priority: p2 type: bug
Dominant language
Python
Stars
4k
Forks
1k
Avg merge
2d 11h
Merged PRs (30d)
40

Description

#### Environment details

- Programming language: Python 3.12
- OS: MacOS
- Language runtime version: 3.12
- Package version: 1.50.0

Problem:

We tried to use the newly released Gemini FileSearch API.

Here is the code snippet

`response = client.models.generate_content(
model="gemini-2.5-flash",
contents="""Can you list courses related to Law ?""",
config=types.GenerateContentConfig(
tools=[
types.Tool(
file_search=types.FileSearchTool(
file_search_store_names=[file_search_store.name]
)
)
]
)
)

print(response.text)`

This is throwing error AttributeError: module 'google.genai.types' has no attribute 'FileSearchTool'

The same feature i tried in the nodeJS library and its working fine.

Thanks!
Sijohn Mathew

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.