Skip to content

progress callback #2020

Open
Open
@jeremybmerrill

Description

@jeremybmerrill

Would you be interested in a PR that would modify the existing logProgress option on BaseEmbedding to take a callback that gets called with the progress so far and the queue length.

This is useful for desktop apps where users might be shown a progress bar in the UI.

I see two ways to do it:

  1. new progressCallback arg, deprecate logProgress: maintain logProgress (for now) its functionality (since the logProgress: true option would be superseded by progressCallback: (i, queue_length) => console.log(getting embedding progress: ${i} / ${queue.length});
  2. change the type of logProgress to be a boolean or a function; if it's true, use the existing console.log.

I've used #1 (minus the deprecation of logProgress) here: https://github.com/jeremybmerrill/meaningfully/blob/feature/progress-bar/src/main/services/progressOpenAIEmbedding.ts

let me know if you want this, and I will send a PR (with tests).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions