-
Notifications
You must be signed in to change notification settings - Fork 124
Open
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededsdk:pythonPython SDK relatedPython SDK relatedtype-safetyTypeScript or Python type improvementsTypeScript or Python type improvements
Description
Summary
Add proper type annotations to the Agent.__init__ method in the Python SDK to improve type safety and IDE support.
Current State
- File:
sdk/python/agentfield/agent.py - Method:
Agent.__init__ - Issue: Missing
-> Nonereturn type and some parameter types may be incomplete
Tasks
- Add
-> Nonereturn type annotation - Verify all parameters have complete type annotations
- Use proper typing constructs (
Optional,Union, etc.)
Example Fix
# Before
def __init__(
self,
node_id: str,
server: str = "http://localhost:8080",
port: Optional[int] = None,
dev_mode: bool = False,
callback_url: Optional[str] = None,
**kwargs,
):
...
# After
def __init__(
self,
node_id: str,
server: str = "http://localhost:8080",
port: Optional[int] = None,
dev_mode: bool = False,
callback_url: Optional[str] = None,
**kwargs: Any,
) -> None:
...Acceptance Criteria
-
Agent.__init__has-> Nonereturn type - All parameters have type annotations
- Type checker passes (mypy or pyright)
- Linting passes (
ruff check)
Files
sdk/python/agentfield/agent.py
Using AI to solve this issue? Read our AI-Assisted Contributions guide for testing requirements, prompt strategies, and common pitfalls to avoid.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededsdk:pythonPython SDK relatedPython SDK relatedtype-safetyTypeScript or Python type improvementsTypeScript or Python type improvements