Skip to content

Add function to list previous runs#7

Merged
ezzcodeezzlife merged 3 commits intoezzcodeezzlife:mainfrom
Christopher-Hayes:patch-1
Jul 24, 2022
Merged

Add function to list previous runs#7
ezzcodeezzlife merged 3 commits intoezzcodeezzlife:mainfrom
Christopher-Hayes:patch-1

Conversation

@Christopher-Hayes
Copy link
Copy Markdown
Contributor

@Christopher-Hayes Christopher-Hayes commented Jul 24, 2022

This adds a function to list prevous runs.

Options

limit: A limit argument is optional, by default gets the last 50 runs, which is what the Dalle UI uses.

fromTs: Get runs from a specific timestamp (ts). Uses time in milliseconds.

Example usage

import { Dalle } from "dalle-node";

const dalle = new Dalle('bearer-token');

const last50Runs = dalle.list()

const last3Runs = dalle.list({ limit: 3 })

const getRunsAfterTimestamp = dalle.list({ fromTs: 12345679 })

Returns an array of these objects

  {
    object: 'task',
    id: '<task-id>',
    created: 123456789,
    task_type: 'text2im',
    status: 'succeeded',
    status_information: {},
    prompt_id: '<prompt-id>',
    generations: [Object],
    prompt: [Object]
  }

@ezzcodeezzlife
Copy link
Copy Markdown
Owner

wow. thank you ❤️

@ezzcodeezzlife ezzcodeezzlife merged commit 705df67 into ezzcodeezzlife:main Jul 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants