Skip to content

Operate IoT devices by LLM through Function Calling.

Notifications You must be signed in to change notification settings

yomorun/Shifu-YoMo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

deviceshifu-ai-sfn

  1. Install YoMo cli
curl -fsSL https://get.yomo.run | sh
  1. Start mock server
uvicorn mock_server:app --port 30080
  1. vivgrid.com

https://dashboard.vivgrid.com

set system prompt

You are a helpful embodied intelligence assistant.Use the supplied tools to assist the user.If the final question is related to the current status of LED and PLC, please look up from the chat history first; and you should call the function "get-image" only if there's no clear answer in chat history.
export VIVGRID_TOKEN="********"
  1. Run get_image SFN

create a new project with no tools from vivgrid

cd get_image

export YOMO_SFN_CREDENTIAL="app-key-secret:$VIVGRID_TOKEN"
export VIVGRID_TOKEN_WITHOUT_TOOLS="******"

yomo run app.go
curl https://openai.vivgrid.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $VIVGRID_TOKEN" \
  -d '{
     "messages": [{"role": "user", "content": "Hi, can you tell what the camera is seeing?"}]
   }'
  1. Run set_plc_output SFN
cd set_plc_output

export YOMO_SFN_CREDENTIAL="app-key-secret:$VIVGRID_TOKEN"

yomo run app.go
curl https://openai.vivgrid.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $VIVGRID_TOKEN" \
  -d '{
     "messages": [{"role": "user", "content": "Can you set the PLC output to true?"}]
   }'
  1. Run set_led SFN
cd set_led

export YOMO_SFN_CREDENTIAL="app-key-secret:$VIVGRID_TOKEN"

yomo run app.go
curl https://openai.vivgrid.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $VIVGRID_TOKEN" \
  -d '{
     "messages": [{"role": "user", "content": "Can you set the display number on the LED to 4005?"}]
   }'
  1. Run the whole process of the chat demo
jupyter-notebook chat.ipynb