Skip to content

Commit

Permalink
deprecate using None for code_execution_config (microsoft#1506)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackgerrits authored Feb 2, 2024
1 parent 27de29c commit f87a36b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion autogen/agentchat/conversable_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import re
from collections import defaultdict
from typing import Any, Awaitable, Callable, Dict, List, Literal, Optional, Tuple, Type, TypeVar, Union
import warnings

from .. import OpenAIWrapper
from ..cache.cache import Cache
Expand Down Expand Up @@ -69,7 +70,7 @@ def __init__(
max_consecutive_auto_reply: Optional[int] = None,
human_input_mode: Optional[str] = "TERMINATE",
function_map: Optional[Dict[str, Callable]] = None,
code_execution_config: Optional[Union[Dict, Literal[False]]] = None,
code_execution_config: Union[Dict, Literal[False]] = {},
llm_config: Optional[Union[Dict, Literal[False]]] = None,
default_auto_reply: Optional[Union[str, Dict, None]] = "",
description: Optional[str] = None,
Expand Down Expand Up @@ -139,6 +140,13 @@ def __init__(
# Initialize standalone client cache object.
self.client_cache = None

if code_execution_config is None:
warnings.warn(
"Using None to signal a default code_execution_config is deprecated. "
"Use {} to use default or False to disable code execution.",
stacklevel=2,
)

self._code_execution_config: Union[Dict, Literal[False]] = (
{} if code_execution_config is None else code_execution_config
)
Expand Down

0 comments on commit f87a36b

Please sign in to comment.