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
1 change: 1 addition & 0 deletions sdk/openai/azure-ai-openai/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
Use `getAudioTranscription` or `getAudioTranscriptionWithResponse` convenience methods from respective classes.
- Removed methods `getAudioTranslationAsResponseObject` and `getAudioTranslationAsResponseObjectWithResponse` from `OpenAIClient` and `OpenAIAsyncClient` classes.
Use `getAudioTranslation` or `getAudioTranslationWithResponse` convenience methods from respective classes.
- Removed property, ResponseError `error` from `ImageLocation` class.

### Bugs Fixed

Expand Down
12 changes: 3 additions & 9 deletions sdk/openai/azure-ai-openai/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,15 +276,9 @@ ImageGenerationOptions imageGenerationOptions = new ImageGenerationOptions(
ImageResponse images = client.getImages(imageGenerationOptions);

for (ImageLocation imageLocation : images.getData()) {
ResponseError error = imageLocation.getError();
if (error != null) {
System.out.printf("Image generation operation failed. Error code: %s, error message: %s.%n",
error.getCode(), error.getMessage());
} else {
System.out.printf(
"Image location URL that provides temporary access to download the generated image is %s.%n",
imageLocation.getUrl());
}
System.out.printf(
"Image location URL that provides temporary access to download the generated image is %s.%n",
imageLocation.getUrl());
}
```

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_a191d5c4de"
"Tag": "java/openai/azure-ai-openai_d62b613ecd"
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
// 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.implementation.models;

import com.azure.ai.openai.models.AzureOpenAIOperationState;
import com.azure.core.annotation.Generated;
import com.azure.core.annotation.Immutable;
import com.azure.core.models.ResponseError;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.Instant;
import java.time.OffsetDateTime;
import java.time.ZoneOffset;

/** A polling status update or final response payload for an image operation. */
@Immutable
public final class BatchImageGenerationOperationResponse {

/*
* The ID of the operation.
*/
@Generated
@JsonProperty(value = "id")
private String id;

/*
* A timestamp when this job or item was created (in unix epochs).
*/
@Generated
@JsonProperty(value = "created")
private long createdAt;

/*
* A timestamp when this operation and its associated images expire and will be deleted (in unix epochs).
*/
@Generated
@JsonProperty(value = "expires")
private Long expires;

/*
* The result of the operation if the operation succeeded.
*/
@Generated
@JsonProperty(value = "result")
private ImageGenerations result;

/*
* The status of the operation
*/
@Generated
@JsonProperty(value = "status")
private AzureOpenAIOperationState status;

/*
* The error if the operation failed.
*/
@Generated
@JsonProperty(value = "error")
private ResponseError error;

/**
* Creates an instance of BatchImageGenerationOperationResponse class.
*
* @param id the id value to set.
* @param createdAt the createdAt value to set.
* @param status the status value to set.
*/
@Generated
private BatchImageGenerationOperationResponse(
String id, OffsetDateTime createdAt, AzureOpenAIOperationState status) {
this.id = id;
this.createdAt = createdAt.toEpochSecond();
this.status = status;
}

@Generated
@JsonCreator
private BatchImageGenerationOperationResponse(
@JsonProperty(value = "id") String id,
@JsonProperty(value = "created") long createdAt,
@JsonProperty(value = "status") AzureOpenAIOperationState status) {
this(id, OffsetDateTime.ofInstant(Instant.ofEpochSecond(createdAt), ZoneOffset.UTC), status);
}

/**
* Get the id property: The ID of the operation.
*
* @return the id value.
*/
@Generated
public String getId() {
return this.id;
}

/**
* Get the createdAt property: A timestamp when this job or item was created (in unix epochs).
*
* @return the createdAt value.
*/
@Generated
public OffsetDateTime getCreatedAt() {
return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.createdAt), ZoneOffset.UTC);
}

/**
* Get the expires property: A timestamp when this operation and its associated images expire and will be deleted
* (in unix epochs).
*
* @return the expires value.
*/
@Generated
public Long getExpires() {
return this.expires;
}

/**
* Get the result property: The result of the operation if the operation succeeded.
*
* @return the result value.
*/
@Generated
public ImageGenerations getResult() {
return this.result;
}

/**
* Get the status property: The status of the operation.
*
* @return the status value.
*/
@Generated
public AzureOpenAIOperationState getStatus() {
return this.status;
}

/**
* Get the error property: The error if the operation failed.
*
* @return the error value.
*/
@Generated
public ResponseError getError() {
return this.error;
}
}
Loading