@quantumai/quantum-cli-core
Version:
Quantum CLI Core - Multi-LLM Collaboration System
54 lines • 1.22 kB
JavaScript
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
export class BaseLLMProvider {
config;
constructor(config) {
this.config = config;
}
getId() {
return this.config.id;
}
getType() {
return this.config.type;
}
isEnabled() {
return this.config.enabled ?? true;
}
getCapabilities() {
return this.config.capabilities ?? [];
}
getStrengths() {
return this.config.strengths ?? [];
}
getConfig() {
return this.config;
}
calculateCost(tokens) {
return (this.config.costPerToken ?? 0) * tokens;
}
createResponse(content, latency, tokens, cost, confidence = 0.8) {
return {
providerId: this.id,
content,
confidence,
latency,
tokens,
cost,
};
}
createErrorResponse(error) {
return {
providerId: this.id,
content: '', // Empty string for error
confidence: 0,
latency: 0,
tokens: 0,
cost: 0,
error: error.message,
};
}
}
//# sourceMappingURL=base-provider.js.map