Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(embeddings): raise error message on missing data #2369

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

Merged

Conversation

schuellerf
Copy link
Contributor

I had a setup where my embedding model didn't reply properly and had a really hard time figuring out where
"NoneType object is not iterable" comes from.
With this error message, it should be easier to find the problem.

Possibly this is a bad place to create this exception, so please hint me into the right direction. I just
debugged my problem down to this place.

  • I understand that this repository is auto-generated and my pull request may not be merged

@schuellerf schuellerf requested a review from a team as a code owner May 21, 2025 19:05
@schuellerf schuellerf force-pushed the improve-missing-embeddings-error-message branch from dcf2023 to 03feca5 Compare May 21, 2025 19:05
@RobertCraigie
Copy link
Collaborator

Thanks for the PR, was this happening against a custom server? or the official OpenAI API?

@schuellerf
Copy link
Contributor Author

This happened against a custom vLLM server where just the model selection was wrong and it took long to find the problem without a message like this.

Copy link
Collaborator

@RobertCraigie RobertCraigie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I think you'll need to do this for the async client as well and add a # pyright: ignore comment to fix some lint errors

@schuellerf schuellerf force-pushed the improve-missing-embeddings-error-message branch 2 times, most recently from 4ec1664 to 408abc7 Compare July 10, 2025 12:36
I had a setup where my embedding model didn't reply properly
and had a really hard time figuring out where
"NoneType object is not iterable" comes from.
With this error message, it should be easier to find the problem.
@schuellerf schuellerf force-pushed the improve-missing-embeddings-error-message branch from 408abc7 to d965927 Compare July 10, 2025 12:38
@schuellerf
Copy link
Contributor Author

@RobertCraigie Thanks for the review, I implemented also for the async client and changed the implementation so it should pass the linter (without an exception)

@schuellerf schuellerf requested a review from RobertCraigie July 10, 2025 12:43
@RobertCraigie RobertCraigie changed the title feat(api): return better error message on missing embedding fix(embeddings): raise error message on missing data Jul 10, 2025
@RobertCraigie RobertCraigie changed the base branch from main to next July 10, 2025 12:46
Copy link
Collaborator

@RobertCraigie RobertCraigie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@RobertCraigie RobertCraigie merged commit e53464a into openai:next Jul 10, 2025
3 of 4 checks passed
@stainless-app stainless-app bot mentioned this pull request Jul 10, 2025
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