Optional
embeddingSchema: TEmbeddingSchemaThe schema containing the embedding’s unique name and optional properties to override.
The unique identifier of the embedding to override, matching IEmbeddingSchema["embeddingName"]
.
No return value; the override is applied directly to the swarm’s embedding schema service.
If the embedding schema service encounters an error during the override operation (e.g., invalid embeddingName or schema).
// Override an embedding’s schema with new properties
overrideEmbeding({
embeddingName: "TextEmbedding",
persist: true,
callbacks: {
onCreate: (text, embeddings) => console.log(`Created embedding for ${text}`),
},
});
// Logs the operation (if enabled) and updates the embedding schema in the swarm.
Overrides an existing embedding schema in the swarm system with a new or partial schema. This function updates the configuration of an embedding mechanism identified by its
embeddingName
, applying the provided schema properties. It operates outside any existing method or execution contexts to ensure isolation, leveragingbeginContext
for a clean execution scope. Logs the override operation if logging is enabled in the global configuration.