2024-11-26 17:51:02 +01:00
|
|
|
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
|
|
|
|
*/
|
2024-12-02 11:02:30 +01:00
|
|
|
generateCronExpression: async prompt => {
|
2024-11-26 17:51:02 +01:00
|
|
|
return await API.post({
|
|
|
|
url: "/api/ai/cron",
|
|
|
|
body: { prompt },
|
|
|
|
})
|
|
|
|
},
|
|
|
|
})
|