fix(bedrock_httpx.py): fix bedrock logging

This commit is contained in:
Krrish Dholakia
2024-05-16 23:53:54 -07:00
parent 0258351c61
commit 9aa05c19d1
+8 -8
View File
@@ -834,14 +834,6 @@ class BedrockLLM(BaseLLM):
status_code=response.status_code, message=response.text
)
## LOGGING
logging_obj.post_call(
input=messages,
api_key="",
original_response=response.text,
additional_args={"complete_input_dict": data},
)
decoder = AWSEventStreamDecoder(model=model)
completion_stream = decoder.iter_bytes(response.iter_bytes(chunk_size=1024))
@@ -851,6 +843,14 @@ class BedrockLLM(BaseLLM):
custom_llm_provider="bedrock",
logging_obj=logging_obj,
)
## LOGGING
logging_obj.post_call(
input=messages,
api_key="",
original_response=streaming_response,
additional_args={"complete_input_dict": data},
)
return streaming_response
response = self.client.post(url=prepped.url, headers=prepped.headers, data=data) # type: ignore