Langertha/Content.pm

filter: Statementstmt 100% 6 / 6 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 1 / 1 Podpod n/a totaltotal 100% 7 / 7 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
CRAP 1.0
« Langertha/Request/HTTP.pm ↑ Summary Langertha/Engine/OpenAIBase.pm »
1 package Langertha::Content;
2 # ABSTRACT: Base role for canonical multimodal content blocks with cross-provider serialization
3 1 our $VERSION = '0.502';
4 1 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 requires qw( to_openai to_anthropic to_gemini );
7  
8  
9 1 1;
10  
11 __END__
12  
13 =pod
14  
15 =encoding UTF-8
16  
17 =head1 NAME
18  
19 Langertha::Content - Base role for canonical multimodal content blocks with cross-provider serialization
20  
21 =head1 VERSION
22  
23 version 0.502
24  
25 =head1 SYNOPSIS
26  
27 package Langertha::Content::Image;
28 use Moose;
29 with 'Langertha::Content';
30  
31 sub to_openai { ... }
32 sub to_anthropic { ... }
33 sub to_gemini { ... }
34  
35 =head1 DESCRIPTION
36  
37 Marker role for canonical content blocks that can be embedded inside the
38 C<content> arrayref of a chat message and serialized to any provider wire
39 format by L<Langertha::Role::Chat>.
40  
41 Implementations must provide C<to_openai>, C<to_anthropic>, and C<to_gemini>,
42 returning the HashRef block the respective provider expects inside its
43 message content / parts array.
44  
45 =head1 SEE ALSO
46  
47 =over
48  
49 =item * L<Langertha::Content::Image> - Image (URL / base64 / local file) content block
50  
51 =item * L<Langertha::ToolChoice> - Sibling value object for tool_choice normalization
52  
53 =back
54  
55 =head1 SUPPORT
56  
57 =head2 Issues
58  
59 Please report bugs and feature requests on GitHub at
60 L<https://github.com/Getty/langertha/issues>.
61  
62 =head2 IRC
63  
64 Join C<#langertha> on C<irc.perl.org> or message Getty directly.
65  
66 =head1 CONTRIBUTING
67  
68 Contributions are welcome! Please fork the repository and submit a pull request.
69  
70 =head1 AUTHOR
71  
72 Torsten Raudssus <getty@cpan.org>
73  
74 =head1 COPYRIGHT AND LICENSE
75  
76 This software is copyright (c) 2026 by Torsten Raudssus L<https://raudssus.de/>.
77  
78 This is free software; you can redistribute it and/or modify it under
79 the same terms as the Perl 5 programming language system itself.
80  
81 =cut
« Langertha/Request/HTTP.pm ↑ Summary Langertha/Engine/OpenAIBase.pm »