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: Send a message to another agent.
  
  Args:
      message (dict or str): message to be sent.
          The message could contain the following fields:
          - content (str or List): Required, the content of the message. (Can be None)
          - function_call (str): the name of the function to be called.
          - name (str): the name of the function to be called.
          - role (str): the role of the message, any role that is not "function"
              will be modified to "assistant".
          - context (dict): the context of the message, which will be passed to
              [OpenAIWrapper.create](../oai/client#create).
              For example, one agent can send a message A as:
  ```python
  {
      "content": lambda context: context["use_tool_msg"],
      "context": {
          "use_tool_msg": "Use tool X if they are relevant."
      }
  }
  ```
              Next time, one agent can send a message B with a different "use_tool_msg".
              Then the content of message A will be refreshed to the new "use_tool_msg".
              So effectively, this provides a way for an agent to send a "link" and modify
              the content of the "link" later.
      recipient (Agent): the recipient of the message.
      request_reply (bool or None): whether to request a reply from the recipient.
      silent (bool or None): (Experimental) whether to print the message sent.
  
  Raises:
      ValueError: if the message can't be converted into a valid ChatCompletion message.
docstr_tok: ["Send","a","message","to","another","agent",".","Args",":","message","(","dict","or","str",")",":","message","to","be","sent",".","The","message","could","contain","the","following","fields",":","-","content","(","str","or","List",")",":","Required",",","the","content","of","the","message",".","(","Can","be","None",")","-","function_call","(","str",")",":","the","name","of","the","function","to","be","called",".","-","name","(","str",")",":","the","name","of","the","function","to","be","called",".","-","role","(","str",")",":","the","role","of","the","message",",","any","role","that","is","not","``","function","''","will","be","modified","to","``","assistant","''",".","-","context","(","dict",")",":","the","context","of","the","message",",","which","will","be","passed","to","[","OpenAIWrapper.create","]","(","..","\/oai\/client","#","create",")",".","For","example",",","one","agent","can","send","a","message","A","as",":","``","`","python","{","``","content","''",":","lambda","context",":","context","[","``","use_tool_msg","''","]",",","``","context","''",":","{","``","use_tool_msg","''",":","``","Use","tool","X","if","they","are","relevant",".","''","}","}","``","`","Next","time",",","one","agent","can","send","a","message","B","with","a","different","``","use_tool_msg","''",".","Then","the","content","of","message","A","will","be","refreshed","to","the","new","``","use_tool_msg","''",".","So","effectively",",","this","provides","a","way","for","an","agent","to","send","a","``","link","''","and","modify","the","content","of","the","``","link","''","later",".","recipient","(","Agent",")",":","the","recipient","of","the","message",".","request_reply","(","bool","or","None",")",":","whether","to","request","a","reply","from","the","recipient",".","silent","(","bool","or","None",")",":","(","Experimental",")","whether","to","print","the","message","sent",".","Raises",":","ValueError",":","if","the","message","ca","n't","be","converted","into","a","valid","ChatCompletion","message","."]
code: def send(
      self,
      message: Union[Dict, str],
      recipient: Agent,
      request_reply: Optional[bool] = None,
      silent: Optional[bool] = False,
  ):
      """Send a message to another agent.
  
      Args:
          message (dict or str): message to be sent.
              The message could contain the following fields:
              - content (str or List): Required, the content of the message. (Can be None)
              - function_call (str): the name of the function to be called.
              - name (str): the name of the function to be called.
              - role (str): the role of the message, any role that is not "function"
                  will be modified to "assistant".
              - context (dict): the context of the message, which will be passed to
                  [OpenAIWrapper.create](../oai/client#create).
                  For example, one agent can send a message A as:
      ```python
      {
          "content": lambda context: context["use_tool_msg"],
          "context": {
              "use_tool_msg": "Use tool X if they are relevant."
          }
      }
      ```
                  Next time, one agent can send a message B with a different "use_tool_msg".
                  Then the content of message A will be refreshed to the new "use_tool_msg".
                  So effectively, this provides a way for an agent to send a "link" and modify
                  the content of the "link" later.
          recipient (Agent): the recipient of the message.
          request_reply (bool or None): whether to request a reply from the recipient.
          silent (bool or None): (Experimental) whether to print the message sent.
  
      Raises:
          ValueError: if the message can't be converted into a valid ChatCompletion message.
      """
      # When the agent composes and sends the message, the role of the message is "assistant"
      # unless it's "function".
      valid = self._append_oai_message(message, "assistant", recipient)
      if valid:
          recipient.receive(message, self, request_reply, silent)
      else:
          raise ValueError(
              "Message can't be converted into a valid ChatCompletion message. Either content or function_call must be provided."
          )
  
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 14 for calling the ConversableAgent obj's underlying member method code with example usage: obj.send(message, recipient, request_reply, silent) without return types