Skip to content

[Python SDK] Add return type to Agent.__init__ #113

@santoshkumarradha

Description

@santoshkumarradha

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 -> None return type and some parameter types may be incomplete

Tasks

  1. Add -> None return type annotation
  2. Verify all parameters have complete type annotations
  3. 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 -> None return 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomershelp wantedExtra attention is neededsdk:pythonPython SDK relatedtype-safetyTypeScript or Python type improvements

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions