-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
bugThis issue is a bug.This issue is a bug.p2This is a standard priority issueThis is a standard priority issuequeuedThis issues is on the AWS team's backlogThis issues is on the AWS team's backlog
Description
Describe the bug
Bedrock toolSpec requires inputSchema to be an object, but SDK wants an assoc array, which forces an input to be specified.
Expected Behavior
Accept null, or empty object
Current Behavior
Passing an empty object produces the following error
Found 1 error while validating the input provided for the Converse operation:
[toolConfig][tools][0][toolSpec][inputSchema][json] is not a valid document type
Passing an empty array produces the following error
{"message":"The json schema definition at toolConfig.tools.0.toolSpec.inputSchema is invalid. Fix the following errors and try again: $.properties: array found, object expected"}
Reproduction Steps
'toolConfig' => [
'tools' => [
[
'toolSpec' => [
'name' => 'dateTime',
'description' => 'get date time as timestamp from unix epoch',
'inputSchema' => [
'json' => [
'type' => 'object',
'properties' => [],
'required' => [],
],
],
],
],
],
],
Possible Solution
'toolConfig' => [
'tools' => [
[
'toolSpec' => [
'name' => 'dateTime',
'description' => 'get date time as timestamp from unix epoch',
'inputSchema' => [
'json' => [
'type' => 'object',
'properties' => (object)[],
'required' => [],
],
],
],
],
],
],
Additional Information/Context
There is also an issue where the return value of the tool use wants to return an empty object, but when unserialised in php becomes an empty array. When trying to continue the converstaion this then causes the following error.
{"message":"The format of the value at messages.1.content.0.toolUse.input is invalid. Provide a json object for the fiel (truncated...)
ValidationException (client): The format of the value at messages.1.content.0.toolUse.input is invalid. Provide a json object for the field and
try again. - {"message":"The format of the value at messages.1.content.0.toolUse.input is invalid. Provide a json object for the field and try ag
ain."}
SDK version used
3.316
Environment details (Version of PHP (php -v)? OS name and version, etc.)
MacOS php8.1
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.p2This is a standard priority issueThis is a standard priority issuequeuedThis issues is on the AWS team's backlogThis issues is on the AWS team's backlog