Skip to content

Python code defaults to 'base64' encoding_format in the embeddings endpoint, but docs say it should be 'float' #1490

Closed as not planned
@hillarysanders

Description

@hillarysanders

Confirm this is an issue with the Python library and not an underlying OpenAI API

  • This is an issue with the Python library

Describe the bug

Hi, your docs say that the default encoding_format in your embeddings/create endpoint is float, however your python package code applies a default of 'base64' when a value isn't supplied.

Can you switch this to 'float' so the python package is conformant with your docs?

To Reproduce

Run an OpenAI embeddings query with the python client:

import openai
client = openai.OpenAI(...)
response = client.embeddings.create(
   model=<model>,
   input="I am a string to embed!",
   # notably, NOT specifying encoding_format here
) 

Uses base64 encoding instead of float, oddly.

Code snippets

NA

OS

macOS

Python version

3.12.3

Library version

1.35.0

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