diff --git a/composer.json b/composer.json index 8ea0e3d..03fc500 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "license": "MIT", "require": { "php": "^8.3", - "llm-agents/agents": "dev-feature/embeddings as 1.0", + "llm-agents/agents": "^1.5", "llm-agents/json-schema-mapper": "^1.0" }, "require-dev": { diff --git a/src/Interceptors/UserPromptInjector.php b/src/Interceptors/UserPromptInjector.php index 6862a36..3568e15 100644 --- a/src/Interceptors/UserPromptInjector.php +++ b/src/Interceptors/UserPromptInjector.php @@ -4,10 +4,9 @@ namespace LLM\Agents\PromptGenerator\Interceptors; -use LLM\Agents\LLM\Prompt\Chat\ChatMessage; +use LLM\Agents\LLM\Prompt\Chat\MessagePrompt; use LLM\Agents\LLM\Prompt\Chat\Prompt; use LLM\Agents\LLM\Prompt\Chat\PromptInterface; -use LLM\Agents\LLM\Prompt\Chat\Role; use LLM\Agents\PromptGenerator\InterceptorHandler; use LLM\Agents\PromptGenerator\PromptGeneratorInput; use LLM\Agents\PromptGenerator\PromptInterceptorInterface; @@ -23,10 +22,10 @@ public function generate( return $next( input: $input->withPrompt( $input->prompt->withAddedMessage( - new ChatMessage( - content: (string) $input->userPrompt, - role: Role::User, - ), + MessagePrompt::user('{user_prompt}') + ->withValues([ + 'user_prompt' => (string) $input->userPrompt, + ]), ), ), );