flytekitplugins.openai.create_batch

flytekitplugins.openai.create_batch(name, openai_organization, secret, config=None, is_json_iterator=True, file_upload_mem='700Mi', file_download_mem='700Mi')[source]

Uploads JSON data to a JSONL file, creates a batch, waits for it to complete, and downloads the output/error JSON files.

Parameters:
  • name (str) – The suffix to be added to workflow and task names.

  • openai_organization (str) – Name of the OpenAI organization.

  • secret (Secret) – Secret comprising the OpenAI API key.

  • config (Dict[str, Any] | None) – Additional config for batch creation.

  • is_json_iterator (bool) – Set to True if you’re sending an iterator/generator; if a JSONL file, set to False.

  • file_upload_mem (str) – Memory to allocate to the upload file task.

  • file_download_mem (str) – Memory to allocate to the download file task.

Return type:

ImperativeWorkflow