From add900b3025cdf9d22a403ee06e0a8c842072e3b Mon Sep 17 00:00:00 2001 From: Hemang Date: Mon, 3 Mar 2025 14:38:31 +0100 Subject: [PATCH] Add comments in the Anthropic route for the header invariant key hack. --- proxy/routes/anthropic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proxy/routes/anthropic.py b/proxy/routes/anthropic.py index 83260de..dfed21b 100644 --- a/proxy/routes/anthropic.py +++ b/proxy/routes/anthropic.py @@ -120,7 +120,7 @@ async def push_to_explorer( messages = request_body.get("messages", []) messages += [merged_response] - transformed_messages = connvert_anthropic_to_invariant_message_format(messages) + transformed_messages = convert_anthropic_to_invariant_message_format(messages) _ = await push_trace( dataset_name=dataset_name, messages=[transformed_messages], @@ -252,7 +252,7 @@ def update_merged_response(text_json, merged_response): merged_response[-1]["stop_reason"] = text_json.get("delta").get("stop_reason") -def connvert_anthropic_to_invariant_message_format( +def convert_anthropic_to_invariant_message_format( messages: list[dict], keep_empty_tool_response: bool = False ) -> list[dict]: """Converts a list of messages from the Anthropic API to the Invariant API format."""