Skip to content

kingwingfly/rXiaoAiLLM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

use xiaoai::{load_or_login_and_save_with_env, device_by_alias, OpPayloadBuilder, OpResponse, OpApi, ApiCaller as _};

let auth_data = load_or_login_and_save_with_env("auth_data.json").await.unwrap();
let device = device_by_alias(&auth_data, "卧室的小爱/XiaoAi in bedroom").await.unwrap();
let payload = OpPayloadBuilder::new(&auth_data, &device.device_id).volume(50);
let resp: OpResponse = OpApi::request(payload).await.unwrap();
let payload = OpPayloadBuilder::new(&auth_data, &device.device_id).speak("Hello world!");
let resp: OpResponse = OpApi::request(payload).await.unwrap();

let payload = LastAskPayload::new(&auth_data, &device, 2);
let resp: LastAskResponse = RecordApi::request(payload).await.unwrap();

account_id and account_password can be loaded from env var.

ACCOUNT_ID=
ACCOUNT_PASSWORD=

Supported operations:

  • speak
  • volume
  • pause and resume
  • play url
  • status query
  • query chat history or record

Acknowledgement

About

Call LLM from XiaoAi rewritten in Rust. [WIP] 小爱同学调用大语言模型

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages