Add bedrock command r models (#4521)

Co-authored-by: Justin Wu <justin.wu@ringcentral.com>
Co-authored-by: Chenhe Gu <guchenhe@gmail.com>
This commit is contained in:
Justin Wu 2024-06-17 20:37:46 +08:00 committed by GitHub
commit 61f4f08744
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 176 additions and 0 deletions

View file

@ -17,6 +17,10 @@ class CotAgentOutputParser:
action_name = None
action_input = None
# cohere always returns a list
if isinstance(action, list) and len(action) == 1:
action = action[0]
for key, value in action.items():
if 'input' in key.lower():
action_input = value