MCPcopy
hub / github.com/tobi/qmd / formatQueryForEmbedding

Function formatQueryForEmbedding

src/llm.ts:94–100  ·  view source on GitHub ↗
(query: string, modelUri?: string)

Source from the content-addressed store, hash-verified

92 * Uses Qwen3-Embedding instruct format when a Qwen embedding model is active.
93 */
94export function formatQueryForEmbedding(query: string, modelUri?: string): string {
95 const uri = modelUri ?? resolveEmbedModel();
96 if (isQwen3EmbeddingModel(uri)) {
97 return `Instruct: Retrieve relevant documents for the given query\nQuery: ${query}`;
98 }
99 return `task: search result | query: ${query}`;
100}
101
102/**
103 * Format a document for embedding.

Callers 5

store.test.tsFile · 0.85
getEmbeddingFingerprintFunction · 0.85
getEmbeddingFunction · 0.85
hybridQueryFunction · 0.85
structuredSearchFunction · 0.85

Calls 2

resolveEmbedModelFunction · 0.85
isQwen3EmbeddingModelFunction · 0.85

Tested by

no test coverage detected