Fixed patient generation with separate script approach
This commit is contained in:
23
module_generator/anthropic_patch.py
Normal file
23
module_generator/anthropic_patch.py
Normal 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")
|
||||
Reference in New Issue
Block a user