def imgdiff()

in devai-cli/src/devai/commands/review.py [0:0]


def imgdiff(current, target):
    """
    This function performs an image diff analysis using the Generative Model API.

    Args:
        current (str): current state.
        target (str): target state.
    """

    before_state='''
    IMAGE 1: 

    '''
    after_state='''
    IMAGE 2:

    '''
    qry = get_prompt('review_query')

    if qry is None:
        qry='''
        INSTRUCTIONS:
        Meticulously examine the two provided images. Generate a comprehensive report detailing the specific 
        elements absent from each image in comparison to the other.  Clearly articulate the reasoning and 
        methodology employed to arrive at your conclusions.
        '''
    
    contents = [qry, after_state, load_image_from_path(current),
                before_state, load_image_from_path(target)]

    code_chat_model = GenerativeModel(MODEL_NAME)
    with telemetry.tool_context_manager(USER_AGENT):
        responses = code_chat_model.generate_content(contents, stream=True)

    for response in responses:
        print(response.text, end="")