ai-sdk-next-openai/app/api/use-object-expense-tracker/schema.ts
2025-09-26 15:46:29 +00:00

22 lines
651 B
TypeScript

import { DeepPartial } from 'ai';
import { z } from 'zod';
export const expenseSchema = z.object({
expense: z.object({
category: z
.string()
.describe(
'Category of the expense. Allowed categories: TRAVEL, MEALS, ENTERTAINMENT, OFFICE SUPPLIES, OTHER.',
),
amount: z.number().describe('Amount of the expense in USD.'),
date: z
.string()
.describe('Date of the expense. Format yyyy-mmm-dd, e.g. 1952-Feb-19.'),
details: z.string().describe('Details of the expense.'),
}),
});
export type Expense = z.infer<typeof expenseSchema>['expense'];
export type PartialExpense = DeepPartial<Expense>;