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
parent 07387e9586
commit 61f4f08744
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