Skip to content
This repository was archived by the owner on Aug 17, 2026. It is now read-only.
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: resolve lint (I001, FA102) in responses_tool_calling example
Co-authored-by: Cursor <cursoragent@cursor.com>
  • Loading branch information
rushitat and cursoragent committed Feb 9, 2026
commit 7dd2db7b0a340caa2278f3fe719986aaa35a343e
21 changes: 14 additions & 7 deletions examples/responses_tool_calling.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,22 @@
"""

import os
from typing import Any, Dict, List

from gradient import Gradient, ResponsesModels
from gradient.types.responses.response_create_response import ResponseOutputFunctionCall

# Load .env if available (e.g. python-dotenv)
try:
from dotenv import load_dotenv
load_dotenv()
except ImportError:
pass

def _load_dotenv() -> None:
try:
from dotenv import load_dotenv

load_dotenv()
except ImportError:
pass


_load_dotenv()

MODEL_ACCESS_KEY = os.environ.get("GRADIENT_MODEL_ACCESS_KEY")
if not MODEL_ACCESS_KEY:
Expand All @@ -43,7 +50,7 @@
}

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

Expand Down
Loading