Reorganize imports in client.py

- Move json import to top-level imports
- Add asyncio and contextlib.suppress imports for future use
- Remove inline json import from query method

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Ashwin Bhat 2025-08-31 21:59:47 -07:00
parent cc81142feb
commit baee8bae42
No known key found for this signature in database

View file

@ -1,7 +1,10 @@
"""Claude SDK Client for interacting with Claude Code."""
import asyncio
import json
import os
from collections.abc import AsyncIterable, AsyncIterator
from contextlib import suppress
from typing import Any
from ._errors import CLIConnectionError
@ -164,8 +167,6 @@ class ClaudeSDKClient:
if not self._query or not self._transport:
raise CLIConnectionError("Not connected. Call connect() first.")
import json
# Handle string prompts
if isinstance(prompt, str):
message = {