Skip to content

Commit

Permalink
refactor: rename
Browse files Browse the repository at this point in the history
  • Loading branch information
BFergerson committed Sep 25, 2024
1 parent c565e64 commit b21a6f7
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class ToggleEditModeTool : VoqalTool() {

if (prompt != null) {
log.debug("Entering edit mode with directive: $prompt")
val editDirective = project.service<VoqalDirectiveService>().asDirective(
val editDirective = project.service<VoqalDirectiveService>().createDirective(
transcription = SpokenTranscript(prompt, directive.assistant.speechId),
textOnly = directive.developer.textOnly,
usingAudioModality = directive.assistant.usingAudioModality,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class ToggleSearchModeTool : VoqalTool() {

if (prompt != null) {
log.debug("Entering edit mode with directive: $prompt")
val editDirective = project.service<VoqalDirectiveService>().asDirective(
val editDirective = project.service<VoqalDirectiveService>().createDirective(
transcription = SpokenTranscript(prompt, directive.assistant.speechId),
textOnly = directive.developer.textOnly,
usingAudioModality = directive.assistant.usingAudioModality,
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/dev/voqal/ide/actions/ViewPromptAction.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ViewPromptAction : AnAction() {
val toolService = project.service<VoqalToolService>()
val promptName = configService.getCurrentPromptMode()
var nopDirective = project.service<VoqalDirectiveService>()
.asDirective(SpokenTranscript("n/a", null), promptName = promptName)
.createDirective(SpokenTranscript("n/a", null), promptName = promptName)
nopDirective = nopDirective.copy(
assistant = nopDirective.assistant.copy(
availableActions = toolService.getAvailableTools().values
Expand Down
8 changes: 4 additions & 4 deletions src/main/kotlin/dev/voqal/services/VoqalDirectiveService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class VoqalDirectiveService(private val project: Project) {
//send transcription to LLM
val currentStatus = project.service<VoqalStatusService>().getStatus()
if (currentStatus == IDLE) {
val directive = asDirective(
val directive = createDirective(
transcription = spokenTranscript,
textOnly = textOnly,
usingAudioModality = usingAudioModality,
Expand All @@ -174,7 +174,7 @@ class VoqalDirectiveService(private val project: Project) {
)
executeDirective(directive)
} else if (currentStatus == EDITING) {
val directive = asDirective(
val directive = createDirective(
transcription = spokenTranscript,
textOnly = textOnly,
usingAudioModality = usingAudioModality,
Expand All @@ -183,7 +183,7 @@ class VoqalDirectiveService(private val project: Project) {
)
executeDirective(directive)
} else if (currentStatus == SEARCHING) {
val directive = asDirective(
val directive = createDirective(
transcription = spokenTranscript,
textOnly = textOnly,
usingAudioModality = usingAudioModality,
Expand Down Expand Up @@ -218,7 +218,7 @@ class VoqalDirectiveService(private val project: Project) {
return activeDirectives.isNotEmpty()
}

fun asDirective(
fun createDirective(
transcription: SpokenTranscript,
textOnly: Boolean = false,
usingAudioModality: Boolean = false,
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/dev/voqal/services/VoqalToolService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class VoqalToolService(private val project: Project) {

private suspend fun executeIntent(args: Map<String, Any>, intentAction: VoqalTool) {
val directive = project.service<VoqalDirectiveService>()
.asDirective(SpokenTranscript("", null), true) //todo: memory/speech id
.createDirective(SpokenTranscript("", null), true) //todo: memory/speech id
intentAction.actionPerformed(JsonObject.mapFrom(args), directive)
}

Expand Down Expand Up @@ -244,7 +244,7 @@ class VoqalToolService(private val project: Project) {
val canShortcutDirective = isDirective && action.canShortcut(project, functionCall)
if (isDirective && !canShortcutDirective) {
var childDirective = project.service<VoqalDirectiveService>()
.asDirective(SpokenTranscript(args.getString("directive"), null), true)
.createDirective(SpokenTranscript(args.getString("directive"), null), true)
childDirective = childDirective.copy(
assistant = childDirective.assistant.copy(
directiveMode = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class MoveClassToolTest : JBTest() {
val directiveService = project.service<VoqalDirectiveService>()
val transcription = "move class com.example.Test to com.test2"
project.scope.launch {
val directive = directiveService.asDirective(
val directive = directiveService.createDirective(
SpokenTranscript(transcription, null),
textOnly = true
)
Expand Down

0 comments on commit b21a6f7

Please sign in to comment.