import axiosClient from "./axiosClient";

export const aiApi = {
  improveText: async (text: string): Promise<string> => {
    const { data } = await axiosClient.post<{ improvedText: string }>(
      "/ai/improve",
      { text }
    );
    return data.improvedText;
  },
  
  mergeNotes: async (notes: string[]): Promise<string> => {
    const { data } = await axiosClient.post<{ mergedText: string }>(
      "/ai/merge",
      { notes }
    );
    return data.mergedText;
  },

  generateTags: async (text: string): Promise<string[]> => {
    const { data } = await axiosClient.post<{ tags: string[] }>(
      "/ai/generate-tags",
      { text }
    );
    return data.tags;
  },
};
