Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 1 addition & 2 deletions cdp_use/generator/command_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ def generate_commands(self, domain: Dict[str, Any]) -> str:
commands = domain.get("commands", [])

# Always add basic imports
self.imports.add("from typing import Any, Dict, List, Optional, Union")
self.imports.add("from typing_extensions import NotRequired, TypedDict")
self.imports.add("from typing import Any, Dict, List, NotRequired, Optional, TypedDict, Union")

# Start with auto-generated header
content = """# This file is auto-generated by the CDP protocol generator.
Expand Down
3 changes: 1 addition & 2 deletions cdp_use/generator/event_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ def generate_events(self, domain: Dict[str, Any]) -> str:
events = domain.get("events", [])

# Always add basic imports
self.imports.add("from typing import Any, Dict, List, Optional, Union")
self.imports.add("from typing_extensions import NotRequired, TypedDict")
self.imports.add("from typing import Any, Dict, List, NotRequired, Optional, TypedDict, Union")

# Start with auto-generated header
content = """# This file is auto-generated by the CDP protocol generator.
Expand Down
5 changes: 2 additions & 3 deletions cdp_use/generator/type_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ def generate_types(self, domain: Dict[str, Any]) -> str:
types = domain.get("types", [])

# Always add basic imports
self.imports.add("from typing import Any, Dict, List, Optional, Union")
self.imports.add("from typing_extensions import NotRequired, TypedDict")
self.imports.add("from typing import Any, Dict, List, NotRequired, Optional, TypedDict, Union")

# First pass: collect all type names that will be defined in this domain
for type_def in types:
Expand Down Expand Up @@ -109,7 +108,7 @@ def generate_literal_type(
enum_values = type_def["enum"]

# Add Literal import
self.imports.add("from typing_extensions import Literal")
self.imports.add("from typing import Literal")

content = ""

Expand Down