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

Signed-off-by: zhanluxianshen <zhanluxianshen@163.com>
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
This commit is contained in:
湛露先生 2025-04-06 13:03:07 +08:00 committed by GitHub
parent b24df29ad0
commit b6705115d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 8 deletions

View File

@ -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"""

View File

@ -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

View File

@ -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"])

View File

@ -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.