Skip to content

Commit

Permalink
Merge pull request #288 from milderhc/upgrade-azure-ai-openai
Browse files Browse the repository at this point in the history
Upgrade azure-ai-openai to 1.0.0-beta.14
  • Loading branch information
johnoliver authored Feb 25, 2025
2 parents 8936cc1 + 7bb6883 commit 823e5aa
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 1.4.3

- Bug fix for execution on Android (https://github.com/microsoft/semantic-kernel-java/pull/284)
- Upgrade to azure-ai-openai 1.0.0-beta.14

# 1.4.2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ private ChatCompletionService getChatCompletionService() {

public static MappingBuilder buildTextResponse(String bodyMatcher, String responseBody) {
return post(urlEqualTo(
"//openai/deployments/gpt-35-turbo-2/completions?api-version=2024-08-01-preview"))
"//openai/deployments/gpt-35-turbo-2/completions?api-version=2025-01-01-preview"))
.withRequestBody(new ContainsPattern(bodyMatcher))
.willReturn(
aResponse()
Expand All @@ -293,7 +293,7 @@ public static MappingBuilder buildTextResponse(String bodyMatcher, String respon

public static MappingBuilder buildResponse(String bodyMatcher, String responseBody) {
return post(urlEqualTo(
"//openai/deployments/gpt-35-turbo-2/chat/completions?api-version=2024-08-01-preview"))
"//openai/deployments/gpt-35-turbo-2/chat/completions?api-version=2025-01-01-preview"))
.withRequestBody(new ContainsPattern(bodyMatcher))
.willReturn(
aResponse()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"priority": 1,
"request": {
"method": "POST",
"url": "//openai/deployments/gpt-35-turbo-2/chat/completions?api-version=2024-08-01-preview",
"url": "//openai/deployments/gpt-35-turbo-2/chat/completions?api-version=2025-01-01-preview",
"bodyPatterns": [
{
"contains": "That is all"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"request": {
"method": "POST",
"url": "//openai/deployments/gpt-35-turbo-2/chat/completions?api-version=2024-08-01-preview"
"url": "//openai/deployments/gpt-35-turbo-2/chat/completions?api-version=2025-01-01-preview"
},
"response": {
"body": "{\"id\":\"chatcmpl-xxx\",\"object\":\"chat.completion\",\"created\":1707253061,\"model\":\"gpt-35-turbo\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"1979b4ce-5463-4cfb-8ec8-1d05c4b44ccf\"},\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":17,\"completion_tokens\":67,\"total_tokens\":84}}",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"request": {
"method": "POST",
"url": "//openai/deployments/gpt-35-turbo/chat/completions?api-version=2024-08-01-preview"
"url": "//openai/deployments/gpt-35-turbo/chat/completions?api-version=2025-01-01-preview"
},
"response": {
"body": "{\"id\":\"chatcmpl-xxx\",\"object\":\"chat.completion\",\"created\":1707253039,\"model\":\"gpt-35-turbo\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"ac9817bc-7e1a-48e4-b06c-0ff7618b88c6\"},\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":26,\"completion_tokens\":131,\"total_tokens\":157}}",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"request": {
"method": "POST",
"url": "//openai/deployments/text-davinci-003/completions?api-version=2024-08-01-preview"
"url": "//openai/deployments/text-davinci-003/completions?api-version=2025-01-01-preview"
},
"response": {
"body": "{\"id\":\"cmpl-xxx\",\"object\":\"text_completion\",\"created\":1707253062,\"model\":\"text-davinci-003\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"choices\":[{\"text\":\"7949e981-c632-422f-9b76-335a2379cd83\",\"index\":0,\"finish_reason\":\"stop\",\"logprobs\":null,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"usage\":{\"prompt_tokens\":10,\"completion_tokens\":26,\"total_tokens\":36}}",
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<description>Parent pom for the Semantic Kernel Project</description>

<properties>
<azure-ai-openai.version>1.0.0-beta.12</azure-ai-openai.version>
<azure-ai-openai.version>1.0.0-beta.14</azure-ai-openai.version>
<checkstyle.version>10.18.2</checkstyle.version>
<com.uber.nullaway.version>0.10.21</com.uber.nullaway.version>
<compilingJdk8>false</compilingJdk8>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ interface PreChatCompletionHook extends KernelHook<PreChatCompletionEvent> {
static ChatCompletionsOptions cloneOptionsWithMessages(
ChatCompletionsOptions options,
List<ChatRequestMessage> messages) {

ChatCompletionsOptions newOptions = new ChatCompletionsOptions(messages)
.setPresencePenalty(options.getPresencePenalty())
.setFrequencyPenalty(options.getFrequencyPenalty())
Expand All @@ -114,8 +115,7 @@ static ChatCompletionsOptions cloneOptionsWithMessages(
.setFunctions(options.getFunctions())
.setN(options.getN())
.setResponseFormat(options.getResponseFormat())
.setSeed(options.getSeed())
.setStream(options.isStream());
.setSeed(options.getSeed());

if (options.getToolChoice() != null) {
newOptions.setToolChoice(options.getToolChoice());
Expand Down
2 changes: 1 addition & 1 deletion semantickernel-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-ai-openai</artifactId>
<version>1.0.0-beta.12</version>
<version>1.0.0-beta.14</version>
</dependency>
<dependency>
<groupId>com.azure</groupId>
Expand Down

0 comments on commit 823e5aa

Please sign in to comment.