Skip to content

Commit

Permalink
feat: add project info to projecT
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Apr 16, 2023
1 parent 4af1a1c commit fa255e0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/main/kotlin/cc/unitmesh/devti/DevtiFlow.kt
Expand Up @@ -9,11 +9,12 @@ class DevtiFlow(
private val devtiFlowAction: DevtiFlowAction
) {
fun start(id: String) {
val project = kanban.getProjectInfo()
val story = kanban.getStoryById(id)

var storyDetail = story.description
if (!kanban.isValidStory(storyDetail)) {
storyDetail = devtiFlowAction.fillStoryDetail(story.description)
storyDetail = devtiFlowAction.fillStoryDetail(project, story.description)
val newStory = SimpleStory(story.id, story.title, storyDetail)
kanban.updateStoryDetail(newStory)
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/kotlin/cc/unitmesh/devti/prompt/DevtiFlowAction.kt
@@ -1,5 +1,7 @@
package cc.unitmesh.devti.prompt

import cc.unitmesh.devti.kanban.SimpleProjectInfo

interface DevtiFlowAction {
fun fillStoryDetail(story: String): String
fun fillStoryDetail(project: SimpleProjectInfo, story: String): String
}
@@ -1,5 +1,6 @@
package cc.unitmesh.devti.prompt.openai

import cc.unitmesh.devti.kanban.SimpleProjectInfo
import cc.unitmesh.devti.prompt.AiAction
import cc.unitmesh.devti.prompt.DevtiFlowAction
import com.aallam.openai.api.BetaOpenAI
Expand Down Expand Up @@ -30,7 +31,7 @@ class OpenAIAction(val openAIKey: String, val version: String) : AiAction, Devti
return completion.choices.first().message?.content ?: ""
}

override fun fillStoryDetail(story: String): String {
override fun fillStoryDetail(project: SimpleProjectInfo, story: String): String {
return ""
}
}

0 comments on commit fa255e0

Please sign in to comment.