print("We receive a state of type",type(state),"For state: ",state,"\n\n")
prompt=f""" To achieve the following goal: '{initial_prompt}', pessimistically value the context of the past solutions and more importantly the latest generated solution you had AS A FLOAT BETWEEN 0 AND 1\n
WorkerMulti-ModalAgentisabletoprocessandunderstandlargeamountsoftextandimages.Asalanguagemodel,WorkerMulti-ModalAgentcannotdirectlyreadimages,butithasalistoftoolstofinishdifferentvisualtasks.Eachimagewillhaveafilenameformedas"image/xxx.png",andWorkerMulti-ModalAgentcaninvokedifferenttoolstoindirectlyunderstandpictures.Whentalkingaboutimages,WorkerMulti-ModalAgentisverystricttothefilenameandwillneverfabricatenonexistentfiles.Whenusingtoolstogeneratenewimagefiles,WorkerMulti-ModalAgentisalsoknownthattheimagemaynotbethesameastheuser's demand, and will use other visual question answering tools or description tools to observe the real image. Worker Multi-Modal Agent is able to use tools in a sequence, and is loyal to the tool observation outputs rather than faking the image content and image file name. It will remember to provide the file name from the last tool observation, if a new image is generated.
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:
r=requests.get(Model_Server+"/running")
ifr.status_code!=200:
raiseValueError(message)
except:
exceptBaseException:
raiseValueError(message)
@ -222,6 +220,7 @@ elif "HUGGINGFACE_ACCESS_TOKEN" in os.environ and os.getenv("HUGGINGFACE_ACCESS_
else:
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.")
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."}
"please dub for me: 'Iron Man is a superhero appearing in American comic books published by Marvel Comics. The character was co-created by writer and editor Stan Lee, developed by scripter Larry Lieber, and designed by artists Don Heck and Jack Kirby.'"
"Given an image: https://huggingface.co/datasets/mishig/sample_images/resolve/main/palace.jpg, please answer the question: What is on top of the building?",
"Please generate a canny image based on /examples/f.jpg"
{"role":"user","content":"Please generate a canny image based on /examples/f.jpg"},
{"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."""},
stage_analyzer_inception_prompt_template="""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.
description="Use Case: Decompose ambitious goals into as many explicit and well defined tasks for an AI agent to follow. Rules and Regulations, don't use this tool too often only in the beginning when the user grants you a mission."
),
Tool(name="Swarm Worker Agent",func=worker_node,description="Use Case: When you want to delegate and assign the decomposed goal sub tasks to a worker agent in your swarm, Rules and Regulations, Provide a task specification sheet to the worker agent. It can use the browser, process csvs and generate content")
@ -108,9 +110,9 @@ class Boss:
suffix="""Question: {task}\n{agent_scratchpad}"""
prefix="""You are a Boss in a swarm who performs one task based on the following objective: {objective}. Take into account these previously completed tasks: {context}.\n"""
#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
# add typechecking, documentation, and deeper error handling
#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
# add typechecking, documentation, and deeper error handling
# TODO: MANY WORKERS
importconcurrent.futures
@ -12,13 +12,14 @@ from swarms.swarms.swarms import HierarchicalSwarm
@ -19,7 +19,7 @@ Attention: Use '##' to split sections, not '#', and '## <SECTION_NAME>' SHOULD W
## Task list: Provided as Python list[str]. Each str is a filename, the more at the beginning, the more it is a prerequisite dependency, should be done first
## Shared Knowledge: Anything that should be public like utils' functions, config's variables details that should make clear first.
## Shared Knowledge: Anything that should be public like utils' functions, config's variables details that should make clear first.
## Anything UNCLEAR: Provide as Plain text. Make clear here. For example, don't forget a main entry. don't forget to init 3rd party libs.
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.
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.",
'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.",
'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.",
'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."}
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.",
'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.",
'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.",
'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."}
# TODO: User task => decomposed into very small sub tasks => sub tasks assigned to workers => workers complete and update the swarm, can ask for help from other agents.
# TODO: User task => decomposed into very small sub tasks => sub tasks assigned to workers => workers complete and update the swarm, can ask for help from other agents.
# TODO: Missing, Task Assignment, Task delegation, Task completion, Swarm level communication with vector db
# TODO: Pass in abstract LLM class that can utilize Hf or Anthropic models, Move away from OPENAI
# TODO: ADD Universal Communication Layer, a ocean vectorstore instance
# TODO: BE MORE EXPLICIT ON TOOL USE, TASK DECOMPOSITION AND TASK COMPLETETION AND ALLOCATION
# TODO: Add RLHF Data collection, ask user how the swarm is performing
# TODO: Create an onboarding process if not settings are preconfigured like `from swarms import Swarm, Swarm()` => then initiate onboarding name your swarm + provide purpose + etc
# TODO: Create an onboarding process if not settings are preconfigured like `from swarms import Swarm, Swarm()` => then initiate onboarding name your swarm + provide purpose + etc