18 lines
429 B
TypeScript
18 lines
429 B
TypeScript
|
import { BaseAPIClient } from "./types"
|
||
|
|
||
|
export interface AIEndpoints {
|
||
|
generateCronExpression: (prompt: string) => Promise<{ message: string }>
|
||
|
}
|
||
|
|
||
|
export const buildAIEndpoints = (API: BaseAPIClient): AIEndpoints => ({
|
||
|
/**
|
||
|
* Generates a cron expression from a prompt
|
||
|
*/
|
||
|
generateCronExpression: async (prompt: string) => {
|
||
|
return await API.post({
|
||
|
url: "/api/ai/cron",
|
||
|
body: { prompt },
|
||
|
})
|
||
|
},
|
||
|
})
|