provider-modals-support
v1.1.0
Published
A utility package to manage AI Providers and their respective Models in TypeScript.
Downloads
291
Maintainers
Readme
provider-modals-support
A utility package to manage AI Providers and their respective Models in TypeScript.
Usage
import {
AIProviderType,
ModalityType,
getAvailableProviders,
getModelsForModality,
isValidModelForProviderAndModality
ModalTaskTypeENUM
} from 'provider-modals-support';
const provider: AIProviderType = "OpenAI";
const modality: ModalityType = "ModalTaskTypeENUM.TTT";
const model = "GPT-4";
const providers = getAvailableProviders();
console.log("Available providers:", providers);
const availableModels = getModelsForModality(provider, modality);
console.log(`Available models for ${provider} (${modality}):`, availableModels);
const isValid = isValidModelForProviderAndModality(provider, model, modality);
console.log(
`${model} is ${isValid ? "valid" : "invalid"} for ${provider} (${modality})`
);
Example Output:
Available providers: [ 'OpenAI', 'Groq', 'GLHF', 'HordeAI' ]
Available models for OpenAI (text): [ 'GPT-4', 'GPT-3.5' ]
GPT-4 is valid for OpenAI (text)