Commit Graph
22 Commits
Author SHA1 Message Date
b7f7170a64 Java: Example14_SemanticMemory (#1355)
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->
Port Example14_SemanticMemory.cs to Java

### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
Port of Example14_SemanticMemory.cs to Java. 
This sample uses an Azure Cognitive Search connector, which was also
ported from dotnet/src/Connectors/Connectors.Memory.AzureCognitiveSearch
Changes needed to api and core modules. 

### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [x] The code builds clean without any errors or warnings
- [x] The PR follows SK Contribution Guidelines
(https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
- [x] ~The code follows the .NET coding conventions
(https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions)
verified with `dotnet format`~ Java code follows AOSP style
- [X] All unit tests pass, and I have added new tests where possible
- [X] I didn't break anyone 😄

---------

Co-authored-by: Luigi Montoya <[email protected]>
Co-authored-by: joe-braley <[email protected]>
Co-authored-by: Luigi96 <[email protected]>
Co-authored-by: Mark Wallace <[email protected]>
Co-authored-by: John Oliver <[email protected]>
2023-06-27 13:02:53 +01:00
Bruno BorgesandMark Wallace 53458c5efc Java: File IO skill (#1399)
Co-authored-by: Mark Wallace <[email protected]>
2023-06-16 15:33:14 +01:00
Bruno BorgesandMark Wallace 1155eff673 Java: MathSkill (#1393)
Co-authored-by: Mark Wallace <[email protected]>
2023-06-16 15:14:51 +01:00
Bruno Borges bdbdc90661 Fix formatting (#1492) 2023-06-15 17:34:56 -07:00
Bruno BorgesandMark Wallace 165522cd46 No need to annotate primitive type with Nonnullable (#1395)
Primitive types can't be null anyways.

Co-authored-by: Mark Wallace <[email protected]>
2023-06-12 10:30:03 +01:00
Bruno BorgesandMark Wallace 825cbca6b1 Ensure the SK is built for JDK 8 release (#1394)
Co-authored-by: Mark Wallace <[email protected]>
2023-06-12 10:15:28 +01:00
Bruno Borges 9e404466a3 Delete unused project OpenAI Client from the Java folder (#1392)
This is a follow up on the PR #1197
2023-06-12 10:07:17 +01:00
70d49fe36b Make use of OpenAI SDK directly (#1197)
This PR removes the Azure Open AI Client wrapper originally created as a
workaround.

---------

Co-authored-by: Luigi Montoya <[email protected]>
Co-authored-by: joe-braley <[email protected]>
Co-authored-by: Luigi96 <[email protected]>
Co-authored-by: Mark Wallace <[email protected]>
Co-authored-by: John Oliver <[email protected]>
Co-authored-by: David Grieve <[email protected]>
2023-06-09 10:13:05 +01:00
ad6fd915fb Java - Add conversation summary skill (#1291)
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->


### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->


### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows SK Contribution Guidelines
(https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
- [ ] The code follows the .NET coding conventions
(https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions)
verified with `dotnet format`
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄

---------

Co-authored-by: Luigi Montoya <[email protected]>
Co-authored-by: joe-braley <[email protected]>
Co-authored-by: Luigi96 <[email protected]>
Co-authored-by: Mark Wallace <[email protected]>
Co-authored-by: David Grieve <[email protected]>
2023-06-08 17:04:53 +01:00
1e9f8380a7 Java: Complete porting TextSkill (#1275)
Additionally removes the defaulting of the name for an annotated native
input parameter and requires explicit naming of the input name

---------

Co-authored-by: Luigi Montoya <[email protected]>
Co-authored-by: joe-braley <[email protected]>
Co-authored-by: Luigi96 <[email protected]>
Co-authored-by: Mark Wallace <[email protected]>
Co-authored-by: David Grieve <[email protected]>
2023-06-08 07:46:02 +01:00
1714c25ebe Add settings retrieval through properties file and env vars (#1361)
### Motivation and Context

Add settings retrieval through properties file and env vars

### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

Adds util.Settings to load settings values from a properties file or
from the environment.

Also, the ability to have different client settings in the properties
file and load them by their specific schema Id:
```yaml
client.azureopenai.key: "AZURE_OPEN_AI_KEY"
client.azureopenai.endpoint: "AZURE_OPEN_AI_ENDPOINT"
client.azureopenai.deploymentname: "AZURE_OPEN_AI_DEPLOYMENT_NAME"

client.myazureopenai.key: "AZURE_OPEN_AI_KEY"
client.myazureopenai.endpoint: "AZURE_OPEN_AI_ENDPOINT"
client.myazureopenai.deploymentname: "AZURE_OPEN_AI_DEPLOYMENT_NAME"
```

By calling `Settings.getAzureOpenAISettingsFromFile(CONF_PROPERTIES)`
the user would be able to load the Azure settings using the default
schema id, as shown in the block at the top.

By calling `Settings.getAzureOpenAISettingsFromFile(CONF_PROPERTIES,
"myazureopenai")` the user would be able to load a different Azure
configuration by just adding the second block to the properties file.

### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows SK Contribution Guidelines
(https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
- [ ] The code follows the .NET coding conventions
(https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions)
verified with `dotnet format`
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄

---------

Co-authored-by: Luigi Montoya <[email protected]>
Co-authored-by: joe-braley <[email protected]>
Co-authored-by: Luigi96 <[email protected]>
Co-authored-by: Mark Wallace <[email protected]>
Co-authored-by: John Oliver <[email protected]>
Co-authored-by: David Grieve <[email protected]>
2023-06-07 18:54:36 +01:00
John Oliver a720809a89 Java - Add ChatCompletions support (#1221)
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->


### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->


### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows SK Contribution Guidelines
(https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
- [ ] The code follows the .NET coding conventions
(https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions)
verified with `dotnet format`
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
2023-06-07 17:45:02 +01:00
Martijn VerburgandMark Wallace 2e96f09eae Update Maven Dependencies to latest versions and refactor parent vs BOM (#1192)
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->


### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->


### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [ ] The code builds clean without any errors or warnings
- [x] The PR follows SK Contribution Guidelines
(https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
- [ ] The code follows the .NET coding conventions
(https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions)
verified with `dotnet format`
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄

---------

Co-authored-by: Mark Wallace <[email protected]>
2023-05-26 18:10:17 +01:00
John Oliver 6e04c189cf Java - Improve NativeFunction support (#1202)
- Add support for SKFunctionInputAttribute. 
- Detect if there is a single string and use it as input. 
- Add tests for the NativeFunction

### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->


### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->


### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows SK Contribution Guidelines
(https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
- [ ] The code follows the .NET coding conventions
(https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions)
verified with `dotnet format`
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
2023-05-25 12:22:41 +01:00
David Grieve 688d4a4a1b Basically working VolatileMemoryStore (#1198)
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->
Initial port of C# memory to Java. Includes VolatileMemoryStore, no
others.


### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
Introduces
semantickernel-api/src/main/java/com/microsoft/semantickernel/memory and
implementation in
semantickernel-core/src/main/java/com/microsoft/semantickernel/memory

e2e integration test provides a sample. See
java/api-test/integration-tests/src/test/java/com/microsoft/semantickernel/e2e/TextEmbeddingsTest.java

### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [x] The code builds clean without any errors or warnings
- [x] The PR follows SK Contribution Guidelines
(https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
- [x] -The code follows the .NET coding conventions
(https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions)
verified with `dotnet format`- Java code uses AOSP style
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄
2023-05-24 20:38:23 +01:00
John OliverandMark Wallace 0e7a7db8aa Standardize the Java builder pattern class layout (#1179)
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->


### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->


### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows SK Contribution Guidelines
(https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
- [ ] The code follows the .NET coding conventions
(https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions)
verified with `dotnet format`
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄

---------

Co-authored-by: Mark Wallace <[email protected]>
2023-05-24 11:23:38 +01:00
Yoshio TeradaandMark Wallace 2223a8b319 Java Sample Code modified to modernized code and easy to understand (#1175)
This is the update pull request of 
https://github.com/microsoft/semantic-kernel/pull/1128

I closed the previous Pull Request #1128.

1 Modified getConfigValue()
1.1: local variable name from apiKey to propertyValue 1.2: Use NIO.2
libraries instead of old FileInputStream 1.3: modified Exception throw
code

2. Defined TEXT_TO_SUMMARIZE Instead of local variable definition, I
defined static final field

3. As a sample, I wrote non blocking code for Async operation Previously
it was wrote as
summarize.invokeAsync(TEXT_TO_SUMMARIZE).block() to subscribe()

4. In order to show the result, I added following code to receive the
result. try {
TimeUnit.SECONDS.sleep(10);
} catch (InterruptedException e) {
LOGGER.warn("Interrupted : {}", e.getMessage());
Thread.currentThread().interrupt();
}

5. Code Structure modified: I modified the code structure of both
'InlineFunctionExample.java' and
'InlineFunctionWithPreBuiltSkillExample.java' to be as similar as
possible, making them easier to compare.

---------

Co-authored-by: Mark Wallace <[email protected]>
2023-05-24 11:23:06 +01:00
Bruno Borges e848043fa6 Quick fix on the java readme (camel case on SK) (#1190) 2023-05-23 15:38:28 -07:00
John Oliver cb6d1c7d54 Tidy up Java license headers (#1180)
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->


### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->


### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows SK Contribution Guidelines
(https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
- [ ] The code follows the .NET coding conventions
(https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions)
verified with `dotnet format`
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
2023-05-23 21:11:27 +01:00
John OliverandMark Wallace 5396d70bd5 Complete porting the various Blocks for Java (#1108)
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->


### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->


### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows SK Contribution Guidelines
(https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
- [ ] The code follows the .NET coding conventions
(https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions)
verified with `dotnet format`
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄

---------

Co-authored-by: Mark Wallace <[email protected]>
2023-05-23 09:41:03 +01:00
David Grieve ba61001137 Exception classes in the API should extend SKException (#1112)
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->


### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->


### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows SK Contribution Guidelines
(https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
- [ ] The code follows the .NET coding conventions
(https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions)
verified with `dotnet format`
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
2023-05-22 14:24:56 -07:00
+38 7c18866cc2 Initial proposal for Java Kernel (#1081)
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->


### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->


### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows SK Contribution Guidelines
(https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
- [ ] The code follows the .NET coding conventions
(https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions)
verified with `dotnet format`
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Milder Hernandez Cagua <[email protected]>
Co-authored-by: Milder Hernandez <[email protected]>
Co-authored-by: Yoshio Terada <[email protected]>
Co-authored-by: Mark Wallace <[email protected]>
Co-authored-by: name <email>
Co-authored-by: Almir Kazazic <[email protected]>
Co-authored-by: Gudge <[email protected]>
Co-authored-by: Devis Lucato <[email protected]>
Co-authored-by: Alexander Siniouguine <[email protected]>
Co-authored-by: Harleen Thind <[email protected]>
Co-authored-by: David Barkol <[email protected]>
Co-authored-by: Adrian Bonar <[email protected]>
Co-authored-by: Mark Karle <[email protected]>
Co-authored-by: poweihuang0817 <[email protected]>
Co-authored-by: Po-Wei Huang <[email protected]>
Co-authored-by: Lee Miller <[email protected]>
Co-authored-by: Ikko Eltociear Ashimine <[email protected]>
Co-authored-by: Adrian Bonar (HE/HIM) <[email protected]>
Co-authored-by: Tao Chen <[email protected]>
Co-authored-by: Teresa Hoang <[email protected]>
Co-authored-by: Gil LaHaye <[email protected]>
Co-authored-by: Shawn Callegari <[email protected]>
Co-authored-by: Vivien Hung <[email protected]>
Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Abby Harrison <[email protected]>
Co-authored-by: Devis Lucato <[email protected]>
Co-authored-by: Gina Triolo <[email protected]>
Co-authored-by: fabio fumarola <[email protected]>
Co-authored-by: cdMSFT <[email protected]>
Co-authored-by: Dmytro Struk <[email protected]>
Co-authored-by: Lex Li <[email protected]>
Co-authored-by: Damir Dobric <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Aman Sachan <[email protected]>
Co-authored-by: Roger Barreto <[email protected]>
Co-authored-by: Stephen Toub <[email protected]>
Co-authored-by: Craig Presti <[email protected]>
Co-authored-by: Joowon <[email protected]>
Co-authored-by: Richard Edgar <[email protected]>
Co-authored-by: nacharya1 <[email protected]>
Co-authored-by: Kevdome3000 <[email protected]>
Co-authored-by: tech <[email protected]>
Co-authored-by: Masumi Morishige <[email protected]>
Co-authored-by: adityachallapally <[email protected]>
Co-authored-by: Jadyn <[email protected]>
Co-authored-by: Alex Chao <[email protected]>
Co-authored-by: Alex Chao <[email protected]>
2023-05-22 14:24:56 -07:00