message=f"The server of local inference endpoints is not running, please start it first. (or using `inference_mode: huggingface` in {args.config} for a feature-limited experience)"
message=f"The server of local inference endpoints is not running, please start it first. (or using `inference_mode: huggingface` in {args.config} for a feature-limited experience)"
try:
try:
r=requests.get(Model_Server+"/running")
r=requests.get(Model_Server+"/running")
ifr.status_code!=200:
ifr.status_code!=200:
raiseValueError(message)
raiseValueError(message)
except:
exceptBaseException:
raiseValueError(message)
raiseValueError(message)
@ -222,6 +220,7 @@ elif "HUGGINGFACE_ACCESS_TOKEN" in os.environ and os.getenv("HUGGINGFACE_ACCESS_
else:
else:
raiseValueError(f"Incorrect HuggingFace token. Please check your {args.config} file.")
raiseValueError(f"Incorrect HuggingFace token. Please check your {args.config} file.")
logger.warning(f"Task {command['task']} is not available. ControlNet need to be deployed locally.")
logger.warning(f"Task {command['task']} is not available. ControlNet need to be deployed locally.")
record_case(success=False,**{"input":input,"task":command,"reason":f"Task {command['task']} is not available. ControlNet need to be deployed locally.","op":"message"})
record_case(success=False,**{"input":input,"task":command,"reason":f"Task {command['task']} is not available. ControlNet need to be deployed locally.","op":"message"})
inference_result={"error":"service related to ControlNet is not available."}
inference_result={"error":"service related to ControlNet is not available."}
{"role":"assistant","content":"""Sure. I understand your request. Based on the inference results of the models, I have generated a canny image for you. The workflow I used is as follows: First, I used the image-to-text model (nlpconnect/vit-gpt2-image-captioning) to convert the image /examples/f.jpg to text. The generated text is "a herd of giraffes and zebras grazing in a field". Second, I used the canny-control model (canny-control) to generate a canny image from the text. Unfortunately, the model failed to generate the canny image. Finally, I used the canny-text-to-image model (lllyasviel/sd-controlnet-canny) to generate a canny image from the text. The generated image is located at /images/f16d.png. I hope this answers your request. Is there anything else I can help you with?"""},
{"role":"assistant","content":"""Sure. I understand your request. Based on the inference results of the models, I have generated a canny image for you. The workflow I used is as follows: First, I used the image-to-text model (nlpconnect/vit-gpt2-image-captioning) to convert the image /examples/f.jpg to text. The generated text is "a herd of giraffes and zebras grazing in a field". Second, I used the canny-control model (canny-control) to generate a canny image from the text. Unfortunately, the model failed to generate the canny image. Finally, I used the canny-text-to-image model (lllyasviel/sd-controlnet-canny) to generate a canny image from the text. The generated image is located at /images/f16d.png. I hope this answers your request. Is there anything else I can help you with?"""},
{"role":"user","content":"""then based on the above canny image and a prompt "a photo of a zoo", generate a new image."""},
{"role":"user","content":"""then based on the above canny image and a prompt "a photo of a zoo", generate a new image."""},
#kye gomez jul 13 4:01pm, can scale up the number of swarms working on a probkem with `hivemind(swarms=4, or swarms=auto which will scale the agents depending on the complexity)`
#kye gomez jul 13 4:01pm, can scale up the number of swarms working on a probkem with `hivemind(swarms=4, or swarms=auto which will scale the agents depending on the complexity)`
#this needs to change, we need to specify exactly what needs to be imported
#this needs to change, we need to specify exactly what needs to be imported
# add typechecking, documentation, and deeper error handling
# add typechecking, documentation, and deeper error handling
# TODO: MANY WORKERS
# TODO: MANY WORKERS
@ -12,6 +12,7 @@ from swarms.swarms.swarms import HierarchicalSwarm
SALES_ASSISTANT_PROMPT="""You are a sales assistant helping your sales agent to determine which stage of a sales conversation should the agent move to, or stay at.
SALES_ASSISTANT_PROMPT="""You are a sales assistant helping your sales agent to determine which stage of a sales conversation should the agent move to, or stay at.
Following'==='istheconversationhistory.
Following'==='istheconversationhistory.
Usethisconversationhistorytomakeyourdecision.
Usethisconversationhistorytomakeyourdecision.
@ -48,11 +47,10 @@ Conversation history:
{salesperson_name}:
{salesperson_name}:
"""
"""
conversation_stages={'1':"Introduction: Start the conversation by introducing yourself and your company. Be polite and respectful while keeping the tone of the conversation professional. Your greeting should be welcoming. Always clarify in your greeting the reason why you are contacting the prospect.",
conversation_stages={'1':"Introduction: Start the conversation by introducing yourself and your company. Be polite and respectful while keeping the tone of the conversation professional. Your greeting should be welcoming. Always clarify in your greeting the reason why you are contacting the prospect.",
'2':"Qualification: Qualify the prospect by confirming if they are the right person to talk to regarding your product/service. Ensure that they have the authority to make purchasing decisions.",
'2':"Qualification: Qualify the prospect by confirming if they are the right person to talk to regarding your product/service. Ensure that they have the authority to make purchasing decisions.",
'3':"Value proposition: Briefly explain how your product/service can benefit the prospect. Focus on the unique selling points and value proposition of your product/service that sets it apart from competitors.",
'3':"Value proposition: Briefly explain how your product/service can benefit the prospect. Focus on the unique selling points and value proposition of your product/service that sets it apart from competitors.",
'4':"Needs analysis: Ask open-ended questions to uncover the prospect's needs and pain points. Listen carefully to their responses and take notes.",
'4':"Needs analysis: Ask open-ended questions to uncover the prospect's needs and pain points. Listen carefully to their responses and take notes.",
'5':"Solution presentation: Based on the prospect's needs, present your product/service as the solution that can address their pain points.",
'5':"Solution presentation: Based on the prospect's needs, present your product/service as the solution that can address their pain points.",
'6':"Objection handling: Address any objections that the prospect may have regarding your product/service. Be prepared to provide evidence or testimonials to support your claims.",
'6':"Objection handling: Address any objections that the prospect may have regarding your product/service. Be prepared to provide evidence or testimonials to support your claims.",
'7':"Close: Ask for the sale by proposing a next step. This could be a demo, a trial or a meeting with decision-makers. Ensure to summarize what has been discussed and reiterate the benefits."}
'7':"Close: Ask for the sale by proposing a next step. This could be a demo, a trial or a meeting with decision-makers. Ensure to summarize what has been discussed and reiterate the benefits."}