CoolFace
Apppublic

tawondazz/Mobile-Agent

sourceHugging Facemitupdated 2y agoView on Hugging Face
0likes
chat.cpython-310.pyc13 linesDownload Raw Back to __pycache__
1o

2޾zf�	�@sJddlZddlmZdd�Zdd�Zdd�Zdd	d3�Zdd�Zd
d�ZdS)�N)�encode_imagecC�"g}d}|�dd|d�gg�|S)Nz�You are a helpful AI mobile phone operating assistant. You need to help me operate the phone to complete the user's instruction.�system�text��typer��append�Zoperation_historyZ
sysetm_prompt�r�9E:\Desktop\Mobile-Agent-v2-demo-local\MobileAgent\chat.py�init_action_chat�r
cCr�Nz6You are a helpful AI mobile phone operating assistant.rrrrr4rrr�init_reflect_chatrrcCrrrr5rrr�init_memory_chatrrcCsTt�|�}|rt|�}d|d�ddd|��id�g}nd|d�g}|�||g�|S)Nrr�	image_url�url�data:image/jpeg;base64,�rr��copy�deepcopyrr	)�role�prompt�chat_history�image�new_chat_historyZbase64_image�contentrrr�add_responses"6�7�����rcCsdt�|�}t|d�}t|d�}d|d�ddd|��id�ddd|��id�g}|�||g�|S)	Nr�rrrrrrr)rrrrrZ
base64_image1Z
base64_image2rrrr�add_response_two_image5s"8�9��10���r!cCsXtd�|D]}td|d�t|ddddt|d�dd�qtd�dS)Nzd****************************************************************************************************zrole:rr rz<image>�11)�print�len)r�chatrrr�print_statusQs12.r&)N)	r�MobileAgent.apirr
rrrr!r&rrrr�<module>s13