Skip to content

Get the total tokens used in the image description #2271

@ezequiel88

Description

@ezequiel88

Currently, I only get the result of the image description in the pipeline.

I also need to get the total tokens consumed in the request to the remote model.

Example:

return {
        "response": res.choices[0].message.content,
        "tokens": {
            "prompt": res.usage.prompt_tokens,
            "completion": res.usage.completion_tokens,
            "total": res.usage.total_tokens,
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions