Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,9 @@
"reimaging",
"Remediations",
"requireReleaseDeps",
"rerank",
"Rerank",
"RERANK",
"resourcemanager",
"Retriable",
"revapi",
Expand Down
53 changes: 43 additions & 10 deletions sdk/openai/azure-ai-openai/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,60 @@

### Features Added

- Added support for service API version, `2024-04-01-preview`.
- Added support for service API versions, `2024-04-01-preview` and `2024-05-01-preview`.
- Note that `AOAI` refers to Azure OpenAI and `OAI` refers to OpenAI.

**Audio**

- Added timestamp granularity to Whisper transcription; this is an array of enumerated string values
- Added timestamp granularity to Whisper transcription; this is an array of enumerated string values
(word and/or segment) that controls which, if any, timestamp information is emitted to transcription results.
- `AudioTranscriptionTimestampGranularity` enum to represent the timestamp granularity options for Whisper transcription.
- `AudioTranscriptionWord` class to represent the word timestamp information in the transcription results.
- Added two new audio formats, 'wav' and 'pcm', to the `SpeechGenerationResponseFormat` enum.

**Chat**

- [AOAI] Added a new property `indirectAttack` in `ContentFilterResultDetailsForPrompt` class to represent the indirect attack results.
- Added two new audio formats, `wav` and `pcm`, to the `SpeechGenerationResponseFormat` enum.

*AOAI ONLY*

- Added a new RAI content filter schema type, `ContentFilterDetailedResults`, that features:
- The boolean `filtered` property from `ContentFilterResult`.
- An array named `details` of the existing `ContentFilterBlocklistIdResult` type, each of which has:
- The base boolean `filtered`
- A string `id`
- Added a new property `indirectAttack` in `ContentFilterResultDetailsForPrompt` class to represent the indirect attack results.
- Added a new property `custom_blocklists` in `ImageGenerationPromptFilterResults` class to represent the prompt filter results.

**On Your Data**

- New string enum type used in options: `OnYourDataContextProperty`: "citations" | "intent" | "allRetrievedDocuments"
- This is used in arrays like a bitmasked flag; "give me citations and documents" == `[ "citations", "allRetrievedDocuments" ]`
- It's not dissimilar to how transcription uses `timestamp_granularities[]`
- New model type used in response extensions: `retrievedDocument`
- Inherits from existing `citation`
- Required properties: `content` (string, inherited), `search_queries` (array of strings), `data_source_index` (int32), `original_search_score` (double)
- Optional properties: `title`, `url`, `filepath`, `chunk_id` (all strings inherited from `citation`); `re_rank_score` (double)
- New options fields for chat extension parameters (request options):
- `max_search_queries` (optional int32)
- `allow_partial_result` (optional boolean)
- `include_contexts` (optional array of the above `OnYourDataContextProperty` enum (effective flag selection))
- Affected `*parameters` types:
- `AzureSearchChatExtensionParameters`
- `AzureMachineLearningIndexChatExtensionParameters`
- `AzureCosmosDBChatExtensionParameters`
- `ElasticsearchChatExtensionParameters`
- `PineconeChatExtensionParameters`
- Vectorization source types have a new `dimensions` property (optional int32)
- Affected: `OnYourDataEndpointVectorizationSource`, `OnYourDataDeploymentNameVectorizationSource`
- `AzureSearchChatExtensionParameters` now supports `OnYourDataAccessTokenAuthenticationOptions` in its named `authentication` field
- `OnYourDataEndpointVectorizationSource` now supports `OnYourDataAccessTokenAuthenticationOptions` for its named `authentication` field.
- Added new class `OnYourDataVectorSearchAuthenticationType`, `OnYourDataVectorSearchAuthenticationOptions`,
`OnYourDataVectorSearchApiKeyAuthenticationOptions`, `OnYourDataVectorSearchAccessTokenAuthenticationOptions` for the
vector search authentication options.
- The response extension type `AzureChatExtensionsMessageContext` has a new `all_retrieved_documents` field, which is an optional array of the new `retrievedDocument` type defined earlier.

### Breaking Changes

- Replaced Jackson Databind annotations with `azure-json` functionality for OpenAI service models.
- [AOAI] Added a new class `ContentFilterDetailedResults` to represent detailed content filter results, which replaces the
`customBlocklists` response property type, `List<ContentFilterBlocklistIdResult>` in
`ContentFilterResultDetailsForPrompt` and `ContentFilterResultsForChoice` class.
- [AOAI] Replaced `OnYourDataAuthenticationOptions` with `OnYourDataVectorSearchAuthenticationOptions` in the `OnYourDataEndpointVectorizationSource` class.
Currently, `OnYourDataEndpointVectorizationSource` only supports `OnYourDataApiKeyAuthenticationOptions` and `OnYourDataAccessTokenAuthenticationOptions` as authentication options.

### Bugs Fixed

Expand Down
2 changes: 1 addition & 1 deletion sdk/openai/azure-ai-openai/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "java",
"TagPrefix": "java/openai/azure-ai-openai",
"Tag": "java/openai/azure-ai-openai_589fab4377"
"Tag": "java/openai/azure-ai-openai_959f9440df"
}
2 changes: 2 additions & 0 deletions sdk/openai/azure-ai-openai/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
</developers>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.min.linecoverage>0.30</jacoco.min.linecoverage>
<jacoco.min.branchcoverage>0.30</jacoco.min.branchcoverage>
<!-- Configures the Java 9+ run to perform the required module exports, opens, and reads that are necessary for testing but shouldn't be part of the module-info. -->
<javaModulesSurefireArgLine>
--add-exports com.azure.core/com.azure.core.implementation.http=ALL-UNNAMED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ public enum OpenAIServiceVersion implements ServiceVersion {
/**
* Enum value 2024-04-01-preview.
*/
V2024_04_01_PREVIEW("2024-04-01-preview");
V2024_04_01_PREVIEW("2024-04-01-preview"),

/**
* Enum value 2024-05-01-preview.
*/
V2024_05_01_PREVIEW("2024-05-01-preview");

private final String version;

Expand All @@ -65,6 +70,6 @@ public String getVersion() {
* @return The latest {@link OpenAIServiceVersion}.
*/
public static OpenAIServiceVersion getLatest() {
return V2024_04_01_PREVIEW;
return V2024_05_01_PREVIEW;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,22 @@ public Response<BinaryData> getCompletionsWithResponse(String deploymentOrModelN
* }
* ]
* intent: String (Optional)
* all_retrieved_documents (Optional): [
* (Optional){
* content: String (Required)
* title: String (Optional)
* url: String (Optional)
* filepath: String (Optional)
* chunk_id: String (Optional)
* search_queries (Required): [
* String (Required)
* ]
* data_source_index: int (Required)
* original_search_score: Double (Optional)
* rerank_score: Double (Optional)
* filter_reason: String(score/rerank) (Optional)
* }
* ]
* }
* }
* logprobs (Required): {
Expand Down Expand Up @@ -1328,6 +1344,22 @@ public Mono<Response<BinaryData>> getChatCompletionsWithResponseAsync(String dep
* }
* ]
* intent: String (Optional)
* all_retrieved_documents (Optional): [
* (Optional){
* content: String (Required)
* title: String (Optional)
* url: String (Optional)
* filepath: String (Optional)
* chunk_id: String (Optional)
* search_queries (Required): [
* String (Required)
* ]
* data_source_index: int (Required)
* original_search_score: Double (Optional)
* rerank_score: Double (Optional)
* filter_reason: String(score/rerank) (Optional)
* }
* ]
* }
* }
* logprobs (Required): {
Expand Down Expand Up @@ -1515,6 +1547,15 @@ public Response<BinaryData> getChatCompletionsWithResponse(String deploymentOrMo
* detected: boolean (Required)
* }
* jailbreak (Optional): (recursive schema, see jailbreak above)
* custom_blocklists (Optional): {
* filtered: boolean (Required)
* details (Required): [
* (Required){
* filtered: boolean (Required)
* id: String (Required)
* }
* ]
* }
* }
* }
* ]
Expand Down Expand Up @@ -1587,6 +1628,15 @@ public Mono<Response<BinaryData>> getImageGenerationsWithResponseAsync(String de
* detected: boolean (Required)
* }
* jailbreak (Optional): (recursive schema, see jailbreak above)
* custom_blocklists (Optional): {
* filtered: boolean (Required)
* details (Required): [
* (Required){
* filtered: boolean (Required)
* id: String (Required)
* }
* ]
* }
* }
* }
* ]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.ai.openai.models;

import com.azure.core.annotation.Generated;
import com.azure.core.util.ExpandableStringEnum;
import java.util.Collection;

/**
* The reason for filtering the retrieved document.
*/
public final class AzureChatExtensionRetrieveDocumentFilterReason
extends ExpandableStringEnum<AzureChatExtensionRetrieveDocumentFilterReason> {

/**
* The document is filtered by original search score threshold defined by `strictness` configure.
*/
@Generated
public static final AzureChatExtensionRetrieveDocumentFilterReason SCORE = fromString("score");

/**
* The document is not filtered by original search score threshold, but is filtered by rerank score and
* `top_n_documents` configure.
*/
@Generated
public static final AzureChatExtensionRetrieveDocumentFilterReason RERANK = fromString("rerank");

/**
* Creates a new instance of AzureChatExtensionRetrieveDocumentFilterReason value.
*
* @deprecated Use the {@link #fromString(String)} factory method.
*/
@Generated
@Deprecated
public AzureChatExtensionRetrieveDocumentFilterReason() {
}

/**
* Creates or finds a AzureChatExtensionRetrieveDocumentFilterReason from its string representation.
*
* @param name a name to look for.
* @return the corresponding AzureChatExtensionRetrieveDocumentFilterReason.
*/
@Generated
public static AzureChatExtensionRetrieveDocumentFilterReason fromString(String name) {
return fromString(name, AzureChatExtensionRetrieveDocumentFilterReason.class);
}

/**
* Gets known AzureChatExtensionRetrieveDocumentFilterReason values.
*
* @return known AzureChatExtensionRetrieveDocumentFilterReason values.
*/
@Generated
public static Collection<AzureChatExtensionRetrieveDocumentFilterReason> values() {
return values(AzureChatExtensionRetrieveDocumentFilterReason.class);
}
}
Loading