| 1 | package Langertha::Role::ParallelToolUse; | ||||||||||||||
| 2 | # ABSTRACT: Role for an engine that supports parallel tool calling control | ||||||||||||||
| 3 | 198 | our $VERSION = '0.505'; | |||||||||||||
| 4 | 198 | ▶ | use Moose::Role; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | |||||||||||||||
| 6 | 198 | has parallel_tool_use => ( | |||||||||||||
| 7 | is => 'ro', | ||||||||||||||
| 8 | isa => 'Bool', | ||||||||||||||
| 9 | predicate => 'has_parallel_tool_use', | ||||||||||||||
| 10 | ); | ||||||||||||||
| 11 | |||||||||||||||
| 12 | 4436 | ▶ | around BUILDARGS => sub { | ||||||||||||
|
Subroutine
__ANON__: called CC=6 SCAR=17.9
| |||||||||||||||
| 13 | 4436 | my ( $orig, $class, @args ) = @_; | |||||||||||||
| 14 | 4436 | my $params = $class->$orig(@args); | |||||||||||||
| 15 | |||||||||||||||
| 16 | 4427 | ▶ | return $params if exists $params->{parallel_tool_use}; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 17 | |||||||||||||||
| 18 | 4387 | ▶ | if ( exists $params->{parallel_tool_calls} ) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 19 | 2 | ▶ | $params->{parallel_tool_use} = delete $params->{parallel_tool_calls} ? 1 : 0; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 20 | } | ||||||||||||||
| 21 | elsif ( exists $params->{disable_parallel_tool_use} ) { | ||||||||||||||
| 22 | 2 | ▶ | $params->{parallel_tool_use} = delete $params->{disable_parallel_tool_use} ? 0 : 1; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 23 | } | ||||||||||||||
| 24 | |||||||||||||||
| 25 | 4387 | return $params; | |||||||||||||
| 26 | 198 | }; | |||||||||||||
| 27 | |||||||||||||||
| 28 | |||||||||||||||
| 29 | |||||||||||||||
| 30 | 198 | 1; | |||||||||||||
| 31 | |||||||||||||||
| 32 | __END__ | ||||||||||||||