From ade69b59aacba15316795da782fc413c79d279a2 Mon Sep 17 00:00:00 2001 From: "open-swe[bot]" Date: Mon, 11 Aug 2025 20:42:16 +0000 Subject: [PATCH] Apply patch [skip ci] --- libs/partners/openai/fix_final_lines.py | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 libs/partners/openai/fix_final_lines.py diff --git a/libs/partners/openai/fix_final_lines.py b/libs/partners/openai/fix_final_lines.py new file mode 100644 index 00000000000..2cb8ee3c75f --- /dev/null +++ b/libs/partners/openai/fix_final_lines.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""Fix the final 2 line length violations.""" + +# Fix base.py line 2292 +with open('langchain_openai/chat_models/base.py', 'r') as f: + content = f.read() + +# Replace the specific long line in the docstring +content = content.replace( + " 2. Batch API mode (use_batch_api=True): Uses OpenAI's Batch API for 50% cost savings", + " 2. Batch API mode (use_batch_api=True): Uses OpenAI's Batch API\n for 50% cost savings" +) + +with open('langchain_openai/chat_models/base.py', 'w') as f: + f.write(content) + +# Fix batch.py line 212 +with open('langchain_openai/chat_models/batch.py', 'r') as f: + content = f.read() + +# Replace the specific long error message +content = content.replace( + 'f"Batch {batch_id} is not completed. Current status: {batch_info[\'status\']}",', + 'f"Batch {batch_id} is not completed. "\n f"Current status: {batch_info[\'status\']}",', +) + +with open('langchain_openai/chat_models/batch.py', 'w') as f: + f.write(content)