|
7 | 7 | import re
|
8 | 8 | from collections import defaultdict
|
9 | 9 | from typing import Any, Awaitable, Callable, Dict, List, Literal, Optional, Tuple, Type, TypeVar, Union
|
| 10 | +import warnings |
10 | 11 |
|
11 | 12 | from .. import OpenAIWrapper, ModelClient
|
12 | 13 | from ..cache.cache import Cache
|
@@ -69,7 +70,7 @@ def __init__(
|
69 | 70 | max_consecutive_auto_reply: Optional[int] = None,
|
70 | 71 | human_input_mode: Optional[str] = "TERMINATE",
|
71 | 72 | function_map: Optional[Dict[str, Callable]] = None,
|
72 |
| - code_execution_config: Optional[Union[Dict, Literal[False]]] = None, |
| 73 | + code_execution_config: Union[Dict, Literal[False]] = {}, |
73 | 74 | llm_config: Optional[Union[Dict, Literal[False]]] = None,
|
74 | 75 | default_auto_reply: Optional[Union[str, Dict, None]] = "",
|
75 | 76 | description: Optional[str] = None,
|
@@ -139,6 +140,13 @@ def __init__(
|
139 | 140 | # Initialize standalone client cache object.
|
140 | 141 | self.client_cache = None
|
141 | 142 |
|
| 143 | + if code_execution_config is None: |
| 144 | + warnings.warn( |
| 145 | + "Using None to signal a default code_execution_config is deprecated. " |
| 146 | + "Use {} to use default or False to disable code execution.", |
| 147 | + stacklevel=2, |
| 148 | + ) |
| 149 | + |
142 | 150 | self._code_execution_config: Union[Dict, Literal[False]] = (
|
143 | 151 | {} if code_execution_config is None else code_execution_config
|
144 | 152 | )
|
|
0 commit comments