Skip to content

Commit

Permalink
fix: fix default timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Apr 21, 2023
1 parent d5c70f6 commit 9746266
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ import com.theokanning.openai.completion.chat.ChatMessage
import com.theokanning.openai.completion.chat.ChatMessageRole
import com.theokanning.openai.service.OpenAiService
import kotlinx.coroutines.runBlocking
import java.time.Duration


class OpenCodeCopilot(val openAIKey: String, val version: String) : CodeCopilot, DevtiFlowAction {
private val promptGenerator = PromptGenerator()
var service: OpenAiService = OpenAiService(openAIKey)
var service: OpenAiService = OpenAiService(openAIKey, Duration.ofSeconds(300))

private fun prompt(instruction: String): String {
val messages: MutableList<ChatMessage> = ArrayList()
Expand All @@ -30,7 +31,6 @@ class OpenCodeCopilot(val openAIKey: String, val version: String) : CodeCopilot,
.messages(messages)
.build()


val completion = service.createChatCompletion(completionRequest)
val output = completion
.choices[0].message.content
Expand Down

0 comments on commit 9746266

Please sign in to comment.