Skip to content

Commit 728c47d

Browse files
committed
fix(genai): Linter suggestion
1 parent dd504dc commit 728c47d

File tree

4 files changed

+16
-18
lines changed

4 files changed

+16
-18
lines changed

genai/tools/noxfile_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@
3939
# A dictionary you want to inject into your test. Don't put any
4040
# secrets here. These values will override predefined values.
4141
"envs": {},
42-
}
42+
}

genai/tools/test_tools.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414

1515
import os
1616

17-
import tools_code_exec_with_txt_local_img
1817
import tools_code_exec_with_txt
19-
import tools_func_desc_with_txt
18+
import tools_code_exec_with_txt_local_img
2019
import tools_func_def_with_txt
20+
import tools_func_desc_with_txt
2121
import tools_google_search_with_txt
2222

2323
os.environ["GOOGLE_GENAI_USE_VERTEXAI"] = "True"
@@ -26,26 +26,26 @@
2626
# os.environ['GOOGLE_CLOUD_PROJECT'] = "add-your-project-name"
2727

2828

29-
def test_tools_func_def_with_txt() -> None:
30-
response = tools_func_def_with_txt.generate_content()
29+
def test_tools_code_exec_with_txt() -> None:
30+
response = tools_code_exec_with_txt.generate_content()
3131
assert response
3232

3333

34-
def test_tools_func_desc_with_txt() -> None:
35-
response = tools_func_desc_with_txt.generate_content()
34+
def test_tools_code_exec_with_txt_local_img() -> None:
35+
response = tools_code_exec_with_txt_local_img.generate_content()
3636
assert response
3737

3838

39-
def test_tools_google_search_with_txt() -> None:
40-
response = tools_google_search_with_txt.generate_content()
39+
def test_tools_func_def_with_txt() -> None:
40+
response = tools_func_def_with_txt.generate_content()
4141
assert response
4242

4343

44-
def test_tools_code_exec_with_txt_local_img() -> None:
45-
response = tools_code_exec_with_txt_local_img.generate_content()
44+
def test_tools_func_desc_with_txt() -> None:
45+
response = tools_func_desc_with_txt.generate_content()
4646
assert response
4747

4848

49-
def test_tools_code_exec_with_txt() -> None:
50-
response = tools_code_exec_with_txt.generate_content()
49+
def test_tools_google_search_with_txt() -> None:
50+
response = tools_google_search_with_txt.generate_content()
5151
assert response

genai/tools/tools_code_exec_with_txt.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from google.genai.types import Part
16-
1715

1816
def generate_content() -> str:
1917
# [START genai_function_calling_code_execution]

genai/tools/tools_code_exec_with_txt_local_img.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def generate_content() -> GenerateContentResponse:
3737

3838
# Pass multimedia input as additional context to the model.
3939
# File source: https://upload.wikimedia.org/wikipedia/commons/thumb/3/3f/Monty_open_door.svg/640px-Monty_open_door.svg.png
40-
image_data = Image.open(open('./test_data/640px-Monty_open_door.svg.png', 'rb'))
40+
image_data = Image.open(open("./test_data/640px-Monty_open_door.svg.png", "rb"))
4141

4242
code_execution_tool = Tool(code_execution=ToolCodeExecution())
4343

@@ -50,11 +50,11 @@ def generate_content() -> GenerateContentResponse:
5050
),
5151
)
5252

53-
print('# Code:')
53+
print("# Code:")
5454
for part in response.candidates[0].content.parts:
5555
if part.executable_code:
5656
print(part.executable_code)
57-
print('# Outcome:')
57+
print("# Outcome:")
5858
for part in response.candidates[0].content.parts:
5959
if part.code_execution_result:
6060
print(part.code_execution_result)

0 commit comments

Comments
 (0)