mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: openai updates (#388)
* openai updates * rebuild of openai structure * updated responses structure * renamed sample * added file id support to code interpreter * added hosted file ids to code interpretor * mypy fixes * removed default az cred from codebase * updated agent name setup * added kwargs to entra methods * and further kwargs * extra comment * updated all samples * readded custom get methods for responses * updated int tests with ad credential * missed one
This commit is contained in:
committed by
GitHub
Unverified
parent
19676978e9
commit
df9d85d1f0
@@ -1,10 +1,24 @@
|
||||
# Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
import logging
|
||||
from typing import Any
|
||||
|
||||
logger = logging.getLogger("agent_framework")
|
||||
|
||||
|
||||
class AgentFrameworkException(Exception):
|
||||
"""Base class for exceptions in the Agent Framework."""
|
||||
"""Base exceptions for the Agent Framework.
|
||||
|
||||
pass
|
||||
Automatically logs the message as debug.
|
||||
"""
|
||||
|
||||
def __init__(self, message: str, inner_exception: Exception | None = None, *args: Any, **kwargs: Any):
|
||||
"""Create an AgentFrameworkException.
|
||||
|
||||
This emits a debug log, with the inner_exception if provided.
|
||||
"""
|
||||
logger.debug(message, exc_info=inner_exception)
|
||||
super().__init__(message, *args, **kwargs) # type: ignore
|
||||
|
||||
|
||||
class AgentException(AgentFrameworkException):
|
||||
@@ -68,3 +82,15 @@ class ServiceInvalidResponseError(ServiceResponseException):
|
||||
"""An error occurred while validating the response from the service."""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class ToolException(AgentFrameworkException):
|
||||
"""An error occurred while executing a tool."""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class ToolExecutionException(ToolException):
|
||||
"""An error occurred while executing a tool."""
|
||||
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user