1919use Cortex \LLM \Enums \ToolChoice ;
2020use Cortex \LLM \Contracts \Message ;
2121use Cortex \Memory \Contracts \Store ;
22+ use Cortex \Pipeline \RuntimeConfig ;
2223use Cortex \Support \Traits \CanPipe ;
23- use Cortex \Pipeline \RuntimeContext ;
2424use Cortex \Agents \Stages \AppendUsage ;
2525use Cortex \LLM \Data \ChatStreamResult ;
2626use Cortex \Exceptions \GenericException ;
@@ -58,9 +58,8 @@ class Agent implements Pipeable
5858 protected Pipeline $ pipeline ;
5959
6060 /**
61- * @param class-string|\Cortex\JsonSchema\Types\ObjectSchema $output
61+ * @param class-string|\Cortex\JsonSchema\Types\ObjectSchema|array<array-key, \Cortex\JsonSchema\Contracts\JsonSchema>|null $output
6262 * @param array<int, \Cortex\LLM\Contracts\Tool|\Closure|string>|\Cortex\Contracts\ToolKit $tools
63- * @param class-string|class-string<\BackedEnum>|\Cortex\JsonSchema\Types\ObjectSchema|array<array-key, \Cortex\JsonSchema\Contracts\JsonSchema>|null $llm
6463 * @param array<string, mixed> $initialPromptVariables
6564 */
6665 public function __construct (
@@ -177,7 +176,7 @@ public function stream(array $messages = [], array $input = []): ChatStreamResul
177176 return $ result ;
178177 }
179178
180- public function handlePipeable (mixed $ payload , RuntimeContext $ context , Closure $ next ): mixed
179+ public function handlePipeable (mixed $ payload , RuntimeConfig $ config , Closure $ next ): mixed
181180 {
182181 $ messages = match (true ) {
183182 $ payload instanceof MessageCollection => $ payload ->all (),
@@ -193,7 +192,7 @@ public function handlePipeable(mixed $payload, RuntimeContext $context, Closure
193192 default => [],
194193 };
195194
196- return $ next ($ this ->invoke ($ messages , $ input ), $ context );
195+ return $ next ($ this ->invoke ($ messages , $ input ), $ config );
197196 }
198197
199198 public function getName (): string
0 commit comments