File size: 593 Bytes
58132fb
 
859368a
903bee0
58132fb
 
3a86e21
58132fb
 
 
63ac902
58132fb
 
63ac902
3a86e21
 
 
 
 
 
 
 
 
58132fb
3a86e21
 
 
58132fb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"use server"

import { ClapProject, ClapCompletionMode } from "@aitube/clap"
import { editClapDialogues as apiEditClapDialogues } from "@aitube/client"

import { getToken } from "./getToken"
import { Workaround } from "./types"

export async function editClapDialogues({
  clap,
  turbo = false,
}: {
  clap: ClapProject
  turbo?: boolean
}): Workaround<ClapProject> {
  async function promise() {
    return await apiEditClapDialogues({
      clap,
      completionMode: ClapCompletionMode.MERGE,
      turbo,
      token: await getToken()
    })
  }

  return { 
    promise: promise()
  }
}