-
-
Notifications
You must be signed in to change notification settings - Fork 7
OpenAI.Embedding
Andrew Lambert edited this page Jan 21, 2024
·
5 revisions
OpenAI.Embedding
Protected Class Embedding
Inherits OpenAI.Response
This class represents an API embedding response. Refer to the OpenAI documentation on the /v1/embeddings
endpoint for further details.
This example creates two embeddings and then calculates the distance between them:
OpenAI.APIKey = "YOUR KEY HERE"
Dim embed1 As OpenAI.Embedding = OpenAI.Embedding.Create("Hello, my name is Alice.", "text-embedding-ada-002")
Dim embed2 As OpenAI.Embedding = OpenAI.Embedding.Create("Hello, my name is Bob.", "text-embedding-ada-002")
Dim distance As Double = embed1.DistanceFrom(embed2) ' 0.9008139275638367 (very similar)
Wiki home | Project page | Bugs | Become a sponsor
Text and code examples are Copyright ©2023-24 Andrew Lambert, offered under the CC BY-SA 3.0 License.