Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updates #30

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {

allprojects {
group = "community.flock.aigentic"
version = "0.0.7-SNAPSHOT"
version = "0.0.8-SNAPSHOT"
}

nexusPublishing {
Expand Down
13 changes: 7 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
[versions]
kotlin = "1.9.23"
kotlinx-datetime = "0.6.0-RC.2"
coroutines = "1.7.2"
kotlin = "2.1.0"
kotlinx-datetime = "0.6.1"
coroutines = "1.10.1"
serialization = "1.6.3"
ktor = "2.3.10"
ktor = "3.0.3"
nexus-publish = "2.0.0"
kotlinOpenapiBindings = "0.0.24"
kotest = "5.8.1"
mockk = "1.13.10"
openaiClient = "3.8.2"
google-cloud-functions-framework = "^3.4.0"
openaiClient = "4.0.0-beta01"
google-cloud-functions-framework = "^3.4.4"
wirespec = "0.9.23"
logback = "1.5.6"
nodejs = "20.13.1"

[libraries]
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }
Expand Down
2 changes: 1 addition & 1 deletion src/cloud/google-cloud-function/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {

kotlin {
js(IR) {
nodejs()
nodejs ()
generateTypeScriptDefinitions()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,7 @@ class AgentConfig : Config<Agent> {
systemPromptBuilder = systemPromptBuilder,
model = checkNotNull(model, builderPropertyMissingErrorMessage("model", "model()")),
task = checkNotNull(task?.build(), builderPropertyMissingErrorMessage("task", "task()")),
tools =
check(
tools.isNotEmpty(),
builderPropertyMissingErrorMessage("tools", "addTool()"),
).let { tools.associateBy { it.name } },
tools = tools.let { tools.associateBy { it.name } }.also { if (it.isEmpty()) println("Warning: No tools provided") },
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning loggen kan denk ik ook wel weg dan. Anders zie je altijd die warning terwijl je gewoon response hebt.

Misschien wel error als je beiden niet hebt?

contexts = contexts,
responseParameter = responseParameter,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,6 @@ class AgentConfigTest : DescribeSpec({
},
expectedMessage = "Cannot build Agent, property 'task' is missing, please use 'task()' to provide it",
),
MissingPropertyTestCase(
agentConfig = {
model(mockk(relaxed = true))
task("Task description") {}
},
expectedMessage = "Cannot build Agent, property 'tools' is missing, please use 'addTool()' to provide it",
),
) { testCase ->
shouldThrow<IllegalStateException> {
agent(testCase.agentConfig)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ import io.ktor.http.HttpHeaders
import io.ktor.http.HttpMethod
import io.ktor.http.contentType
import io.ktor.serialization.kotlinx.json.json
import io.ktor.util.toByteArray
import io.ktor.util.toMap
import io.ktor.utils.io.core.toByteArray
import io.ktor.utils.io.toByteArray
import kotlinx.serialization.json.Json
import kotlinx.serialization.serializer
import kotlin.reflect.KType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@ import community.flock.aigentic.gemini.mapper.toModelResponse
sealed class GeminiModelIdentifier(
override val stringValue: String,
) : ModelIdentifier {
data object Gemini2FlashExperimental : GeminiModelIdentifier("gemini-2.0-flash-exp")
data object GeminiPro : GeminiModelIdentifier("gemini-pro")
data object GeminiProVision : GeminiModelIdentifier("gemini-pro-vision")
data object Gemini1_5ProLatest : GeminiModelIdentifier("gemini-1.5-pro-latest")
data object Gemini1_5ProLatestStable : GeminiModelIdentifier("gemini-1.5-pro")
data object Gemini1_5FlashLatest : GeminiModelIdentifier("gemini-1.5-flash-latest")
data object Gemini1_5FlashLatestStable : GeminiModelIdentifier("gemini-1.5-flash")

data class Gemini_Custom_Identifier(val modelIdentifier: String) : GeminiModelIdentifier(modelIdentifier)
}

class GeminiModel(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@ import kotlin.time.Duration.Companion.seconds
sealed class OpenAIModelIdentifier(
override val stringValue: String,
) : ModelIdentifier {
data object GPTO1 : OpenAIModelIdentifier("o1")
data object GPTO1Mini : OpenAIModelIdentifier("o1-mini")
data object GPTO1Preview : OpenAIModelIdentifier("o1-preview")
data object GPT4O : OpenAIModelIdentifier("gpt-4o")
data object GPT4OLatest : OpenAIModelIdentifier("chatgpt-4o-latest")
data object GPT4OMini : OpenAIModelIdentifier("gpt-4o-mini")
data object GPT4Turbo : OpenAIModelIdentifier("gpt-4-turbo")
data object GPT3_5Turbo : OpenAIModelIdentifier("gpt-3.5-turbo")

data class GPT_Custom_Identifier(val modelIdentifier: String) : OpenAIModelIdentifier(modelIdentifier)
}

class OpenAIModel(
Expand Down
Loading