updated utils for bedrock.meta streaming

This commit is contained in:
David Christian 2023-11-16 07:12:27 -08:00
parent 404d4e8737
commit 45ae4a76e4

View file

@ -4443,6 +4443,9 @@ class CustomStreamWrapper:
is_finished = True is_finished = True
finish_reason = stop_reason finish_reason = stop_reason
######## bedrock.cohere mappings ############### ######## bedrock.cohere mappings ###############
# meta mapping
elif "generation" in chunk_data:
text = chunk_data['generation'] # bedrock.meta
# cohere mapping # cohere mapping
elif "text" in chunk_data: elif "text" in chunk_data:
text = chunk_data["text"] # bedrock.cohere text = chunk_data["text"] # bedrock.cohere