Bỏ qua để đến nội dung

Agent Workforce

Agent Workforce cho phép một Bestie runtime local giữ một tập agent profile cố định cùng hàng đợi task local. Tính năng này phù hợp khi công việc lặp lại cần một role có tên và task record có thể kiểm tra, thay vì một yêu cầu chat ngẫu hứng.

Agent profile và task được giữ trong Bestie runtime local. Tạo agent hoặc giao việc không tự chạy task: dùng bestie agents run khi bạn muốn xử lý các task queued.

Tạo profile với ID ổn định, tên hiển thị, role và mô tả cách làm việc:

Terminal window
bestie agents hire \
--id docs \
--name "Docs Editor" \
--role documentation \
--description "Maintain accurate local product documentation." \
--model openai/gpt-4o-mini \
--tools internal.read_url,internal.write_file

--model--tools là optional. Lệnh ghi prompt file cho agent và in path của file đó. Kiểm tra agent đã cấu hình bằng:

Terminal window
bestie agents list
bestie agents show docs

Giao task cho một agent đang có:

Terminal window
bestie agents assign \
--agent docs \
--title "Review onboarding guide" \
--brief "Check the onboarding guide against the current CLI behavior."

Xem hàng đợi, rồi chạy các task đang chờ:

Terminal window
bestie agents tasks
bestie agents tasks --agent docs --status queued
bestie agents run
bestie agents run --agent docs --limit 1

Dùng --watch để tiếp tục xử lý task mới được queue cho đến khi bạn dừng lệnh. --interval-ms điều khiển khoảng polling và phải là số nguyên dương.

Terminal window
bestie agents run --watch --interval-ms 5000

Task có các trạng thái queued, in_progress, done, blockedcanceled. Bạn có thể xem task hoặc ghi thủ công trạng thái và kết quả:

Terminal window
bestie agents task <id>
bestie agents task-status <id> --status blocked --result "Waiting for the provider configuration."

Pause agent để agent không xử lý task đang chờ, sau đó resume khi sẵn sàng:

Terminal window
bestie agents pause docs
bestie agents resume docs

Xóa profile bằng:

Terminal window
bestie agents remove docs

Hãy review task trước khi remove. Không đưa secret vào task brief vì brief được lưu local cùng workforce task record.