Skip to content

Not working with prism version above 0.98.0 #40

@dead-developer

Description

@dead-developer

providerToolCalls is not set when adding a Step.
Failure first appears with prism version 0.98.1.
Prism 0.98.0 works.

How to reproduce

prism: 0.99.1
prism-bedrock: 1.7.0

$response = Prism::text()
->using(Bedrock::KEY, urlencode('arn:aws:bedrock:us-east-1:********:inference-profile/us.anthropic.claude-3-7-sonnet-20250219-v1:0'))
->withPrompt('Who are you?')
->asText();

Error:

   ArgumentCountError 

  Prism\Prism\Text\Step::__construct(): Argument #5 ($providerToolCalls) not passed

  at vendor\prism-php\prism\src\Text\Step.php:26
     22▕      * @param  Message[]  $messages
     23▕      * @param  SystemMessage[]  $systemPrompts
     24▕      * @param  array<string,mixed>  $additionalContent
     25▕      */
  ➜  26▕     public function __construct(
     27▕         public string $text,
     28▕         public FinishReason $finishReason,
     29▕         public array $toolCalls,i


  1   vendor\prism-php\bedrock\src\Schemas\Anthropic\AnthropicTextHandler.php:162

  2   vendor\prism-php\bedrock\src\Schemas\Anthropic\AnthropicTextHandler.php:138
      Prism\Bedrock\Schemas\Anthropic\AnthropicTextHandler::addStep(Object(Prism\Prism\Text\Request))

Thank you for this very useful package!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions