Commit c92ef52
committed
Add name property support to AssistantMessage for multi-agent systems\n\n- Add name field to AssistantMessage for multi-agent system support\n- Add new constructors with name parameter for backward compatibility\n- Update equals, hashCode, and toString methods to include name\n- Add comprehensive test coverage for name property functionality\n- Update all AI provider implementations to pass name to API calls:\n * OpenAI ChatModel\n * DeepSeek ChatModel \n * MiniMax ChatModel\n * Mistral AI ChatModel\n * ZhiPu AI ChatModel\n * Azure OpenAI ChatModel (with reflection-based dynamic support)\n- Update Prompt class to properly copy name property\n- Update memory repository implementations (Neo4j, Cassandra)\n- Update DeepSeekAssistantMessage constructors to support name parameter\n- Apply Spring Java format to all modified files\n\nThis enhancement enables building multi-agent systems by allowing\nassistants to be distinguished by name, making it easier to share\nglobal context across different AI assistants.
Signed-off-by: huidong.yin <[email protected]>1 parent eaca392 commit c92ef52
File tree
12 files changed
+197
-13
lines changed- memory/repository
- spring-ai-model-chat-memory-repository-cassandra/src/main/java/org/springframework/ai/chat/memory/repository/cassandra
- spring-ai-model-chat-memory-repository-neo4j/src/main/java/org/springframework/ai/chat/memory/repository/neo4j
- models
- spring-ai-azure-openai/src/main/java/org/springframework/ai/azure/openai
- spring-ai-deepseek/src/main/java/org/springframework/ai/deepseek
- spring-ai-minimax/src/main/java/org/springframework/ai/minimax
- spring-ai-mistral-ai/src/main/java/org/springframework/ai/mistralai
- spring-ai-openai/src/main/java/org/springframework/ai/openai
- spring-ai-zhipuai/src/main/java/org/springframework/ai/zhipuai
- spring-ai-model/src
- main/java/org/springframework/ai/chat
- messages
- prompt
- test/java/org/springframework/ai/chat/messages
12 files changed
+197
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
| 212 | + | |
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
| 193 | + | |
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
596 | 598 | | |
597 | 599 | | |
598 | 600 | | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
599 | 611 | | |
600 | 612 | | |
601 | 613 | | |
| |||
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
60 | 82 | | |
61 | 83 | | |
62 | 84 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
449 | | - | |
450 | | - | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
451 | 452 | | |
452 | 453 | | |
453 | 454 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
519 | 519 | | |
520 | 520 | | |
521 | 521 | | |
522 | | - | |
| 522 | + | |
523 | 523 | | |
524 | 524 | | |
525 | 525 | | |
| |||
models/spring-ai-mistral-ai/src/main/java/org/springframework/ai/mistralai/MistralAiChatModel.java
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
454 | 454 | | |
455 | 455 | | |
456 | 456 | | |
457 | | - | |
| 457 | + | |
| 458 | + | |
458 | 459 | | |
459 | 460 | | |
460 | 461 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
591 | 591 | | |
592 | 592 | | |
593 | 593 | | |
594 | | - | |
595 | | - | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
596 | 597 | | |
597 | 598 | | |
598 | 599 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
510 | 510 | | |
511 | 511 | | |
512 | 512 | | |
513 | | - | |
| 513 | + | |
514 | 514 | | |
515 | 515 | | |
516 | 516 | | |
| |||
Lines changed: 34 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| |||
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
58 | 77 | | |
59 | 78 | | |
60 | 79 | | |
61 | 80 | | |
62 | 81 | | |
| 82 | + | |
63 | 83 | | |
64 | 84 | | |
65 | 85 | | |
| |||
75 | 95 | | |
76 | 96 | | |
77 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
78 | 108 | | |
79 | 109 | | |
80 | 110 | | |
| |||
86 | 116 | | |
87 | 117 | | |
88 | 118 | | |
89 | | - | |
| 119 | + | |
| 120 | + | |
90 | 121 | | |
91 | 122 | | |
92 | 123 | | |
93 | 124 | | |
94 | | - | |
| 125 | + | |
95 | 126 | | |
96 | 127 | | |
97 | 128 | | |
98 | 129 | | |
99 | 130 | | |
100 | | - | |
| 131 | + | |
101 | 132 | | |
102 | 133 | | |
103 | 134 | | |
| |||
0 commit comments