venice-ai-sdk-apl
Version:
A comprehensive SDK for the Venice AI API with CLI support, programmatic CLI usage, CLI-style interface, and interactive demo
60 lines • 1.72 kB
JavaScript
;
/**
* Models Compatibility Resource
*
* This module provides methods for interacting with the Models Compatibility API.
* It allows you to retrieve model compatibility mappings.
*
* @example
* ```typescript
* import { VeniceAI } from 'venice-ai-sdk-apl';
*
* const venice = new VeniceAI({
* apiKey: 'your-api-key',
* });
*
* // List model compatibility mappings
* const response = await venice.models.compatibility();
*
* console.log(response.mappings);
* ```
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.ModelsCompatibilityResource = void 0;
const base_resource_1 = require("../base-resource");
/**
* Models Compatibility Resource
*/
class ModelsCompatibilityResource extends base_resource_1.BaseResource {
/**
* Lists model compatibility mappings
*
* @returns Promise that resolves with the list of model compatibility mappings
*
* @example
* ```typescript
* const response = await venice.models.compatibility();
* ```
*/
async list() {
try {
const response = await this.get('/models/compatibility_mapping');
// Ensure the response has the expected structure
if (!response.mappings) {
return {
mappings: [],
_metadata: response._metadata
};
}
return response;
}
catch (error) {
// If the endpoint is not available, return an empty response
return {
mappings: []
};
}
}
}
exports.ModelsCompatibilityResource = ModelsCompatibilityResource;
//# sourceMappingURL=compatibility.js.map