Fixed patient generation with separate script approach

This commit is contained in:
2025-03-27 11:26:33 -07:00
parent 2141e81f42
commit e10ae0cf81
10 changed files with 401 additions and 8 deletions

View File

@@ -0,0 +1,23 @@
"""
Patch for Anthropic client to fix 'proxies' parameter issue
Place this file in the same directory as module_generator.py
"""
import anthropic
import inspect
# Store the original __init__ method
original_init = anthropic.Client.__init__
# Define a new __init__ method that filters out problematic parameters
def patched_init(self, *args, **kwargs):
# Remove 'proxies' from kwargs if present
if 'proxies' in kwargs:
del kwargs['proxies']
# Call the original __init__ with filtered kwargs
original_init(self, *args, **kwargs)
# Replace the original __init__ with our patched version
anthropic.Client.__init__ = patched_init
print("Applied patch to fix Anthropic client proxies parameter issue")