Created
October 27, 2023 01:21
-
-
Save rkreddyp/ec9f0ee5b2b077cfdaabead6e9d81cc4 to your computer and use it in GitHub Desktop.
embedsearch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
index_name = 'oktaevents' | |
index = pinecone.Index(index_name) | |
embed = OpenAIEmbeddings() | |
embedding = openai.Embedding.create( | |
input=query, | |
model="text-embedding-ada-002" | |
) | |
vector = embedding["data"][0]["embedding"] | |
index = pinecone.Index(index_name) | |
search_response = index.query( | |
top_k=2, | |
vector=vector, | |
include_metadata=True | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment