MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / get_embedding_service

Function get_embedding_service

skills/embedding/scripts/embed.py:562–566  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

560 try:
561 # Batches are independent API round trips; issuing them serially
562 # meant 120 uncached texts took 126.5s. The OpenAI client is
563 # thread-safe and each cache entry is its own file, so the only
564 # shared state is the pre-sized results list, written by index.
565 workers = self._batch_concurrency(len(batches))
566 if len(batches) > 1 and workers > 1:
567 with ThreadPoolExecutor(max_workers=workers) as executor:
568 batch_results = list(executor.map(embed_one_batch, batches))
569 else:

Callers 4

prepare_paper_featuresFunction · 0.85
embed_textFunction · 0.85
embed_batchFunction · 0.85
cosine_similarityFunction · 0.85

Calls 1

EmbeddingServiceClass · 0.85

Tested by

no test coverage detected