Skip to content

image_tokens missing from embedding response model #711

@nathan-chappell

Description

@nathan-chappell

SDK Version (required)
5.20.0

Describe the bug
Type for response from embedding API does not match with response.

I don't know if you guys need to regenerate the SDK from the API, update the API definition, or find a new generator, but the ApiMetaBilledUnits has an attribute images, while the response returned has an attribute image_tokens.

The generator using # type: ignore and ConfigDict(extra='allow') hides the issue.

# printing the billed units from a response
print(resp.meta.billed_units.model_dump_json(indent=2))
# output
{
  "images": null,
  "input_tokens": 0.0,
  "output_tokens": null,
  "search_units": null,
  "classifications": null,
  "image_tokens": 2716 # this attribute is not featured in the model
}

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