MCPcopy Create free account
hub / github.com/TencentQQGYLab/AppAgent / get_model_response

Method get_model_response

scripts/model.py:79–98  ·  view source on GitHub ↗
(self, prompt: str, images: List[str])

Source from the content-addressed store, hash-verified

77 dashscope.api_key = api_key
78
79 def get_model_response(self, prompt: str, images: List[str]) -> (bool, str):
80 content = [{
81 "text": prompt
82 }]
83 for img in images:
84 img_path = f"file://{img}"
85 content.append({
86 "image": img_path
87 })
88 messages = [
89 {
90 "role": "user",
91 "content": content
92 }
93 ]
94 response = dashscope.MultiModalConversation.call(model=self.model, messages=messages)
95 if response.status_code == HTTPStatus.OK:
96 return True, response.output.choices[0].message.content[0]["text"]
97 else:
98 return False, response.message
99
100
101def parse_explore_rsp(rsp):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected