Skip to content

Commit

Permalink
feat(chat): add prompt method to inline chat service #157
Browse files Browse the repository at this point in the history
Introduce a new `prompt` method in `ShireInlineChatService` to handle input processing. This method is now used in `ShireInlineChatPanel` to generate the prompt for the LLM provider.
  • Loading branch information
phodal committed Jan 2, 2025
1 parent 7485a88 commit ab09b82
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ class ShireInlineChatPanel(val editor: Editor) : JPanel(GridBagLayout()), Editor
this.centerPanel.isVisible = true
val project = editor.project!!

val flow: Flow<String>? = LlmProvider.provider(project)?.stream(input, "", false)
val prompt = ShireInlineChatService.getInstance().prompt(input)
val flow: Flow<String>? = LlmProvider.provider(project)?.stream(prompt, "", false)

val panelView = ShirePanelView(project, showInput = false)
panelView.minimumSize = Dimension(800, 40)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ class ShireInlineChatService : Disposable {
allChats.remove(editor.virtualFile.url)
}

fun prompt(input: String): String {
// todo: call our service to get action prompt
return input
}

companion object {
fun getInstance(): ShireInlineChatService {
return ApplicationManager.getApplication().getService(ShireInlineChatService::class.java)
Expand Down

0 comments on commit ab09b82

Please sign in to comment.