def _process_response(response_text: str, return_type: Optional[Type[BaseModel]]) -> Any:
    """Processes the LLM response text based on the expected return type.
    
    This internal helper function handles the conversion of raw LLM response text
    to the appropriate return type.
    
    Args:
        response_text: Raw text response from the LLM
        return_type: Expected return type (Pydantic model) or None
        
    Returns:
        - If return_type is specified: JSON-parsed response
        - If return_type is None: Raw response text
    """
    if return_type:
        return json.loads(response_text)
    return response_text
Processes the LLM response text based on the expected return type.
    
    This internal helper function handles the conversion of raw LLM response text
    to the appropriate return type.
    
    Args:
        response_text: Raw text response from the LLM
        return_type: Expected return type (Pydantic model) or None
        
    Returns:
        - If return_type is specified: JSON-parsed response
        - If return_type is None: Raw response text
    
smartfunc/__init__.py