Files
sdk/dist/client.js
zeekay 1a19f15912 feat: Unified multi-language Hanzo SDK
- Consolidated Python, JavaScript, Rust, and Go SDKs
- Standard directory structure (src/py, src/js, src/rs, src/go)
- Real implementations from existing SDKs (not stubs)
- Comprehensive test framework with CI/CD matrix
- Dual distribution support (pip and npm)
- Language parity for all core commands
- Smart routing based on language strengths
2025-09-15 12:44:41 -05:00

33 lines
1.1 KiB
JavaScript

"use strict";
/**
* Hanzo API client
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.HanzoClient = void 0;
const axios_1 = __importDefault(require("axios"));
class HanzoClient {
constructor(apiKey, baseURL = 'https://api.hanzo.ai') {
this.client = axios_1.default.create({
baseURL,
headers: apiKey ? { Authorization: `Bearer ${apiKey}` } : {}
});
}
async chatCompletion(options) {
const response = await this.client.post('/v1/chat/completions', {
model: options.model || 'gpt-4',
messages: options.messages,
temperature: options.temperature,
max_tokens: options.max_tokens
});
return response.data;
}
async listModels() {
const response = await this.client.get('/v1/models');
return response.data.data.map((m) => m.id);
}
}
exports.HanzoClient = HanzoClient;
//# sourceMappingURL=client.js.map