MCPcopy Create free account
hub / github.com/EpistasisLab/KRAGEN / get_embedding

Function get_embedding

src/make_vector.py:42–50  ·  view source on GitHub ↗
(text, engine="text-embedding-3-small")

Source from the content-addressed store, hash-verified

40 return np.dot(a, b) / (np.linalg.norm(a) * np.linalg.norm(b))
41
42def get_embedding(text, engine="text-embedding-3-small"):
43 client = OpenAI()
44
45 response = client.embeddings.create(
46 input=text,
47 model=engine
48 )
49
50 return response.data[0].embedding
51
52# search through the reviews for a specific product
53def search_docs(df, user_query, top_n=3, to_print=False):

Callers 2

search_docsFunction · 0.70
process_csv_daskFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected