NAME
Langertha::Role::StaticModels - Role for engines with a hardcoded model list
VERSION
version 0.302
SYNOPSIS
package My::Engine;
use Moose;
extends 'Langertha::Engine::OpenAIBase';
with 'Langertha::Role::StaticModels';
sub _build_static_models {[
{ id => 'model-a' },
{ id => 'model-b' },
]}
__PACKAGE__->meta->make_immutable;
DESCRIPTION
Provides a list_models implementation that returns a hardcoded model list without making any HTTP requests. Useful for engines whose API does not offer a /models endpoint (e.g. MiniMax).
The consuming class must implement _build_static_models returning an ArrayRef of HashRefs, each with at least an id key.
static_models
ArrayRef of model HashRefs (each with at least an id key). Built by _build_static_models which the consuming engine must implement.
list_models
my $ids = $engine->list_models;
my $full = $engine->list_models(full => 1);
Returns the static model list. By default returns an ArrayRef of model ID strings. Pass full => 1 for the full model HashRefs.
SEE ALSO
Langertha::Role::Models - Model selection and caching
Langertha::Engine::MiniMax - Uses this role
SUPPORT
Issues
Please report bugs and feature requests on GitHub at https://github.com/Getty/langertha/issues.
CONTRIBUTING
Contributions are welcome! Please fork the repository and submit a pull request.
AUTHOR
Torsten Raudssus <torsten@raudssus.de> https://raudss.us/
COPYRIGHT AND LICENSE
This software is copyright (c) 2026 by Torsten Raudssus.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.