-
-
Notifications
You must be signed in to change notification settings - Fork 144
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
update embeddings example #27
Conversation
An embeddings example that will actually work
Update README.md
@@ -237,7 +237,8 @@ Creates an embedding vector representing the input text. | |||
|
|||
```csharp | |||
var api = new OpenAIClient(); | |||
var result = await api.EmbeddingsEndpoint.CreateEmbeddingAsync("The food was delicious and the waiter..."); | |||
var model = await api.ModelsEndpoint.GetModelDetailsAsync("text-embedding-ada-002"); | |||
var result = await api.EmbeddingsEndpoint.CreateEmbeddingAsync("The food was delicious and the waiter...", model); |
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.
@ADefWebserver did you have trouble with the default model it's trying to use?
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.
What did not work was:
var result = await api.EmbeddingsEndpoint.CreateEmbeddingAsync("The food was delicious and the waiter...", Model.Ada)
It took me awhile to figure out how I could follow the directions from here: https://openai.com/blog/new-and-improved-embedding-model and use this library. So it's not an 'error' just a 'clarification'.
Also, I spent a week coming up with an end-to-end embeddings example: https://github.com/SyncfusionSuccinctlyE-Books/OpenAI-Succinctly/blob/main/Pages/EmbeddingExample.razor
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.
Very cool!
Thanks for the feedback. I think a good proper solution might be to add some additional checks in the method to ensure the model is right for embedding, and also adding more default static models to the Model
class.
Thanks for the updated documentation, I'll knock out the other stuff later. Cheers!
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.
If you added the checks for the model embedding, what will happen if OpenAI changes things? Also, embeddings are cool, but, for me, were hard to understand. My sample is MIT license so use whatever you need for your samples if you feel they can help others :)
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.
I may add in future. Have not added anything yet. OpenAI will just tell you which one to use.
No description provided.