@tanstack/ai
Version:
Type-safe TypeScript AI SDK for streaming chat, tool calling, agents, structured outputs, and multimodal generation.
23 lines (22 loc) • 623 B
JavaScript
//#region src/activities/embed/adapter.ts
/**
* Abstract base class for embedding adapters.
* Extend this class to implement an embedding adapter for a specific provider.
*
* Generic parameters match EmbeddingAdapter - all pre-resolved by the provider function.
*/
var BaseEmbeddingAdapter = class {
kind = "embedding";
model;
config;
constructor(model, config = {}) {
this.config = config;
this.model = model;
}
generateId(prefix) {
return `${prefix ?? this.name}-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
}
};
//#endregion
export { BaseEmbeddingAdapter };
//# sourceMappingURL=adapter.js.map