MCPcopy Create free account
hub / github.com/Bairong-Xdynamics/MistakeNotebookLearning / embedding_model_fn

Function embedding_model_fn

examples/utils/api_utils.py:206–211  ·  view source on GitHub ↗
(text: str)

Source from the content-addressed store, hash-verified

204 client = OpenAI(api_key=api_key, base_url=api_base)
205
206 def embedding_model_fn(text: str) -> List[float]:
207 response = client.embeddings.create(
208 model=model,
209 input=[text]
210 )
211 return response.data[0].embedding
212
213 return embedding_model_fn

Callers

nothing calls this directly

Calls 1

createMethod · 0.80

Tested by

no test coverage detected