MCPcopy Create free account
hub / github.com/X-PLUG/MobileAgent / add_response_old

Function add_response_old

PC-Agent/PCAgent/chat.py:33–57  ·  view source on GitHub ↗
(role, prompt, chat_history, image=None)

Source from the content-addressed store, hash-verified

31
32
33def add_response_old(role, prompt, chat_history, image=None):
34 new_chat_history = copy.deepcopy(chat_history)
35 if image:
36 base64_image = resize_encode_image(image)
37 content = [
38 {
39 "type": "text",
40 "text": prompt
41 },
42 {
43 "type": "image_url",
44 "image_url": {
45 "url": f"data:image/jpeg;base64,{base64_image}"
46 }
47 },
48 ]
49 else:
50 content = [
51 {
52 "type": "text",
53 "text": prompt
54 },
55 ]
56 new_chat_history.append([role, content])
57 return new_chat_history
58
59
60def add_response(role, prompt, chat_history, image=[], use_qwen=False):

Callers

nothing calls this directly

Calls 1

resize_encode_imageFunction · 0.90

Tested by

no test coverage detected