Update app.py
Browse files81 unmodified lines828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152858687134 unmodified lines22222322429322522622781 unmodified lines message = llm.invoke(messages) return {"messages": [message]}
# system_prompt_Movement = """# You are Movement agent. Your task is to assist with physical movement or navigation-related tasks. Provide clear and concise instructions to help achieve the user's goals.# You just need to make movement plan that follow the user in the room.# you will be provided with image and what objects you will follow in the image.# You have 4 wheels that you can control (Front_Right(FR), Front_Left(FL), Back_Right(BR), back_Left(BL)).# the speed of each wheel can be set from 0 to 10.# the direction of each wheel can be set to Forward, Backward, or Stop.# You will generate a movement plan in json format based on the image and the object you will follow.# Make the movement plan same as real world movement of cars.# the json format of the movment is like this that you will generate based on the image.# Here are some examples of movement plans you can generate based on different scenarios:# Movement plan example:# ````# {# "direction": "forward",# "4wheels": {# "FR": {"speed": 10, "Direction": "Forward"},# "FL": {"speed": 10, "Direction": "Forward"},# "BR": {"speed": 10, "Direction": "Forward"},# "BL": {"speed": 10, "Direction": "Forward"}# }# }# ````# ````# {# "direction": "backward",# "4wheels": {# "FR": {"speed": 10, "Direction": "Backward"},# "FL": {"speed": 10, "Direction": "Backward"},# "BR": {"speed": 10, "Direction": "Backward"},# "BL": {"speed": 10, "Direction": "Backward"}# }# }# ````# ````# {# "direction": "left",# "4wheels": {# "FR": {"speed": 10, "Direction": "Forward"},# "FL": {"speed": 5, "Direction": "Forward"},# "BR": {"speed": 10, "Direction": "Forward"},# "BL": {"speed": 5, "Direction": "Forward"}# }# }# ````# ````# {# "direction": "right",# "4wheels": {# "FR": {"speed": 5, "Direction": "Forward"},# "FL": {"speed": 10, "Direction": "Forward"},# "BR": {"speed": 5, "Direction": "Forward"},# "BL": {"speed": 10, "Direction": "Forward"}# }# }# ````# ````
# "direction": "forward_left_diagonal",# "4wheels": {# "FR": {"speed": 0, "Direction": "Stop"},# "FL": {"speed": 10, "Direction": "Forward"},# "BR": {"speed": 10, "Direction": "Forward"},# "BL": {"speed": 0, "Direction": "Stop"}# }# }# ````# """
system_prompt_Movement = """You are Movement agent. Your task is to assist with physical movement or navigation-related tasks. 134 unmodified linesimport reimport asyncio
def extract_json_from_response(response: str): # Try to find the first JSON object in the response string match = re.search(r'(\{[\s\S]*\})', response)app.py-69