Skip to content

Commit 5bebe6c

Browse files
move starter to example package
1 parent 2f8a839 commit 5bebe6c

11 files changed

Lines changed: 58 additions & 71 deletions

File tree

‎java/pom.xml‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
<module>semantickernel-bom</module>
8181
<module>semantickernel-api</module>
8282
<module>semantickernel-core</module>
83-
<module>semantickernel-spring-starter</module>
8483
</modules>
8584

8685
<dependencyManagement>
@@ -612,7 +611,6 @@
612611
</properties>
613612
<modules>
614613
<module>samples</module>
615-
<module>semantickernel-spring-starter</module>
616614
</modules>
617615
</profile>
618616
<profile>

‎java/samples/pom.xml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<modules>
1313
<module>sample-code</module>
1414
<module>semantickernel-samples-guice</module>
15+
<module>semantickernel-spring-starter</module>
1516
</modules>
1617

1718
<properties>

java/semantickernel-spring-starter/pom.xml renamed to java/samples/semantickernel-spring-starter/pom.xml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,14 @@
55
<modelVersion>4.0.0</modelVersion>
66
<parent>
77
<groupId>com.microsoft.semantic-kernel</groupId>
8-
<artifactId>semantickernel-parent</artifactId>
8+
<artifactId>samples</artifactId>
99
<version>0.2.10-alpha-SNAPSHOT</version>
10+
<relativePath>../pom.xml</relativePath>
1011
</parent>
1112

1213
<artifactId>semantickernel-spring-starter</artifactId>
1314
<name>Semantic Kernel Spring Boot Starter</name>
1415

15-
<properties>
16-
<maven.compiler.source>17</maven.compiler.source>
17-
<maven.compiler.target>17</maven.compiler.target>
18-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
19-
</properties>
2016
<dependencies>
2117
<dependency>
2218
<groupId>org.slf4j</groupId>
@@ -28,10 +24,6 @@
2824
<version>3.2.1</version>
2925
<scope>test</scope>
3026
</dependency>
31-
<dependency>
32-
<groupId>org.junit.jupiter</groupId>
33-
<artifactId>junit-jupiter</artifactId>
34-
</dependency>
3527
<dependency>
3628
<groupId>org.assertj</groupId>
3729
<artifactId>assertj-core</artifactId>
@@ -53,10 +45,6 @@
5345
<artifactId>azure-ai-openai</artifactId>
5446
<version>1.0.0-beta.6</version>
5547
</dependency>
56-
<dependency>
57-
<groupId>com.microsoft.semantic-kernel</groupId>
58-
<artifactId>semantickernel-api</artifactId>
59-
</dependency>
6048
<dependency>
6149
<groupId>com.microsoft.semantic-kernel</groupId>
6250
<artifactId>semantickernel-core</artifactId>
@@ -78,6 +66,12 @@
7866
<artifactId>azure-identity</artifactId>
7967
<version>1.9.1</version>
8068
</dependency>
69+
<dependency>
70+
<groupId>org.junit.jupiter</groupId>
71+
<artifactId>junit-jupiter-api</artifactId>
72+
<version>5.10.1</version>
73+
<scope>test</scope>
74+
</dependency>
8175
</dependencies>
8276

8377
</project>

java/semantickernel-spring-starter/src/main/java/com/microsoft/semantickernel/starter/AzureOpenAIConnectionProperties.java renamed to java/samples/semantickernel-spring-starter/src/main/java/com/microsoft/semantickernel/starter/AzureOpenAIConnectionProperties.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Copyright (c) Microsoft. All rights reserved.
21
package com.microsoft.semantickernel.starter;
32

43
import org.springframework.boot.context.properties.ConfigurationProperties;

java/semantickernel-spring-starter/src/main/java/com/microsoft/semantickernel/starter/SemanticKernelAutoConfiguration.java renamed to java/samples/semantickernel-spring-starter/src/main/java/com/microsoft/semantickernel/starter/SemanticKernelAutoConfiguration.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Copyright (c) Microsoft. All rights reserved.
21
package com.microsoft.semantickernel.starter;
32

43
import com.azure.ai.openai.OpenAIAsyncClient;
@@ -63,5 +62,4 @@ public Kernel semanticKernel(OpenAIAsyncClient client) {
6362
.build())
6463
.build();
6564
}
66-
6765
}

java/semantickernel-spring-starter/src/main/resources/application.properties renamed to java/samples/semantickernel-spring-starter/src/main/resources/application.properties

File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package com.microsoft.semantickernel.azureopenai;
2+
3+
import static org.junit.jupiter.api.Assertions.assertNotNull;
4+
5+
import com.microsoft.semantickernel.starter.AzureOpenAIConnectionProperties;
6+
import com.microsoft.semantickernel.starter.SemanticKernelAutoConfiguration;
7+
import org.junit.jupiter.api.Test;
8+
import org.springframework.boot.autoconfigure.AutoConfigurations;
9+
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
10+
import org.springframework.test.context.ActiveProfiles;
11+
12+
@ActiveProfiles("test")
13+
public class AzureOpenAIConnectionPropertiesTest {
14+
15+
ApplicationContextRunner contextRunner =
16+
new ApplicationContextRunner()
17+
.withPropertyValues(
18+
// @formatter:off
19+
"client.azureopenai.key=TEST_KEY",
20+
"client.azureopenai.endpoint=TEST_ENDPOINT",
21+
"client.azureopenai.deploymentname=TEST_DEPLOYMENT_NAME"
22+
23+
// @formatter:on
24+
)
25+
.withConfiguration(
26+
AutoConfigurations.of(SemanticKernelAutoConfiguration.class));
27+
28+
@Test
29+
public void ConnectionPropertiesTest() {
30+
contextRunner.run(
31+
context -> {
32+
AzureOpenAIConnectionProperties props =
33+
context.getBean(AzureOpenAIConnectionProperties.class);
34+
assertNotNull(props.getEndpoint());
35+
assertNotNull(props.getKey());
36+
assertNotNull(props.getDeploymentName());
37+
});
38+
}
39+
}

java/semantickernel-spring-starter/src/test/java/com/microsoft/semantickernel/azureopenai/SemanticKernelAutoConfigurationTest.java renamed to java/samples/semantickernel-spring-starter/src/test/java/com/microsoft/semantickernel/azureopenai/SemanticKernelAutoConfigurationTest.java

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Copyright (c) Microsoft. All rights reserved.
21
package com.microsoft.semantickernel.azureopenai;
32

43
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -17,23 +16,22 @@
1716
@SpringBootTest(classes = SemanticKernelAutoConfiguration.class)
1817
public class SemanticKernelAutoConfigurationTest {
1918

20-
@Autowired
21-
Kernel kernel;
19+
@Autowired Kernel kernel;
2220

2321
@Test
2422
public void testSemanticKernelAutoConfig() {
2523
ApplicationContextRunner runner = new ApplicationContextRunner();
2624
runner.withPropertyValues(
27-
// @formatter:off
28-
"client.azureopenai.key=TEST_KEY",
29-
"client.azureopenai.endpoint=TEST_ENDPOINT",
30-
"client.azureopenai.deploymentname=TEST_DEPLOYMENT_NAME"
31-
// @formatter:on
32-
);
25+
// @formatter:off
26+
"client.azureopenai.key=TEST_KEY",
27+
"client.azureopenai.endpoint=TEST_ENDPOINT",
28+
"client.azureopenai.deploymentname=TEST_DEPLOYMENT_NAME"
29+
// @formatter:on
30+
);
3331
runner.withConfiguration(AutoConfigurations.of(SemanticKernelAutoConfiguration.class));
3432
runner.run(
35-
context -> {
36-
assertNotNull(kernel);
37-
});
33+
context -> {
34+
assertNotNull(kernel);
35+
});
3836
}
3937
}

java/semantickernel-spring-starter/src/test/resources/application.properties renamed to java/samples/semantickernel-spring-starter/src/test/resources/application.properties

File renamed without changes.

java/semantickernel-spring-starter/src/test/resources/log4j2.xml renamed to java/samples/semantickernel-spring-starter/src/test/resources/log4j2.xml

File renamed without changes.

0 commit comments

Comments
 (0)