Skip to content

[AutoPR azure-ai-openai] [TypeSpec] Upgrade to 0.50.0 #8449

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// 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.core.annotation.Generated;
import com.azure.core.util.ExpandableStringEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.Collection;

/** Defines the possible descriptors for available audio operation responses. */
public final class AudioTaskLabel extends ExpandableStringEnum<AudioTaskLabel> {
/** Accompanying response data resulted from an audio transcription task. */
@Generated public static final AudioTaskLabel TRANSCRIBE = fromString("transcribe");

/** Accompanying response data resulted from an audio translation task. */
@Generated public static final AudioTaskLabel TRANSLATE = fromString("translate");

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

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

/**
* Gets known AudioTaskLabel values.
*
* @return known AudioTaskLabel values.
*/
@Generated
public static Collection<AudioTaskLabel> values() {
return values(AudioTaskLabel.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
// 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.core.annotation.Generated;
import com.azure.core.annotation.Immutable;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.Duration;
import java.util.List;

/** Result information for an operation that transcribed spoken audio into written text. */
@Immutable
public final class AudioTranscription {
/*
* The transcribed text for the provided audio data.
*/
@Generated
@JsonProperty(value = "text")
private String text;

/*
* The label that describes which operation type generated the accompanying response data.
*/
@Generated
@JsonProperty(value = "task")
private AudioTaskLabel task;

/*
* The spoken language that was detected in the transcribed audio data.
* This is expressed as a two-letter ISO-639-1 language code like 'en' or 'fr'.
*/
@Generated
@JsonProperty(value = "language")
private String language;

/*
* The total duration of the audio processed to produce accompanying transcription information.
*/
@Generated
@JsonProperty(value = "duration")
private Double duration;

/*
* A collection of information about the timing, probabilities, and other detail of each processed audio segment.
*/
@Generated
@JsonProperty(value = "segments")
private List<AudioTranscriptionSegment> segments;

/**
* Creates an instance of AudioTranscription class.
*
* @param text the text value to set.
*/
@Generated
@JsonCreator
private AudioTranscription(@JsonProperty(value = "text") String text) {
this.text = text;
}

/**
* Get the text property: The transcribed text for the provided audio data.
*
* @return the text value.
*/
@Generated
public String getText() {
return this.text;
}

/**
* Get the task property: The label that describes which operation type generated the accompanying response data.
*
* @return the task value.
*/
@Generated
public AudioTaskLabel getTask() {
return this.task;
}

/**
* Get the language property: The spoken language that was detected in the transcribed audio data. This is expressed
* as a two-letter ISO-639-1 language code like 'en' or 'fr'.
*
* @return the language value.
*/
@Generated
public String getLanguage() {
return this.language;
}

/**
* Get the duration property: The total duration of the audio processed to produce accompanying transcription
* information.
*
* @return the duration value.
*/
@Generated
public Duration getDuration() {
if (this.duration == null) {
return null;
}
return Duration.ofNanos((long) (this.duration * 1000_000_000L));
}

/**
* Get the segments property: A collection of information about the timing, probabilities, and other detail of each
* processed audio segment.
*
* @return the segments value.
*/
@Generated
public List<AudioTranscriptionSegment> getSegments() {
return this.segments;
}
}
Loading