task="What were the winning boston marathon times for the past 5 years (ending in 2022)? Generate a table of the year, name, country of origin, and times."
print("We receive a state of type",type(state),"For state: ",state,"\n\n")
state_text="\n".join(state)
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
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")
@ -185,9 +200,15 @@ if inference_mode != "huggingface":
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"})
inference_result={"error":"service related to ControlNet is not available."}
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",
},
)
inference_result={
"error":"service related to ControlNet is not available."
eliftaskin["summarization","translation","conversational","text-generation","text2text-generation"]:# ChatGPT Can do
eliftaskin[
"summarization",
"translation",
"conversational",
"text-generation",
"text2text-generation",
]:# ChatGPT Can do
best_model_id="ChatGPT"
reason="ChatGPT performs well on some NLP tasks as well."
choose={"id":best_model_id,"reason":reason}
messages=[{
messages=[
{
"role":"user",
"content":f"[ {input} ] contains a task in JSON format {command}. Now you are a {command['task']} system, the arguments are {command['args']}. Just help me do {command['task']} and give me the result. The result must be in text form without any urls."
}]
"content":f"[ {input} ] contains a task in JSON format {command}. Now you are a {command['task']} system, the arguments are {command['args']}. Just help me do {command['task']} and give me the result. The result must be in text form without any urls.",
"Please answer all the named entities in the sentence: 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.",
"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"
"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."""},
{
"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.""",
print("Welcome to Jarvis! A collaborative system that consists of an LLM as the controller and numerous expert models as collaborative executors. Jarvis can plan tasks, schedule Hugging Face models, generate friendly responses based on your requests, and help you with many things. Please enter your request (`exit` to exit).")
print(
"Welcome to Jarvis! A collaborative system that consists of an LLM as the controller and numerous expert models as collaborative executors. Jarvis can plan tasks, schedule Hugging Face models, generate friendly responses based on your requests, and help you with many things. Please enter your request (`exit` to exit)."
logging.error(f"Failed to initialize vector store: {e}")
@ -102,9 +100,13 @@ class Boss:
Tool(
name="Goal Decomposition Tool",
func=todo_chain.run,
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."
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",
),
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")
"Finance Agent":"You are a seasoned finance analyst AI assistant. Your primary goal is to compose comprehensive, astute, impartial, and methodically arranged financial reports based on provided data and trends.",
"Travel Agent":"You are a world-travelled AI tour guide assistant. Your main purpose is to draft engaging, insightful, unbiased, and well-structured travel reports on given locations, including history, attractions, and cultural insights.",
"Academic Research Agent":"You are an AI academic research assistant. Your primary responsibility is to create thorough, academically rigorous, unbiased, and systematically organized reports on a given research topic, following the standards of scholarly work.",
"Default Agent":"You are an AI critical thinker research assistant. Your sole purpose is to write well written, critically acclaimed, objective and structured reports on given text."
"Default Agent":"You are an AI critical thinker research assistant. Your sole purpose is to write well written, critically acclaimed, objective and structured reports on given text.",
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.
Usethisconversationhistorytomakeyourdecision.
@ -47,10 +45,12 @@ Conversation history:
{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.",
'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.",