Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function to list previous runs #7

Merged
merged 3 commits into from
Jul 24, 2022
Merged

Add function to list previous runs #7

merged 3 commits into from
Jul 24, 2022

Conversation

Christopher-Hayes
Copy link
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
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