Expense submission is a strong AI widget scenario because users need both conversation and action. They ask what is reimbursable, upload a receipt, confirm extracted values, and then submit the request into the finance workflow.
With Client SDK, the peer stays inside Studio while your app handles device access, file picking, OCR fallbacks, and workflow submission.
When to reach for this recipe
If your team needs the capabilities described above and you'd rather build on proven primitives than wire one from scratch — this is the shape to start from.
Architecture
Client SDK is the integration surface. The widget sits in your employee app, while a Studio peer handles guidance, follow-up questions, and structured tool selection.
Client tools bridge the conversation with product actions such as opening the camera, selecting a receipt from storage, calling your OCR service, or submitting the expense to ERP.
1. Add Receipt And Submission Tools
Expose only the actions your app can safely execute on behalf of the signed-in employee.
1constexpenseTools=[
2{
3type:'function',
4function:{
5name:'pickReceiptFromDevice',
6description:'Open the native file picker and return the selected receipt metadata',
7parameters:{
8type:'object',
9properties:{},
10},
11},
12implementation:async()=>{
13constreceipt=awaitopenReceiptPicker();
14returnJSON.stringify(receipt);
15},
16},
17{
18type:'function',
19function:{
20name:'createExpenseDraft',
21description:'Create a draft expense request in the finance system',
- Guides employees during receipt submission
- Uses native file picker or camera access through client tools
- Creates structured expense drafts in your own workflow backend
- Avoids rebuilding peer logic separately for web and mobile experiences