File tree Expand file tree Collapse file tree 3 files changed +18
-17
lines changed Expand file tree Collapse file tree 3 files changed +18
-17
lines changed Original file line number Diff line number Diff line change 1+ from ai .backend .common .exception import (
2+ BackendAIError ,
3+ ErrorCode ,
4+ ErrorDetail ,
5+ ErrorDomain ,
6+ ErrorOperation ,
7+ )
8+
9+
10+ class AgentIdNotFoundError (BackendAIError ):
11+ @classmethod
12+ def error_code (cls ) -> ErrorCode :
13+ return ErrorCode (
14+ domain = ErrorDomain .AGENT ,
15+ operation = ErrorOperation .ACCESS ,
16+ error_detail = ErrorDetail .NOT_FOUND ,
17+ )
Original file line number Diff line number Diff line change 55
66from ai .backend .agent .agent import AbstractAgent
77from ai .backend .agent .config .unified import AgentUnifiedConfig
8+ from ai .backend .agent .errors .runtime import AgentIdNotFoundError
89from ai .backend .agent .etcd import AgentEtcdClientView
910from ai .backend .agent .kernel import KernelRegistry
1011from ai .backend .agent .monitor import AgentErrorPluginContext , AgentStatsPluginContext
1112from ai .backend .agent .types import AgentBackend
1213from ai .backend .common .auth import PublicKey
1314from ai .backend .common .etcd import AsyncEtcd , ConfigScopes
14- from ai .backend .common .exception import (
15- BackendAIError ,
16- ErrorCode ,
17- ErrorDetail ,
18- ErrorDomain ,
19- ErrorOperation ,
20- )
2115from ai .backend .common .types import AgentId
2216
2317if TYPE_CHECKING :
2418 from .docker .metadata .server import MetadataServer
2519
2620
27- class AgentIdNotFoundError (BackendAIError ):
28- @classmethod
29- def error_code (cls ) -> ErrorCode :
30- return ErrorCode (
31- domain = ErrorDomain .AGENT ,
32- operation = ErrorOperation .ACCESS ,
33- error_detail = ErrorDetail .NOT_FOUND ,
34- )
35-
36-
3721class AgentRuntime :
3822 _local_config : AgentUnifiedConfig
3923 _agents : dict [AgentId , AbstractAgent ]
You can’t perform that action at this time.
0 commit comments