Skip to main content

a2a_agents/agents/reimbursement/
plugin.rs

1//! AgentPlugin implementation for ReimbursementHandler
2//!
3//! This module provides the AgentPlugin trait implementation, which enables
4//! automatic skill discovery and metadata provisioning.
5
6use crate::traits::{AgentPlugin, SkillDefinition};
7use async_trait::async_trait;
8
9use super::handler::ReimbursementHandler;
10
11/// Implement AgentPlugin for ReimbursementHandler with InMemoryTaskStorage
12#[async_trait]
13impl<T> AgentPlugin for ReimbursementHandler<T>
14where
15    T: a2a_rs::port::AsyncTaskManager
16        + a2a_rs::port::AsyncStreamingHandler
17        + Clone
18        + Send
19        + Sync
20        + 'static,
21{
22    fn name(&self) -> &str {
23        "Reimbursement Agent"
24    }
25
26    fn description(&self) -> &str {
27        "Intelligent expense reimbursement assistant that helps users submit and track reimbursement requests through natural conversation"
28    }
29
30    fn version(&self) -> &str {
31        env!("CARGO_PKG_VERSION")
32    }
33
34    fn skills(&self) -> Vec<SkillDefinition> {
35        vec![
36            SkillDefinition {
37                id: "submit_reimbursement".to_string(),
38                name: "Submit Reimbursement Request".to_string(),
39                description: "Guide users through submitting an expense reimbursement request"
40                    .to_string(),
41                keywords: vec![
42                    "reimburse".into(),
43                    "reimbursement".into(),
44                    "expense".into(),
45                    "receipt".into(),
46                    "refund".into(),
47                    "claim".into(),
48                    "submit".into(),
49                ],
50                examples: vec![
51                    "I need to submit a reimbursement".into(),
52                    "I want to get reimbursed for an expense".into(),
53                    "Submit expense claim".into(),
54                ],
55                input_formats: vec!["text".into(), "file".into()],
56                output_formats: vec!["text".into(), "data".into()],
57            },
58            SkillDefinition {
59                id: "track_request".to_string(),
60                name: "Track Request Status".to_string(),
61                description: "Check the status of existing reimbursement requests".to_string(),
62                keywords: vec![
63                    "status".into(),
64                    "track".into(),
65                    "check".into(),
66                    "where is".into(),
67                    "progress".into(),
68                ],
69                examples: vec![
70                    "What's the status of my request?".into(),
71                    "Check my reimbursement status".into(),
72                ],
73                input_formats: vec!["text".into()],
74                output_formats: vec!["text".into(), "data".into()],
75            },
76            SkillDefinition {
77                id: "help".to_string(),
78                name: "Get Help".to_string(),
79                description: "Provide information about the reimbursement process".to_string(),
80                keywords: vec![
81                    "help".into(),
82                    "how".into(),
83                    "what".into(),
84                    "info".into(),
85                    "information".into(),
86                ],
87                examples: vec![
88                    "How do I submit a reimbursement?".into(),
89                    "What information do I need?".into(),
90                ],
91                input_formats: vec!["text".into()],
92                output_formats: vec!["text".into()],
93            },
94        ]
95    }
96}