Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/agent/src/Input.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class Input
public function __construct(
public Model $model,
public MessageBag $messages,
private array $options,
private array $options = [],
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/agent/src/Output.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(
public readonly Model $model,
public ResultInterface $result,
public readonly MessageBag $messages,
public readonly array $options,
public readonly array $options = [],
) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function testProcessInputWithValidModelOption()
public function testProcessInputWithoutModelOption()
{
$gpt = new Gpt();
$input = new Input($gpt, new MessageBag(), []);
$input = new Input($gpt, new MessageBag());

$processor = new ModelOverrideInputProcessor();
$processor->processInput($input);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function testProcessInputAddsSystemMessageWhenNoneExists()
{
$processor = new SystemPromptInputProcessor('This is a system prompt');

$input = new Input(new Gpt(), new MessageBag(Message::ofUser('This is a user message')), []);
$input = new Input(new Gpt(), new MessageBag(Message::ofUser('This is a user message')));
$processor->processInput($input);

$messages = $input->messages->getMessages();
Expand All @@ -65,7 +65,7 @@ public function testProcessInputDoesNotAddSystemMessageWhenOneExists()
Message::forSystem('This is already a system prompt'),
Message::ofUser('This is a user message'),
);
$input = new Input(new Gpt(), $messages, []);
$input = new Input(new Gpt(), $messages);
$processor->processInput($input);

$messages = $input->messages->getMessages();
Expand All @@ -92,7 +92,7 @@ public function execute(ToolCall $toolCall): mixed
}
);

$input = new Input(new Gpt(), new MessageBag(Message::ofUser('This is a user message')), []);
$input = new Input(new Gpt(), new MessageBag(Message::ofUser('This is a user message')));
$processor->processInput($input);

$messages = $input->messages->getMessages();
Expand Down Expand Up @@ -130,7 +130,7 @@ public function execute(ToolCall $toolCall): mixed
}
);

$input = new Input(new Gpt(), new MessageBag(Message::ofUser('This is a user message')), []);
$input = new Input(new Gpt(), new MessageBag(Message::ofUser('This is a user message')));
$processor->processInput($input);

$messages = $input->messages->getMessages();
Expand Down Expand Up @@ -170,7 +170,7 @@ public function execute(ToolCall $toolCall): mixed
}
);

$input = new Input(new Gpt(), new MessageBag(Message::ofUser('This is a user message')), []);
$input = new Input(new Gpt(), new MessageBag(Message::ofUser('This is a user message')));
$processor->processInput($input);

$messages = $input->messages->getMessages();
Expand Down
4 changes: 2 additions & 2 deletions src/agent/tests/StructuredOutput/AgentProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function testProcessInputWithoutOutputStructure()
$processor = new AgentProcessor(new ConfigurableResponseFormatFactory());

$model = new Model('gpt-4', [Capability::OUTPUT_STRUCTURED]);
$input = new Input($model, new MessageBag(), []);
$input = new Input($model, new MessageBag());

$processor->processInput($input);

Expand Down Expand Up @@ -162,7 +162,7 @@ public function testProcessOutputWithoutResponseFormat()
$model = self::createMock(Model::class);
$result = new TextResult('');

$output = new Output($model, $result, new MessageBag(), []);
$output = new Output($model, $result, new MessageBag());

$processor->processOutput($output);

Expand Down
10 changes: 5 additions & 5 deletions src/agent/tests/Toolbox/AgentProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function testProcessInputWithoutRegisteredToolsWillResultInNoOptionChange

$model = new Model('gpt-4', [Capability::TOOL_CALLING]);
$processor = new AgentProcessor($toolbox);
$input = new Input($model, new MessageBag(), []);
$input = new Input($model, new MessageBag());

$processor->processInput($input);

Expand All @@ -65,7 +65,7 @@ public function testProcessInputWithRegisteredToolsWillResultInOptionChange()

$model = new Model('gpt-4', [Capability::TOOL_CALLING]);
$processor = new AgentProcessor($toolbox);
$input = new Input($model, new MessageBag(), []);
$input = new Input($model, new MessageBag());

$processor->processInput($input);

Expand Down Expand Up @@ -94,7 +94,7 @@ public function testProcessInputWithUnsupportedToolCallingWillThrowException()

$model = new Model('gpt-3');
$processor = new AgentProcessor($this->createStub(ToolboxInterface::class));
$input = new Input($model, new MessageBag(), []);
$input = new Input($model, new MessageBag());

$processor->processInput($input);
}
Expand All @@ -115,7 +115,7 @@ public function testProcessOutputWithToolCallResponseKeepingMessages()
$processor = new AgentProcessor($toolbox, keepToolMessages: true);
$processor->setAgent($agent);

$output = new Output($model, $result, $messageBag, []);
$output = new Output($model, $result, $messageBag);

$processor->processOutput($output);

Expand All @@ -140,7 +140,7 @@ public function testProcessOutputWithToolCallResponseForgettingMessages()
$processor = new AgentProcessor($toolbox, keepToolMessages: false);
$processor->setAgent($agent);

$output = new Output($model, $result, $messageBag, []);
$output = new Output($model, $result, $messageBag);

$processor->processOutput($output);

Expand Down