Class SamsungAIService
Definition
- Assembly:
- Tizen.AIAvatar.dll
Samsung AI Service implementation that provides Text-to-Speech and LLM services.
public class SamsungAIService : BaseAIService, IAIService, IDisposable, ITextToSpeechService, ILLMService
- Inheritance
- Implements
-
IDisposable
Constructors
View SourceSamsungAIService(SamsungAIConfiguration)
Initializes a new instance of the SamsungAIService class with the specified configuration.
Declaration
public SamsungAIService(SamsungAIConfiguration config)
Parameters
| Type | Name | Description |
|---|---|---|
| SamsungAIConfiguration | config | The configuration for the Samsung AI Service. |
Properties
View SourceCapabilities
Gets the capabilities supported by this AI service.
Declaration
public override ServiceCapabilities Capabilities { get; }
Property Value
| Type | Description |
|---|---|
| ServiceCapabilities |
Overrides
View SourceServiceName
Gets the name of the AI service.
Declaration
public override string ServiceName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Overrides
Methods
View SourceDispose(bool)
Releases all resources used by the AI service.
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing |
Overrides
View SourceGenerateTextAsync(string, Dictionary<string, object>)
Generates a response from the LLM service asynchronously.
Declaration
public Task GenerateTextAsync(string message, Dictionary<string, object> options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | message | The input message to be processed by the LLM. |
| Dictionary<, ><string, object> | options | Optional parameters for customizing the LLM output. |
Returns
| Type | Description |
|---|---|
| Task | A task representing the asynchronous operation. |
TextToSpeechAsync(string, string, Dictionary<string, object>)
Converts the given text to speech asynchronously and returns the audio data.
Declaration
public Task<byte[]> TextToSpeechAsync(string text, string voice = null, Dictionary<string, object> options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text | The text to be converted to speech. |
| string | voice | Optional parameter to specify the voice type. |
| Dictionary<, ><string, object> | options | Optional parameters for customizing speech output. |
Returns
| Type | Description |
|---|---|
| Task<><byte[]> | A task representing the asynchronous operation, with a byte array of the generated audio data. |
TextToSpeechStreamAsync(string, string, Dictionary<string, object>)
Streams the given text as speech asynchronously.
Declaration
public Task TextToSpeechStreamAsync(string text, string voice, Dictionary<string, object> options)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text | The text to be converted to speech. |
| string | voice | The voice type to be used for the speech. |
| Dictionary<, ><string, object> | options | Optional parameters for customizing speech output. |
Returns
| Type | Description |
|---|---|
| Task | A task representing the asynchronous operation. |
Events
View SourceOnTtsFinish
Occurs when the Text-to-Speech service finishes processing.
Declaration
public event EventHandler<ttsStreamingEventArgs> OnTtsFinish
Event Type
| Type | Description |
|---|---|
| EventHandler<><ttsStreamingEventArgs> |
OnTtsReceiving
Occurs when the Text-to-Speech service is receiving data.
Declaration
public event EventHandler<ttsStreamingEventArgs> OnTtsReceiving
Event Type
| Type | Description |
|---|---|
| EventHandler<><ttsStreamingEventArgs> |
OnTtsStart
Occurs when the Text-to-Speech service starts processing.
Declaration
public event EventHandler<ttsStreamingEventArgs> OnTtsStart
Event Type
| Type | Description |
|---|---|
| EventHandler<><ttsStreamingEventArgs> |
ResponseHandler
Occurs when a response is generated by the LLM service.
Declaration
public event EventHandler<llmResponseEventArgs> ResponseHandler
Event Type
| Type | Description |
|---|---|
| EventHandler<><llmResponseEventArgs> |