Skip to content

Commit 7dd2db7

Browse files
rushitatcursoragent
andcommitted
fix: resolve lint (I001, FA102) in responses_tool_calling example
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent a02fa1b commit 7dd2db7

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

examples/responses_tool_calling.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,22 @@
99
"""
1010

1111
import os
12+
from typing import Any, Dict, List
13+
1214
from gradient import Gradient, ResponsesModels
1315
from gradient.types.responses.response_create_response import ResponseOutputFunctionCall
1416

15-
# Load .env if available (e.g. python-dotenv)
16-
try:
17-
from dotenv import load_dotenv
18-
load_dotenv()
19-
except ImportError:
20-
pass
17+
18+
def _load_dotenv() -> None:
19+
try:
20+
from dotenv import load_dotenv
21+
22+
load_dotenv()
23+
except ImportError:
24+
pass
25+
26+
27+
_load_dotenv()
2128

2229
MODEL_ACCESS_KEY = os.environ.get("GRADIENT_MODEL_ACCESS_KEY")
2330
if not MODEL_ACCESS_KEY:
@@ -43,7 +50,7 @@
4350
}
4451

4552
# Initial conversation: single user message
46-
input_messages: list[dict] = [
53+
input_messages: List[Dict[str, Any]] = [
4754
{"type": "message", "role": "user", "content": "What's the weather in New York?"},
4855
]
4956

0 commit comments

Comments
 (0)