class_docstr: (In preview) A class for generic conversable agents which can be configured as assistant or user proxy.
  
  After receiving each message, the agent will send a reply to the sender unless the msg is a termination msg.
  For example, AssistantAgent and UserProxyAgent are subclasses of this class,
  configured with different default settings.
  
  To modify auto reply, override `generate_reply` method.
  To disable/enable human response in every turn, set `human_input_mode` to "NEVER" or "ALWAYS".
  To modify the way to get human input, override `get_human_input` method.
  To modify the way to execute code blocks, single code block, or function call, override `execute_code_blocks`,
  `run_code`, and `execute_function` methods respectively.
  To customize the initial message when a conversation starts, override `generate_init_message` method.
class_docstr_tok: ["(","In","preview",")","A","class","for","generic","conversable","agents","which","can","be","configured","as","assistant","or","user","proxy",".","After","receiving","each","message",",","the","agent","will","send","a","reply","to","the","sender","unless","the","msg","is","a","termination","msg",".","For","example",",","AssistantAgent","and","UserProxyAgent","are","subclasses","of","this","class",",","configured","with","different","default","settings",".","To","modify","auto","reply",",","override","`","generate_reply","`","method",".","To","disable\/enable","human","response","in","every","turn",",","set","`","human_input_mode","`","to","``","NEVER","''","or","``","ALWAYS","''",".","To","modify","the","way","to","get","human","input",",","override","`","get_human_input","`","method",".","To","modify","the","way","to","execute","code","blocks",",","single","code","block",",","or","function","call",",","override","`","execute_code_blocks","`",",","`","run_code","`",",","and","`","execute_function","`","methods","respectively",".","To","customize","the","initial","message","when","a","conversation","starts",",","override","`","generate_init_message","`","method","."]
docstr: Decorator factory for registering a function to be executed by an agent.
  
  It's return value is used to decorate a function to be registered to the agent.
  
  Args:
      name (optional(str)): name of the function. If None, the function name will be used (default: None).
  
  Returns:
      The decorator for registering a function to be used by an agent.
  
  Examples:
      ```
      @user_proxy.register_for_execution()
      @agent2.register_for_llm()
      @agent1.register_for_llm(description="This is a very useful function")
      def my_function(a: Annotated[str, "description of a parameter"] = "a", b: int, c=3.14):
           return a + str(b * c)
      ```
docstr_tok: ["Decorator","factory","for","registering","a","function","to","be","executed","by","an","agent",".","It","'s","return","value","is","used","to","decorate","a","function","to","be","registered","to","the","agent",".","Args",":","name","(","optional","(","str",")",")",":","name","of","the","function",".","If","None",",","the","function","name","will","be","used","(","default",":","None",")",".","Returns",":","The","decorator","for","registering","a","function","to","be","used","by","an","agent",".","Examples",":","``","`","@","user_proxy.register_for_execution","(",")","@","agent2.register_for_llm","(",")","@","agent1.register_for_llm","(","description=","''","This","is","a","very","useful","function","''",")","def","my_function","(","a",":","Annotated","[","str",",","``","description","of","a","parameter","''","]","=","``","a","''",",","b",":","int",",","c=3.14",")",":","return","a","+","str","(","b","*","c",")","``","`"]
code: def register_for_execution(
      self,
      name: Optional[str] = None,
  ) -> Callable[[F], F]:
      """Decorator factory for registering a function to be executed by an agent.
  
      It's return value is used to decorate a function to be registered to the agent.
  
      Args:
          name (optional(str)): name of the function. If None, the function name will be used (default: None).
  
      Returns:
          The decorator for registering a function to be used by an agent.
  
      Examples:
          ```
          @user_proxy.register_for_execution()
          @agent2.register_for_llm()
          @agent1.register_for_llm(description="This is a very useful function")
          def my_function(a: Annotated[str, "description of a parameter"] = "a", b: int, c=3.14):
               return a + str(b * c)
          ```
  
      """
  
      def _decorator(func: F) -> F:
          """Decorator for registering a function to be used by an agent.
  
          Args:
              func: the function to be registered.
  
          Returns:
              The function to be registered, with the _description attribute set to the function description.
  
          Raises:
              ValueError: if the function description is not provided and not propagated by a previous decorator.
  
          """
          # name can be overwritten by the parameter, by default it is the same as function name
          if name:
              func._name = name
          elif not hasattr(func, "_name"):
              func._name = func.__name__
  
          self.register_function(
              {func._name: self._wrap_function(func)}
          )
  
          return func
  
      return _decorator
  
imports: import asyncio
  import copy
  import functools
  import inspect
  import json
  import logging
  import re
  from collections import defaultdict
  from typing import Any, Awaitable, Callable, Dict, List, Literal, Optional, Tuple, Type, TypeVar, Union
  from ..None import OpenAIWrapper
  from ..code_utils import DEFAULT_MODEL, UNKNOWN, content_str, execute_code, extract_code, infer_lang
  from ..function_utils import get_function_schema, load_basemodels_if_needed, serialize_to_str
  from .agent import Agent
  from .._pydantic import model_dump
label_desc: Use image node_id 46 for calling the ConversableAgent obj's underlying member method code with example usage: obj.register_for_execution(name) and returns: _decorator, func