import { TwinAISdk, getClient } from '@twinai/sdk'
const client: TwinAISdk = getClient({
endpoint,
apiKey,
})
The client
exposes the following methods:
-
uploadFile(file: Stream): Promise<string>
: Uploads a file, and returns the ID of the generated file models. -
createFile(): Promise<CreateFileMutation>
: Creates a new file model, and returns the ID and upload location of the model. -
getRunResult(runId: string): Promise<RunByWorkflowNameMutation>
: Retrieves the result of a run. -
runByWorkflowName(workflowName: string, fileId: string): Promise<GetRunResultQuery>
: Runs a workflow by name, and returns the ID of the run.