mirror of
https://github.com/slhaf/Partner.git
synced 2026-05-12 08:43:02 +08:00
refactor(framework): add @Shutdown annotation to AgentContext for ordered shutdown hook execution
This commit is contained in:
@@ -108,3 +108,15 @@ sealed class ModuleContextData<out T : AbstractAgentModule> {
|
|||||||
val basePrompt: JSONArray
|
val basePrompt: JSONArray
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* # Shutdown Hook 注解
|
||||||
|
* - 可用于[AgentComponent]相关类、[work.slhaf.partner.api.agent.factory.capability.annotation.CapabilityCore]相关类。
|
||||||
|
* - 关闭时将按照:Running -> Additional -> Standalone -> Sub -> Capability 的顺序执行
|
||||||
|
* - [order] 仅在同一层级内起顺序对比作用,数值越小,执行越早。
|
||||||
|
*/
|
||||||
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
|
@Target(AnnotationTarget.FUNCTION)
|
||||||
|
annotation class Shutdown(
|
||||||
|
val order: Int = 0,
|
||||||
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user