lidp commited on
Commit
c71dafa
·
1 Parent(s): c89cd5f

Update dsl_examples and Fix component concentrator (#2597)

Browse files

### What problem does this PR solve?

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
- [x] New Feature (non-breaking change which adds functionality)

agent/component/concentrator.py CHANGED
@@ -26,7 +26,7 @@ class ConcentratorParam(ComponentParamBase):
26
  super().__init__()
27
 
28
  def check(self):
29
- super().check()
30
 
31
 
32
  class Concentrator(ComponentBase, ABC):
 
26
  super().__init__()
27
 
28
  def check(self):
29
+ return True
30
 
31
 
32
  class Concentrator(ComponentBase, ABC):
agent/test/dsl_examples/categorize.json CHANGED
@@ -26,20 +26,48 @@
26
  "category_description": {
27
  "product_related": {
28
  "description": "The question is about the product usage, appearance and how it works.",
29
- "examples": "Why it always beaming?\nHow to install it onto the wall?\nIt leaks, what to do?"
 
30
  },
31
  "others": {
32
  "description": "The question is not about the product usage, appearance and how it works.",
33
- "examples": "How are you doing?\nWhat is your name?\nAre you a robot?\nWhat's the weather?\nWill it rain?"
 
34
  }
35
  }
36
  }
37
  },
38
- "downstream": [],
39
  "upstream": ["answer:0"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  }
41
  },
42
  "history": [],
 
43
  "path": [],
 
44
  "answer": []
45
- }
 
26
  "category_description": {
27
  "product_related": {
28
  "description": "The question is about the product usage, appearance and how it works.",
29
+ "examples": "Why it always beaming?\nHow to install it onto the wall?\nIt leaks, what to do?",
30
+ "to": "message:0"
31
  },
32
  "others": {
33
  "description": "The question is not about the product usage, appearance and how it works.",
34
+ "examples": "How are you doing?\nWhat is your name?\nAre you a robot?\nWhat's the weather?\nWill it rain?",
35
+ "to": "message:1"
36
  }
37
  }
38
  }
39
  },
40
+ "downstream": ["message:0","message:1"],
41
  "upstream": ["answer:0"]
42
+ },
43
+ "message:0": {
44
+ "obj": {
45
+ "component_name": "Message",
46
+ "params": {
47
+ "messages": [
48
+ "Message 0!!!!!!!"
49
+ ]
50
+ }
51
+ },
52
+ "downstream": ["answer:0"],
53
+ "upstream": ["categorize:0"]
54
+ },
55
+ "message:1": {
56
+ "obj": {
57
+ "component_name": "Message",
58
+ "params": {
59
+ "messages": [
60
+ "Message 1!!!!!!!"
61
+ ]
62
+ }
63
+ },
64
+ "downstream": ["answer:0"],
65
+ "upstream": ["categorize:0"]
66
  }
67
  },
68
  "history": [],
69
+ "messages": [],
70
  "path": [],
71
+ "reference": [],
72
  "answer": []
73
+ }
agent/test/dsl_examples/concentrator_message.json ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "components": {
3
+ "begin": {
4
+ "obj":{
5
+ "component_name": "Begin",
6
+ "params": {
7
+ "prologue": "Hi there!"
8
+ }
9
+ },
10
+ "downstream": ["answer:0"],
11
+ "upstream": []
12
+ },
13
+ "answer:0": {
14
+ "obj": {
15
+ "component_name": "Answer",
16
+ "params": {}
17
+ },
18
+ "downstream": ["categorize:0"],
19
+ "upstream": ["begin"]
20
+ },
21
+ "categorize:0": {
22
+ "obj": {
23
+ "component_name": "Categorize",
24
+ "params": {
25
+ "llm_id": "deepseek-chat",
26
+ "category_description": {
27
+ "product_related": {
28
+ "description": "The question is about the product usage, appearance and how it works.",
29
+ "examples": "Why it always beaming?\nHow to install it onto the wall?\nIt leaks, what to do?",
30
+ "to": "concentrator:0"
31
+ },
32
+ "others": {
33
+ "description": "The question is not about the product usage, appearance and how it works.",
34
+ "examples": "How are you doing?\nWhat is your name?\nAre you a robot?\nWhat's the weather?\nWill it rain?",
35
+ "to": "concentrator:1"
36
+ }
37
+ }
38
+ }
39
+ },
40
+ "downstream": ["concentrator:0","concentrator:1"],
41
+ "upstream": ["answer:0"]
42
+ },
43
+ "concentrator:0": {
44
+ "obj": {
45
+ "component_name": "Concentrator",
46
+ "params": {}
47
+ },
48
+ "downstream": ["message:0"],
49
+ "upstream": ["categorize:0"]
50
+ },
51
+ "concentrator:1": {
52
+ "obj": {
53
+ "component_name": "Concentrator",
54
+ "params": {}
55
+ },
56
+ "downstream": ["message:1_0","message:1_1","message:1_2"],
57
+ "upstream": ["categorize:0"]
58
+ },
59
+ "message:0": {
60
+ "obj": {
61
+ "component_name": "Message",
62
+ "params": {
63
+ "messages": [
64
+ "Message 0_0!!!!!!!"
65
+ ]
66
+ }
67
+ },
68
+ "downstream": ["answer:0"],
69
+ "upstream": ["concentrator:0"]
70
+ },
71
+ "message:1_0": {
72
+ "obj": {
73
+ "component_name": "Message",
74
+ "params": {
75
+ "messages": [
76
+ "Message 1_0!!!!!!!"
77
+ ]
78
+ }
79
+ },
80
+ "downstream": ["answer:0"],
81
+ "upstream": ["concentrator:1"]
82
+ },
83
+ "message:1_1": {
84
+ "obj": {
85
+ "component_name": "Message",
86
+ "params": {
87
+ "messages": [
88
+ "Message 1_1!!!!!!!"
89
+ ]
90
+ }
91
+ },
92
+ "downstream": ["answer:0"],
93
+ "upstream": ["concentrator:1"]
94
+ },
95
+ "message:1_2": {
96
+ "obj": {
97
+ "component_name": "Message",
98
+ "params": {
99
+ "messages": [
100
+ "Message 1_2!!!!!!!"
101
+ ]
102
+ }
103
+ },
104
+ "downstream": ["answer:0"],
105
+ "upstream": ["concentrator:1"]
106
+ }
107
+ },
108
+ "history": [],
109
+ "messages": [],
110
+ "path": [],
111
+ "reference": [],
112
+ "answer": []
113
+ }