Skip to content

Commit

Permalink
Java: Fix OpenAPI importer not being able to match parameters, and re…
Browse files Browse the repository at this point in the history
…moving… (#6438)

… crlf from prompts

### 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 the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
  • Loading branch information
johnoliver committed May 30, 2024
1 parent 8ac9256 commit 7e28bb0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions java/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 1.1.5

- Fix bug with removing new lines on function parameters on Windows
- Fix bug forming serializing arguments to tool calls

# 1.1.3

- Fix bug appending plugin name to tool calls
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ private static String getSchemaForFunctionParameter(@Nullable InputVariable para
if (parameter != null && parameter.getDescription() != null && !parameter.getDescription()
.isEmpty()) {
String description = parameter.getDescription();
description = description.replace("\n", "");
description = description.replaceAll("\\r?\\n|\\r", "");
description = description.replace("\"", "\\\"");

description = String.format("\"description\":\"%s\"", description);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ private Stream<Parameter> getParameterStreamOfArguments(
.getGet()
.getParameters()
.stream()
.filter(param -> param.getName().equals(contextVariable)).findFirst())
.filter(param -> param.getName().equalsIgnoreCase(contextVariable)).findFirst())
.filter(Optional::isPresent)
.map(Optional::get);
}
Expand Down

0 comments on commit 7e28bb0

Please sign in to comment.