-
Notifications
You must be signed in to change notification settings - Fork 308
Fix OpenAI client usage example for embeddings #720
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ZahraDehghani99 thanks a lot for the PR! I've included some extra comments, but other than that LGTM 🤗
…rl, fix closing backticks
Co-authored-by: Alvaro Bartolome <[email protected]>
Thank you so much @alvarobartt for all your helpful suggestions! I’ve applied all of them and cleaned up the examples, including fixing the backticks and removing the accidentally added duplicate from GitHub UI. I also added the port number in the curl request so it works correctly. Please let me know if there’s anything else I should adjust 😊 |
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Thanks @ZahraDehghani99, merging to main now 🔥 ![]() |
Title
docs(tei): fix OpenAI client usage example for embeddings
PR Description
This PR updates the documentation for using the OpenAI Python client with TEI’s OpenAI-compatible API.
The previous example incorrectly set the
base_url
to/v1/embeddings
, which caused errors.It also did not mention that the OpenAI client requires an
api_key
argument (even if unused by TEI).Changes made:
base_url
tohttp://localhost:8080/v1
api_key="fake"
to satisfy the OpenAI client requirementsresponse.data[0].embedding
for clarityMotivation:
Improve usability of the TEI docs by providing a working out-of-the-box example for developers who want to use the OpenAI client with TEI.
Fixes:
N/A (documentation improvement)
Before submitting
Who can review?
Tagging maintainer for review:
@Narsil