Class SpeechResponse

java.lang.Object
org.springframework.ai.openai.audio.speech.SpeechResponse
All Implemented Interfaces:
org.springframework.ai.model.ModelResponse<Speech>

public class SpeechResponse extends Object implements org.springframework.ai.model.ModelResponse<Speech>
Creates a new instance of SpeechResponse with the given speech result.
Since:
1.0.0-M1
Author:
Ahmed Yousri
  • Constructor Details

    • SpeechResponse

      public SpeechResponse(Speech speech)
      Creates a new instance of SpeechResponse with the given speech result.
      Parameters:
      speech - the speech result to be set in the SpeechResponse
      See Also:
    • SpeechResponse

      public SpeechResponse(Speech speech, OpenAiAudioSpeechResponseMetadata speechResponseMetadata)
      Creates a new instance of SpeechResponse with the given speech result and speech response metadata.
      Parameters:
      speech - the speech result to be set in the SpeechResponse
      speechResponseMetadata - the speech response metadata to be set in the SpeechResponse
      See Also:
  • Method Details

    • getResult

      public Speech getResult()
      Specified by:
      getResult in interface org.springframework.ai.model.ModelResponse<Speech>
    • getResults

      public List<Speech> getResults()
      Specified by:
      getResults in interface org.springframework.ai.model.ModelResponse<Speech>
    • getMetadata

      public OpenAiAudioSpeechResponseMetadata getMetadata()
      Specified by:
      getMetadata in interface org.springframework.ai.model.ModelResponse<Speech>
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object