fix: make id to pass when multiple tools are passed #50
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix for #48
Based on the watsonx.ai Chat API docs https://cloud.ibm.com/apidocs/watsonx-ai#text-chat , the tool_call
id
is always included in the response - the case when model decides to use tools. Also, when model return multiple tools, the properid
will be returned for each tool_call.Unit tests:
![Screenshot 2025-01-31 at 14 21 25](https://private-user-images.githubusercontent.com/151041464/408580462-271b1779-1124-47e9-af05-11c2c9208dd7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwOTg1NTEsIm5iZiI6MTczOTA5ODI1MSwicGF0aCI6Ii8xNTEwNDE0NjQvNDA4NTgwNDYyLTI3MWIxNzc5LTExMjQtNDdlOS1hZjA1LTExYzJjOTIwOGRkNy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwOVQxMDUwNTFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1hMjY1Y2NjMGRmYmY4OGNlZjk4OWYyNTY2MjljNjk4MmY4OTliNjIxMDY1ZGFjOGQ3MzE5NDljZjU2MzljNjU1JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.NC_MLFToSVuc0RJ2Ct6sSbVY1at_ZkH6b4eObcaqNyM)
Integrations tests:
![Screenshot 2025-01-31 at 14 20 57](https://private-user-images.githubusercontent.com/151041464/408580562-020db381-e894-4f61-a127-2ac0e5d216c5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwOTg1NTEsIm5iZiI6MTczOTA5ODI1MSwicGF0aCI6Ii8xNTEwNDE0NjQvNDA4NTgwNTYyLTAyMGRiMzgxLWU4OTQtNGY2MS1hMTI3LTJhYzBlNWQyMTZjNS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwOVQxMDUwNTFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT05OWIyOWJkMzQ0MjljMzMwNjA4ZWQ0YzVjZjQ5MjkzZTAxZjVlZjI4OTNhNjUzMzQ4MjE2YzM2NDBmMzRkNmMwJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.3g4X13f9vBM3zfVIKATJ3lCehCDDQBxiC1Qt4E2D1p0)
Please note, that the erros not related to the introduced changes.