24 lines
729 B
Python
24 lines
729 B
Python
"""
|
|
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")
|