|
|
@@ -1,4 +1,4 @@
|
|
|
-from agent import Glm, KeyWordPrompt
|
|
|
+from agent import Glm, Prompt
|
|
|
class Agent:
|
|
|
|
|
|
_instance = None
|
|
|
@@ -16,7 +16,7 @@ class Agent:
|
|
|
def brand_key_word_judgement(self, brandname, title):
|
|
|
"""判断是否为关键词引流"""
|
|
|
self.glm.set_modelname("glm-4-plus")
|
|
|
- prompt = KeyWordPrompt.EXTRACT_INFO_FROM_TITLE + f"""
|
|
|
+ prompt = Prompt.EXTRACT_INFO_FROM_TITLE + f"""
|
|
|
请根据上述逻辑,分析以下商品标题,并输出结果:
|
|
|
商品标题:{brandname}
|
|
|
给定的引流品牌:{title}"""
|
|
|
@@ -31,7 +31,7 @@ class Agent:
|
|
|
license_list_str += f"{product}\n"
|
|
|
|
|
|
self.glm.set_modelname("glm-4-plus")
|
|
|
- prompt = KeyWordPrompt.LICENSE_LIST_FILTER + f"""
|
|
|
+ prompt = Prompt.LICENSE_LIST_FILTER + f"""
|
|
|
请根据上述逻辑,分析以下商品是否为授权生产的,并输出结果:
|
|
|
商品标题: {title}
|
|
|
已生产的产品清单:
|
|
|
@@ -59,7 +59,7 @@ class Agent:
|
|
|
def image_logo_judgement(self, logo_path, image_url):
|
|
|
"""判断图像中是否有指定品牌的logo"""
|
|
|
self.glm.set_modelname("glm-4v-plus-0111")
|
|
|
- prompt = KeyWordPrompt.IMAGE_LOGO_JUDGEMENT
|
|
|
+ prompt = Prompt.IMAGE_LOGO_JUDGEMENT
|
|
|
response = self.glm.multi_epoch_image_response(logo_path, image_url, prompt)
|
|
|
response = response.content
|
|
|
|