MCPcopy
hub / github.com/continuedev/continue / _embed

Method _embed

core/llm/llms/NCompass.ts:43–63  ·  view source on GitHub ↗
(chunks: string[])

Source from the content-addressed store, hash-verified

41 }
42
43 protected async _embed(chunks: string[]): Promise<number[][]> {
44 const resp = await this.fetch(NCompass.embeddingsApiEndpoint, {
45 method: "POST",
46 body: JSON.stringify({
47 input: chunks,
48 model: this.model,
49 ...this.extraBodyProperties(),
50 }),
51 headers: {
52 Authorization: `Bearer ${this.apiKey}`,
53 "Content-Type": "application/json",
54 },
55 });
56
57 if (!resp.ok) {
58 throw new Error(await resp.text());
59 }
60
61 const data = (await resp.json()) as any;
62 return data.data.map((result: { embedding: number[] }) => result.embedding);
63 }
64}
65
66export default NCompass;

Callers

nothing calls this directly

Calls 3

extraBodyPropertiesMethod · 0.80
textMethod · 0.80
fetchMethod · 0.65

Tested by

no test coverage detected