1use crate::prompt::PromptDef;
10use crate::resource::ResourceDef;
11use crate::tool::ToolDef;
12
13#[derive(Debug)]
15pub struct AutoTool(fn() -> ToolDef);
16
17impl AutoTool {
18 #[must_use]
20 pub const fn new(definition: fn() -> ToolDef) -> Self {
21 Self(definition)
22 }
23
24 pub(crate) fn definition(&self) -> ToolDef {
25 (self.0)()
26 }
27}
28
29inventory::collect!(AutoTool);
30
31#[derive(Debug)]
33pub struct AutoResource(fn() -> ResourceDef);
34
35impl AutoResource {
36 #[must_use]
38 pub const fn new(definition: fn() -> ResourceDef) -> Self {
39 Self(definition)
40 }
41
42 pub(crate) fn definition(&self) -> ResourceDef {
43 (self.0)()
44 }
45}
46
47inventory::collect!(AutoResource);
48
49#[derive(Debug)]
51pub struct AutoPrompt(fn() -> PromptDef);
52
53impl AutoPrompt {
54 #[must_use]
56 pub const fn new(definition: fn() -> PromptDef) -> Self {
57 Self(definition)
58 }
59
60 pub(crate) fn definition(&self) -> PromptDef {
61 (self.0)()
62 }
63}
64
65inventory::collect!(AutoPrompt);