SDK Reference · Type
STResourceCategory
Identifies a resource category whose local base URL can be configured using STConversationRunner.setResourceLocation.
Overview
Use this category when assigning a local resource folder to the conversation runtime. It distinguishes conversation resources from audio playback resources so the runner can resolve each resource relative to the appropriate location. Configure the category before loading resources that depend on it.
public enum STResourceCategory: String, Sendable {
case playAudio
case playText
case recordAudio
case speechRecognition
case speechUtterance
case speechSynthesis
case conversation
}
Cases
| Case | Resource family |
|---|---|
playAudio |
Recorded audio used for playback. |
playText |
Text resources used for playback/synthesis. |
recordAudio |
Audio-recording resources/output location. |
speechRecognition |
Speech-recognition resources. |
speechUtterance |
Speech-utterance resources. |
speechSynthesis |
Speech-synthesis resources. |
conversation |
Conversation-definition resources. |
STConversationRunner.setResourceLocation(_:localURL:) validates the supplied local URL and reports an STResult when the location is invalid.
Because STResourceCategory has String raw values, its public case names are also its raw string values.
Purpose and usage
Select the resource category when calling STConversationRunner.setResourceLocation.
Cases
.playAudio— Play audio option..playText— Play text option..recordAudio— Record audio option..speechRecognition— Speech recognition option..speechUtterance— Speech utterance option..speechSynthesis— Speech synthesis option..conversation— Conversation option.
Swift example
// Configure the local folder containing conversation resources.
// `runner` is an initialized STConversationRunner instance.
let conversationFolder = Bundle.main.resourceURL!
.appendingPathComponent("Conversations", isDirectory: true)
let result = runner.setResourceLocation(
.conversation,
localURL: conversationFolder
)
// Check `result` before loading conversation resources.
Where this type is used
- setresourcelocation — STConversationRunner