Skip to content

A programming framework for agentic AI

clean codes notes for autogen-core. (#6218)

湛露先生b6705115d11e
diff --git a/python/packages/autogen-core/src/autogen_core/_constants.py b/python/packages/autogen-core/src/autogen_core/_constants.py
index 8fc4580c0..06f3ab01c 100644
--- a/python/packages/autogen-core/src/autogen_core/_constants.py
+++ b/python/packages/autogen-core/src/autogen_core/_constants.py
@@ -1,5 +1,5 @@
ROOT_LOGGER_NAME = "autogen_core"
-"""str: Logger name used for structured event logging"""
+"""str: Logger name used for root logger"""
EVENT_LOGGER_NAME = "autogen_core.events"
"""str: Logger name used for structured event logging"""
diff --git a/python/packages/autogen-core/src/autogen_core/_function_utils.py b/python/packages/autogen-core/src/autogen_core/_function_utils.py
index cbf157d97..891027842 100644
--- a/python/packages/autogen-core/src/autogen_core/_function_utils.py
+++ b/python/packages/autogen-core/src/autogen_core/_function_utils.py
@@ -155,7 +155,7 @@ def get_required_params(typed_signature: inspect.Signature) -> List[str]:
"""Get the required parameters of a function
Args:
- signature: The signature of the function as returned by inspect.signature
+ typed_signature: The signature of the function as returned by inspect.signature
Returns:
A list of the required parameters of the function
@@ -167,7 +167,7 @@ def get_default_values(typed_signature: inspect.Signature) -> Dict[str, Any]:
"""Get default values of parameters of a function
Args:
- signature: The signature of the function as returned by inspect.signature
+ typed_signature: The signature of the function as returned by inspect.signature
Returns:
A dictionary of the default values of the parameters of the function
@@ -184,7 +184,8 @@ def get_parameters(
Args:
required: The required parameters of the function
- hints: The type hints of the function as returned by typing.get_type_hints
+ param_annotations: A dictionary of the type annotations of the parameters of the function
+ default_values: The default values of the parameters of the function
Returns:
A Pydantic model for the parameters of the function
diff --git a/python/packages/autogen-core/src/autogen_core/_routed_agent.py b/python/packages/autogen-core/src/autogen_core/_routed_agent.py
index a5908278c..cc4c11490 100644
--- a/python/packages/autogen-core/src/autogen_core/_routed_agent.py
+++ b/python/packages/autogen-core/src/autogen_core/_routed_agent.py
@@ -123,7 +123,7 @@ def message_handler(
raise AssertionError("message parameter not found in function signature")
if "return" not in type_hints:
- raise AssertionError("return not found in function signature")
+ raise AssertionError("return parameter not found in function signature")
# Get the type of the message parameter
target_types = get_types(type_hints["message"])
@@ -243,7 +243,7 @@ def event(
raise AssertionError("message parameter not found in function signature")
if "return" not in type_hints:
- raise AssertionError("return not found in function signature")
+ raise AssertionError("return parameter not found in function signature")
# Get the type of the message parameter
target_types = get_types(type_hints["message"])
@@ -363,7 +363,7 @@ def rpc(
raise AssertionError("message parameter not found in function signature")
if "return" not in type_hints:
- raise AssertionError("return not found in function signature")
+ raise AssertionError("return parameter not found in function signature")
# Get the type of the message parameter
target_types = get_types(type_hints["message"])
diff --git a/python/packages/autogen-core/src/autogen_core/logging.py b/python/packages/autogen-core/src/autogen_core/logging.py
index 18811f8d2..3f371a6f3 100644
--- a/python/packages/autogen-core/src/autogen_core/logging.py
+++ b/python/packages/autogen-core/src/autogen_core/logging.py
@@ -113,7 +113,7 @@ class LLMStreamEndEvent:
completion_tokens: int,
**kwargs: Any,
) -> None:
- """To be used by model to log the call to the LLM.
+ """To be used by model clients to log the end of a stream.
Args:
response (Dict[str, Any]): The response of the call. Must be json serializable.