Skip to content

Commit 530e390

Browse files
Merge branch 'fixmiskey' of https://github.com/zxuexingzhijie/spring-ai-alibaba into fixmiskey
2 parents cd7fa04 + 618db68 commit 530e390

File tree

535 files changed

+29701
-12556
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

535 files changed

+29701
-12556
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ To quickly get started with Spring AI Alibaba, add 'spring-ai-alibaba-starter-da
3535
<dependency>
3636
<groupId>com.alibaba.cloud.ai</groupId>
3737
<artifactId>spring-ai-alibaba-bom</artifactId>
38-
<version>1.0.0.2</version>
38+
<version>1.0.0.3</version>
3939
<type>pom</type>
4040
<scope>import</scope>
4141
</dependency>
@@ -50,11 +50,11 @@ To quickly get started with Spring AI Alibaba, add 'spring-ai-alibaba-starter-da
5050
</dependencies>
5151
```
5252

53-
Please check [Quick Start](https://java2ai.com/docs/1.0.0.2/get-started/chatbot) on our official website to learn more details. More starters include `spring-ai-alibaba-graph-core`, `spring-ai-alibaba-starter-nl2sql`,`spring-ai-alibaba-starter-nacos-mcp-client`, etc, please refer to the official website documentation.
53+
Please check [Quick Start](https://java2ai.com/docs/1.0.0.3/get-started/chatbot) on our official website to learn more details. More starters include `spring-ai-alibaba-graph-core`, `spring-ai-alibaba-starter-nl2sql`,`spring-ai-alibaba-starter-nacos-mcp-client`, etc, please refer to the official website documentation.
5454

5555
> NOTE!
5656
> 1. Requires JDK 17+.
57-
> 2. If there are any `spring-ai` dependency issue, please lean how to configure the `spring-milestones` Maven repository on [FAQ page](https://java2ai.com/docs/1.0.0.2/faq).
57+
> 2. If there are any `spring-ai` dependency issue, please lean how to configure the `spring-milestones` Maven repository on [FAQ page](https://java2ai.com/docs/1.0.0.3/faq).
5858
5959
### Playground and Example
6060

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright 2024-2025 the original author or authors.
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ https://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
18+
<modelVersion>4.0.0</modelVersion>
19+
<parent>
20+
<groupId>com.alibaba.cloud.ai</groupId>
21+
<artifactId>spring-ai-alibaba</artifactId>
22+
<version>${revision}</version>
23+
<relativePath>../../pom.xml</relativePath>
24+
</parent>
25+
26+
<artifactId>spring-ai-alibaba-autoconfigure-a2a-client</artifactId>
27+
28+
<name>Spring AI Alibaba A2A Client Autoconfiguration</name>
29+
<description>Spring AI Alibaba A2A Client Autoconfiguration</description>
30+
<url>https://github.com/alibaba/spring-ai-alibaba</url>
31+
<scm>
32+
<connection>git://github.com/alibaba/spring-ai-alibaba.git</connection>
33+
<developerConnection>git@github.com:alibaba/spring-ai-alibaba.git</developerConnection>
34+
<url>https://github.com/alibaba/spring-ai-alibaba</url>
35+
</scm>
36+
37+
<dependencies>
38+
<dependency>
39+
<groupId>com.alibaba.cloud.ai</groupId>
40+
<artifactId>spring-ai-alibaba-a2a-common</artifactId>
41+
<version>${project.parent.version}</version>
42+
</dependency>
43+
<dependency>
44+
<groupId>org.springframework.boot</groupId>
45+
<artifactId>spring-boot-configuration-processor</artifactId>
46+
</dependency>
47+
</dependencies>
48+
</project>
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/*
2+
* Copyright 2024-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.alibaba.cloud.ai.autoconfigure.a2a.client;
18+
19+
import com.alibaba.cloud.ai.a2a.A2aClientAgentCardProperties;
20+
import com.alibaba.cloud.ai.autoconfigure.a2a.client.condition.A2aClientAgentCardWellKnownCondition;
21+
import com.alibaba.cloud.ai.graph.agent.a2a.AgentCardProvider;
22+
import com.alibaba.cloud.ai.graph.agent.a2a.RemoteAgentCardProvider;
23+
import io.a2a.spec.AgentCard;
24+
25+
import org.springframework.boot.autoconfigure.AutoConfiguration;
26+
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
27+
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
28+
import org.springframework.boot.context.properties.EnableConfigurationProperties;
29+
import org.springframework.context.annotation.Bean;
30+
import org.springframework.context.annotation.Conditional;
31+
32+
/**
33+
* Autoconfiguration for A2A client agent card provider.
34+
*
35+
* @author xiweng.yy
36+
*/
37+
@AutoConfiguration
38+
@EnableConfigurationProperties({ A2aClientAgentCardProperties.class })
39+
public class A2aClientAgentCardProviderAutoConfiguration {
40+
41+
@Bean
42+
@ConditionalOnClass({ AgentCardProvider.class })
43+
@Conditional(A2aClientAgentCardWellKnownCondition.class)
44+
public AgentCardProvider remoteAgentCardProvider(A2aClientAgentCardProperties a2aClientAgentCardProperties) {
45+
return RemoteAgentCardProvider.newProvider(a2aClientAgentCardProperties.getWellKnownUrl());
46+
}
47+
48+
@Bean
49+
@ConditionalOnClass({ AgentCardProvider.class })
50+
@ConditionalOnProperty(prefix = A2aClientAgentCardProperties.CONFIG_PREFIX, value = "name")
51+
public AgentCardProvider localAgentCardProvider(A2aClientAgentCardProperties a2aClientAgentCardProperties) {
52+
AgentCard agentCard = new AgentCard.Builder().name(a2aClientAgentCardProperties.getName())
53+
.description(a2aClientAgentCardProperties.getDescription())
54+
.url(a2aClientAgentCardProperties.getUrl())
55+
.provider(a2aClientAgentCardProperties.getProvider())
56+
.documentationUrl(a2aClientAgentCardProperties.getDocumentationUrl())
57+
.capabilities(a2aClientAgentCardProperties.getCapabilities())
58+
.defaultInputModes(a2aClientAgentCardProperties.getDefaultInputModes())
59+
.defaultOutputModes(a2aClientAgentCardProperties.getDefaultOutputModes())
60+
.skills(a2aClientAgentCardProperties.getSkills())
61+
.supportsAuthenticatedExtendedCard(a2aClientAgentCardProperties.isSupportsAuthenticatedExtendedCard())
62+
.securitySchemes(a2aClientAgentCardProperties.getSecuritySchemes())
63+
.security(a2aClientAgentCardProperties.getSecurity())
64+
.iconUrl(a2aClientAgentCardProperties.getIconUrl())
65+
.additionalInterfaces(a2aClientAgentCardProperties.getAdditionalInterfaces())
66+
.version(a2aClientAgentCardProperties.getVersion())
67+
.protocolVersion(a2aClientAgentCardProperties.getProtocolVersion())
68+
.preferredTransport(a2aClientAgentCardProperties.getPreferredTransport())
69+
.build();
70+
return () -> agentCard;
71+
}
72+
73+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright 2024-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.alibaba.cloud.ai.autoconfigure.a2a.client.condition;
18+
19+
import com.alibaba.cloud.ai.a2a.A2aClientAgentCardProperties;
20+
21+
import org.springframework.boot.autoconfigure.condition.ConditionOutcome;
22+
import org.springframework.boot.autoconfigure.condition.SpringBootCondition;
23+
import org.springframework.context.annotation.ConditionContext;
24+
import org.springframework.core.type.AnnotatedTypeMetadata;
25+
import org.springframework.util.StringUtils;
26+
27+
/**
28+
* Condition for {@link com.alibaba.cloud.ai.graph.agent.a2a.RemoteAgentCardProvider}.
29+
*
30+
* @author xiweng.yy
31+
*/
32+
public class A2aClientAgentCardWellKnownCondition extends SpringBootCondition {
33+
34+
@Override
35+
public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) {
36+
String wellKnownUrl = context.getEnvironment()
37+
.getProperty(A2aClientAgentCardProperties.CONFIG_PREFIX + ".well-known-url", String.class);
38+
return StringUtils.hasLength(wellKnownUrl) ? ConditionOutcome.match()
39+
: ConditionOutcome.noMatch(A2aClientAgentCardProperties.CONFIG_PREFIX + ".wellKnownUrl not set.");
40+
}
41+
42+
}
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
{
2+
"groups": [
3+
{
4+
"name": "spring.ai.alibaba.a2a.client.card",
5+
"type": "com.alibaba.cloud.ai.a2a.A2aClientAgentCardProperties",
6+
"sourceType": "com.alibaba.cloud.ai.a2a.A2aClientAgentCardProperties",
7+
"description": "Configuration properties for A2A Agent Card."
8+
}
9+
],
10+
"properties": [
11+
{
12+
"name": "spring.ai.alibaba.a2a.client.card.name",
13+
"type": "java.lang.String",
14+
"description": "The name of the agent.",
15+
"sourceType": "com.alibaba.cloud.ai.a2a.A2aClientAgentCardProperties"
16+
},
17+
{
18+
"name": "spring.ai.alibaba.a2a.client.card.description",
19+
"type": "java.lang.String",
20+
"description": "The description of the agent.",
21+
"sourceType": "com.alibaba.cloud.ai.a2a.A2aClientAgentCardProperties"
22+
},
23+
{
24+
"name": "spring.ai.alibaba.a2a.client.card.url",
25+
"type": "java.lang.String",
26+
"description": "The url of the agent.",
27+
"sourceType": "com.alibaba.cloud.ai.a2a.A2aClientAgentCardProperties"
28+
},
29+
{
30+
"name": "spring.ai.alibaba.a2a.client.card.provider",
31+
"type": "io.a2a.spec.AgentProvider",
32+
"description": "The provider information of the agent.",
33+
"sourceType": "com.alibaba.cloud.ai.a2a.A2aClientAgentCardProperties"
34+
},
35+
{
36+
"name": "spring.ai.alibaba.a2a.client.card.documentation-url",
37+
"type": "java.lang.String",
38+
"description": "The documentation url of the agent.",
39+
"sourceType": "com.alibaba.cloud.ai.a2a.A2aClientAgentCardProperties"
40+
},
41+
{
42+
"name": "spring.ai.alibaba.a2a.client.card.capabilities",
43+
"type": "io.a2a.spec.AgentCapabilities",
44+
"description": "The capabilities of the agent.",
45+
"sourceType": "com.alibaba.cloud.ai.a2a.A2aClientAgentCardProperties"
46+
},
47+
{
48+
"name": "spring.ai.alibaba.a2a.client.card.default-input-modes",
49+
"type": "java.util.List<java.lang.String>",
50+
"description": "The default input modes of the agent.",
51+
"sourceType": "com.alibaba.cloud.ai.a2a.A2aClientAgentCardProperties"
52+
},
53+
{
54+
"name": "spring.ai.alibaba.a2a.client.card.default-output-modes",
55+
"type": "java.util.List<java.lang.String>",
56+
"description": "The default output modes of the agent.",
57+
"sourceType": "com.alibaba.cloud.ai.a2a.A2aClientAgentCardProperties"
58+
},
59+
{
60+
"name": "spring.ai.alibaba.a2a.client.card.skills",
61+
"type": "java.util.List<io.a2a.spec.AgentSkill>",
62+
"description": "The skills of the agent.",
63+
"sourceType": "com.alibaba.cloud.ai.a2a.A2aClientAgentCardProperties"
64+
},
65+
{
66+
"name": "spring.ai.alibaba.a2a.client.card.supports-authenticated-extended-card",
67+
"type": "java.lang.Boolean",
68+
"description": "Whether the agent supports authenticated extended card.",
69+
"sourceType": "com.alibaba.cloud.ai.a2a.A2aClientAgentCardProperties",
70+
"defaultValue": false
71+
},
72+
{
73+
"name": "spring.ai.alibaba.a2a.client.card.security-schemes",
74+
"type": "java.util.Map<java.lang.String, io.a2a.spec.SecurityScheme>",
75+
"description": "The security schemes of the agent.",
76+
"sourceType": "com.alibaba.cloud.ai.a2a.A2aClientAgentCardProperties"
77+
},
78+
{
79+
"name": "spring.ai.alibaba.a2a.client.card.security",
80+
"type": "java.util.List<java.util.Map<java.lang.String, java.util.List<java.lang.String>>>",
81+
"description": "The security configuration of the agent.",
82+
"sourceType": "com.alibaba.cloud.ai.a2a.A2aClientAgentCardProperties"
83+
},
84+
{
85+
"name": "spring.ai.alibaba.a2a.client.card.icon-url",
86+
"type": "java.lang.String",
87+
"description": "The icon url of the agent.",
88+
"sourceType": "com.alibaba.cloud.ai.a2a.A2aClientAgentCardProperties"
89+
},
90+
{
91+
"name": "spring.ai.alibaba.a2a.client.card.additional-interfaces",
92+
"type": "java.util.List<io.a2a.spec.AgentInterface>",
93+
"description": "The additional interfaces of the agent.",
94+
"sourceType": "com.alibaba.cloud.ai.a2a.A2aClientAgentCardProperties"
95+
},
96+
{
97+
"name": "spring.ai.alibaba.a2a.client.card.version",
98+
"type": "java.lang.String",
99+
"description": "The version of the agent.",
100+
"sourceType": "com.alibaba.cloud.ai.a2a.A2aClientAgentCardProperties"
101+
},
102+
{
103+
"name": "spring.ai.alibaba.a2a.client.card.preferred-transport",
104+
"type": "java.lang.String",
105+
"description": "The preferred transport of the agent. enum of `JSONRPC`, `GRPC`, `HTTP+JSON`.",
106+
"sourceType": "com.alibaba.cloud.ai.a2a.A2aClientAgentCardProperties"
107+
},
108+
{
109+
"name": "spring.ai.alibaba.a2a.client.card.protocol-version",
110+
"type": "java.lang.String",
111+
"description": "The protocol version of the agent.",
112+
"sourceType": "com.alibaba.cloud.ai.a2a.A2aClientAgentCardProperties"
113+
},
114+
{
115+
"name": "spring.ai.alibaba.a2a.client.card.well-known-url",
116+
"type": "java.lang.String",
117+
"description": "The well known url of agent card.",
118+
"sourceType": "com.alibaba.cloud.ai.a2a.A2aClientAgentCardProperties"
119+
}
120+
],
121+
"hints": []
122+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#
2+
# Copyright 2025-2025 the original author or authors.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
com.alibaba.cloud.ai.autoconfigure.a2a.client.A2aClientAgentCardProviderAutoConfiguration
17+
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright 2024-2025 the original author or authors.
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ https://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
18+
<modelVersion>4.0.0</modelVersion>
19+
<parent>
20+
<groupId>com.alibaba.cloud.ai</groupId>
21+
<artifactId>spring-ai-alibaba</artifactId>
22+
<version>${revision}</version>
23+
<relativePath>../../pom.xml</relativePath>
24+
</parent>
25+
26+
<artifactId>spring-ai-alibaba-autoconfigure-a2a-registry</artifactId>
27+
<name>Spring AI Alibaba A2A Nacos Registry Autoconfiguration</name>
28+
<description>Spring AI Alibaba A2A Nacos Registry Autoconfiguration</description>
29+
<url>https://github.com/alibaba/spring-ai-alibaba</url>
30+
<scm>
31+
<connection>git://github.com/alibaba/spring-ai-alibaba.git</connection>
32+
<developerConnection>git@github.com:alibaba/spring-ai-alibaba.git</developerConnection>
33+
<url>https://github.com/alibaba/spring-ai-alibaba</url>
34+
</scm>
35+
36+
<properties>
37+
<maven.compiler.source>17</maven.compiler.source>
38+
<maven.compiler.target>17</maven.compiler.target>
39+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
40+
</properties>
41+
42+
<dependencies>
43+
<dependency>
44+
<groupId>com.alibaba.cloud.ai</groupId>
45+
<artifactId>spring-ai-alibaba-autoconfigure-a2a-server</artifactId>
46+
<version>${project.parent.version}</version>
47+
<scope>provided</scope>
48+
</dependency>
49+
<dependency>
50+
<groupId>com.alibaba.cloud.ai</groupId>
51+
<artifactId>spring-ai-alibaba-autoconfigure-a2a-client</artifactId>
52+
<version>${project.parent.version}</version>
53+
<scope>provided</scope>
54+
</dependency>
55+
<dependency>
56+
<groupId>com.alibaba.cloud.ai</groupId>
57+
<artifactId>spring-ai-alibaba-a2a-registry</artifactId>
58+
<version>${project.parent.version}</version>
59+
</dependency>
60+
61+
<dependency>
62+
<groupId>org.springframework.boot</groupId>
63+
<artifactId>spring-boot-configuration-processor</artifactId>
64+
</dependency>
65+
</dependencies>
66+
67+
</project>

0 commit comments

Comments
 (0)