Skip to content

Commit d1356b2

Browse files
committed
wip
1 parent e067428 commit d1356b2

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

webui/src/main/kotlin/com/simiacryptus/skyenet/apps/general/OutlineApp.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.simiacryptus.skyenet.apps.general
22

33
import com.simiacryptus.jopenai.API
44
import com.simiacryptus.jopenai.ChatClient
5+
import com.simiacryptus.jopenai.OpenAIClient
56
import com.simiacryptus.jopenai.describe.JsonDescriber
67
import com.simiacryptus.jopenai.models.ChatModel
78
import com.simiacryptus.jopenai.models.OpenAIModels
@@ -30,6 +31,7 @@ open class OutlineApp(
3031
applicationName: String = "Outline Expansion Concept Map v1.1",
3132
val domainName: String,
3233
val settings: Settings? = null,
34+
val api2: OpenAIClient,
3335
) : ApplicationServer(
3436
applicationName = applicationName,
3537
path = "/idea_mapper",
@@ -80,6 +82,7 @@ open class OutlineApp(
8082
val settings = this.settings ?: getSettings(session, user)!!
8183
OutlineAgent(
8284
api = api,
85+
api2 = api2,
8386
dataStorage = dataStorage,
8487
session = session,
8588
user = user,
@@ -99,6 +102,7 @@ open class OutlineApp(
99102

100103
class OutlineAgent(
101104
val api: API,
105+
val api2: OpenAIClient,
102106
dataStorage: StorageInterface,
103107
session: Session,
104108
user: User?,
@@ -167,7 +171,7 @@ class OutlineAgent(
167171
val finalOutline = finalOutline(outlineManager, sessionDir)
168172

169173
if (showProjector) {
170-
showProjector(api, outlineManager, finalOutline)
174+
showProjector(api2, outlineManager, finalOutline)
171175
}
172176

173177
if (writeFinalEssay) {
@@ -193,7 +197,7 @@ class OutlineAgent(
193197
}
194198

195199
private fun showProjector(
196-
api: ChatClient,
200+
api: OpenAIClient,
197201
outlineManager: OutlineManager,
198202
finalOutline: List<OutlineManager.Node>
199203
) {

webui/src/main/kotlin/com/simiacryptus/skyenet/apps/plan/tools/online/SearchAndAnalyzeTask.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class SearchAndAnalyzeTask(
2525
class SearchAndAnalyzeTaskConfigData(
2626
@Description("The search query to use for Google search")
2727
val search_query: String = "",
28-
@Description("The number of search results to analyze (max 5)")
28+
@Description("The number of search results to analyze (max 20)")
2929
val num_results: Int = 3,
3030
@Description("The analysis goal or focus for the content")
3131
val analysis_goal: String = "",
@@ -42,7 +42,7 @@ class SearchAndAnalyzeTask(
4242
override fun promptSegment() = """
4343
SearchAndAnalyze - Search Google, fetch top results, and analyze content
4444
** Specify the search query
45-
** Specify number of results to analyze (max 5)
45+
** Specify number of results to analyze (max 20)
4646
** Specify the analysis goal or focus
4747
""".trimIndent()
4848

webui/src/main/kotlin/com/simiacryptus/skyenet/util/TensorflowProjector.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.simiacryptus.skyenet.util
22

3-
import com.simiacryptus.jopenai.API
43
import com.simiacryptus.jopenai.OpenAIClient
54
import com.simiacryptus.jopenai.models.ApiModel.EmbeddingRequest
65
import com.simiacryptus.jopenai.models.EmbeddingModels
@@ -15,7 +14,7 @@ import java.io.IOException
1514
import java.util.*
1615

1716
class TensorflowProjector(
18-
val api: API,
17+
val api: OpenAIClient,
1918
val dataStorage: StorageInterface,
2019
val sessionID: Session,
2120
val session: ApplicationInterface,
@@ -33,7 +32,7 @@ class TensorflowProjector(
3332
@Throws(IOException::class)
3433
private fun toVectorMap(vararg words: String): Map<String, DoubleArray> {
3534
val vectors = words.map { word ->
36-
word to (api as OpenAIClient).createEmbedding(
35+
word to api.createEmbedding(
3736
EmbeddingRequest(
3837
model = EmbeddingModels.AdaEmbedding.modelName,
3938
input = word.trim(),

0 commit comments

Comments
 (0)