Skip to content

Commit b6d11eb

Browse files
authored
Updated dependencies and add new models
2 parents ba6abb4 + 12303f4 commit b6d11eb

106 files changed

Lines changed: 1151 additions & 1326 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ktfmt-auto.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: ktfmt-auto
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
ktfmt:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
with:
16+
ref: ${{ github.head_ref }}
17+
token: ${{ secrets.GITHUB_TOKEN }}
18+
19+
- name: Set up Java
20+
uses: actions/setup-java@v4
21+
with:
22+
distribution: temurin
23+
java-version: 17
24+
25+
- name: Download ktfmt
26+
run: |
27+
curl -sSL -o ktfmt.jar \
28+
https://github.com/facebook/ktfmt/releases/download/v0.61/ktfmt-0.61-with-dependencies.jar
29+
30+
- name: Run ktfmt
31+
run: |
32+
FILES=$(git ls-files '*.kt')
33+
java -jar ktfmt.jar --kotlinlang-style $FILES || true
34+
35+
# Commit and push changes
36+
- name: Commit and push changes
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
run: |
40+
git config --global user.name "github-actions[bot]"
41+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
42+
git add $(git ls-files '*.kt')
43+
git commit -m "chore: reformat Kotlin code with ktfmt" || echo "No changes to commit"
44+
git push origin HEAD:${{ github.head_ref }}

.github/workflows/publish.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,32 @@ jobs:
2929
with:
3030
xcode-version: latest-stable
3131

32+
- name: Build XCFramework
33+
run: |
34+
chmod 777 ./gradlew
35+
./gradlew :koog-edge:assembleKoogEdgeKitXCFramework
36+
37+
- name: Package XCFramework
38+
run: |
39+
cd koog-edge/build/XCFrameworks/release
40+
zip -r KoogEdgeKit.xcframework.zip KoogEdgeKit.xcframework
41+
swift package compute-checksum KoogEdgeKit.xcframework.zip > checksum.txt
42+
3243
- name: Publish To Maven Central
3344
env:
3445
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
3546
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
3647
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
3748
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
3849
run: |
39-
chmod 777 ./gradlew
40-
./gradlew koog-edge:publishAndReleaseToMavenCentral --no-configuration-cache
50+
./gradlew koog-edge:publishAndReleaseToMavenCentral --no-configuration-cache
51+
52+
- name: Upload XCFramework to Release
53+
uses: softprops/action-gh-release@v1
54+
if: startsWith(github.ref, 'refs/tags/')
55+
with:
56+
files: |
57+
koog-edge/build/XCFrameworks/release/KoogEdgeKit.xcframework.zip
58+
koog-edge/build/XCFrameworks/release/checksum.txt
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Package.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// swift-tools-version:5.3
2+
import PackageDescription
3+
4+
let package = Package(
5+
name: "KoogEdgeKit",
6+
platforms: [
7+
.iOS(.v14),
8+
],
9+
products: [
10+
.library(name: "KoogEdgeKit", targets: ["KoogEdgeKit"])
11+
],
12+
targets: [
13+
.binaryTarget(
14+
name: "KoogEdgeKit",
15+
url: "https://github.com/lemcoder/koog-edge/releases/download/<VERSION>/KoogEdgeKit.xcframework.zip",
16+
checksum: "<CHECKSUM>")
17+
]
18+
)
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ dependencies {
5757
implementation(libs.koog.agents)
5858
implementation(libs.leap.sdk)
5959
implementation(libs.androidx.lifecycle.viewmodel.compose)
60-
implementation(project(":koog-edge"))
60+
implementation(libs.koog.edge)
6161
implementation(libs.kotlinx.serialization.core)
6262
implementation(libs.kotlinx.serialization.json)
6363
}

app/src/main/kotlin/io/github/lemcoder/koogedge/App.kt renamed to android/src/main/kotlin/io/github/lemcoder/koogedge/App.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class App : Application() {
1313
companion object {
1414
internal lateinit var instance: App
1515
private set
16+
1617
val context: Context by lazy { instance.applicationContext }
1718
}
18-
}
19+
}

app/src/main/kotlin/io/github/lemcoder/koogedge/MainActivity.kt renamed to android/src/main/kotlin/io/github/lemcoder/koogedge/MainActivity.kt

File renamed without changes.

app/src/main/kotlin/io/github/lemcoder/koogedge/agents/calculator/CalculatorAgentProvider.kt renamed to android/src/main/kotlin/io/github/lemcoder/koogedge/agents/calculator/CalculatorAgentProvider.kt

Lines changed: 31 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ import io.github.lemcoder.koogedge.App
2020
import io.github.lemcoder.koogedge.agents.common.AgentProvider
2121
import io.github.lemcoder.koogedge.agents.common.modelsPath
2222

23-
/**
24-
* Factory for creating calculator agents (graphless strategy)
25-
*/
23+
/** Factory for creating calculator agents (graphless strategy) */
2624
internal class CalculatorAgentProvider : AgentProvider {
2725
override val title: String = "Calculator"
2826
override val description: String = "Hi, I'm a calculator agent, I can do math"
@@ -43,54 +41,46 @@ internal class CalculatorAgentProvider : AgentProvider {
4341
}
4442

4543
@Suppress("DuplicatedCode")
46-
val strategy = functionalStrategy<String, String>(title) { input ->
47-
llm.writeSession {
48-
appendPrompt {
49-
user {
50-
+"/no_think"
51-
+"pick the best tool to answer the question: $input and call it immediately."
52-
}
53-
}
54-
}
55-
56-
var response = requestLLM(input)
57-
while (response is Message.Tool.Call) {
58-
onToolCallEvent("Tool ${response.tool}")
59-
val result = executeTool(response)
60-
Log.w("CalculatorAgent", "Tool result: ${result.result}")
44+
val strategy =
45+
functionalStrategy<String, String>(title) { input ->
6146
llm.writeSession {
6247
appendPrompt {
63-
tool {
64-
result(result)
48+
user {
49+
+"/no_think"
50+
+"pick the best tool to answer the question: $input and call it immediately."
6551
}
6652
}
53+
}
6754

68-
appendPrompt {
69-
user {
70-
+"Based on the tool result, please provide only result number."
55+
var response = requestLLM(input)
56+
while (response is Message.Tool.Call) {
57+
onToolCallEvent("Tool ${response.tool}")
58+
val result = executeTool(response)
59+
Log.w("CalculatorAgent", "Tool result: ${result.result}")
60+
llm.writeSession {
61+
appendPrompt { tool { result(result) } }
62+
63+
appendPrompt {
64+
user { +"Based on the tool result, please provide only result number." }
7165
}
66+
response = requestLLM()
7267
}
73-
response = requestLLM()
7468
}
75-
}
7669

77-
val assistantContent = response.asAssistantMessage().content
78-
onAssistantMessage(assistantContent)
79-
}
70+
val assistantContent = response.asAssistantMessage().content
71+
onAssistantMessage(assistantContent)
72+
}
8073

8174
// Create agent config with proper prompt
82-
val agentConfig = AIAgentConfig(
83-
prompt = prompt(
84-
"test",
85-
params = CactusLLMParams(
86-
maxTokens = 512
87-
)
88-
) {
89-
system(calculatorSystemPrompt)
90-
},
91-
model = CactusModels.Chat.Qwen3_0_6B,
92-
maxAgentIterations = 10,
93-
)
75+
val agentConfig =
76+
AIAgentConfig(
77+
prompt =
78+
prompt("test", params = CactusLLMParams(maxTokens = 512)) {
79+
system(calculatorSystemPrompt)
80+
},
81+
model = CactusModels.Chat.Qwen3_0_6B,
82+
maxAgentIterations = 10,
83+
)
9484

9585
return AIAgent(
9686
promptExecutor = cactusExecutor,
@@ -99,4 +89,4 @@ internal class CalculatorAgentProvider : AgentProvider {
9989
toolRegistry = toolRegistry,
10090
)
10191
}
102-
}
92+
}

0 commit comments

Comments
 (0)