Skip to content

Commit

Permalink
refactor ktor
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcheng1982 committed Oct 4, 2024
1 parent 6799533 commit 70ff89b
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 157 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ class BuildCommand : Callable<Int> {
val args = arrayOf("package")
val result = CommandHelper.runMavenCli(args, projectDir)
if (result == 0) {
val outputPath =
(outputDir?.toPath() ?: Path.of(".")).resolve("agent.jar")
val outputDir = (outputDir?.toPath() ?: Path.of("."))
Files.createDirectories(outputDir)
val outputPath = outputDir.resolve("agent.jar")
Files.copy(
projectDir.resolve("target")
.resolve("agent-jar-with-dependencies.jar"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import io.ktor.server.plugins.defaultheaders.*
import io.ktor.server.resources.*
import io.ktor.server.routing.*


object KtorLauncher {
fun launch(chatAgent: ChatAgent) {
embeddedServer(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
/**
* Agent Protocol
* Specification of the API protocol for communication with an agent.
*
* The version of the OpenAPI document: v1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package io.github.llmagentbuilder.launcher.ktor.server.models


Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
/**
* Agent Protocol
* Specification of the API protocol for communication with an agent.
*
* The version of the OpenAPI document: v1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package io.github.llmagentbuilder.launcher.ktor.server.models


/**
*
*
* @param message Message stating the entity was not found
*/
data class GetAgentTask404Response(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
/**
* Agent Protocol
* Specification of the API protocol for communication with an agent.
*
* The version of the OpenAPI document: v1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package io.github.llmagentbuilder.launcher.ktor.server.models


/**
*
*
* @param totalItems Total number of items.
* @param totalPages Total number of pages.
* @param currentPage Current_page page number.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
/**
* Agent Protocol
* Specification of the API protocol for communication with an agent.
*
* The version of the OpenAPI document: v1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package io.github.llmagentbuilder.launcher.ktor.server.models

import io.github.llmagentbuilder.launcher.ktor.server.models.Artifact

/**
*
*
* @param taskId The ID of the task this step belongs to.
* @param stepId The ID of the task step.
* @param status The status of the task step.
Expand Down Expand Up @@ -47,13 +34,12 @@ data class Step(
val output: kotlin.String? = null,
/* Output that the task step has produced. Any value is allowed. */
val additionalOutput: kotlin.Any? = null
)
{
) {
/**
* The status of the task step.
* Values: created,running,completed
*/
enum class Status(val value: kotlin.String){
* The status of the task step.
* Values: created,running,completed
*/
enum class Status(val value: kotlin.String) {
created("created"),
running("running"),
completed("completed");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
/**
* Agent Protocol
* Specification of the API protocol for communication with an agent.
*
* The version of the OpenAPI document: v1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package io.github.llmagentbuilder.launcher.ktor.server.models


Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
/**
* Agent Protocol
* Specification of the API protocol for communication with an agent.
*
* The version of the OpenAPI document: v1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package io.github.llmagentbuilder.launcher.ktor.server.models

import io.github.llmagentbuilder.launcher.ktor.server.models.Artifact

/**
*
*
* @param taskId The ID of the task.
* @param artifacts A list of artifacts that the task has produced.
* @param input Input prompt for the task.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
/**
* Agent Protocol
* Specification of the API protocol for communication with an agent.
*
* The version of the OpenAPI document: v1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package io.github.llmagentbuilder.launcher.ktor.server.models

import io.github.llmagentbuilder.launcher.ktor.server.models.Artifact
import io.github.llmagentbuilder.launcher.ktor.server.models.Pagination

/**
*
* @param artifacts
* @param pagination
*
* @param artifacts
* @param pagination
*/
data class TaskArtifactsListResponse(
val artifacts: kotlin.collections.List<Artifact>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
/**
* Agent Protocol
* Specification of the API protocol for communication with an agent.
*
* The version of the OpenAPI document: v1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package io.github.llmagentbuilder.launcher.ktor.server.models

import io.github.llmagentbuilder.launcher.ktor.server.models.Pagination
import io.github.llmagentbuilder.launcher.ktor.server.models.Task

/**
*
* @param tasks
* @param pagination
*
* @param tasks
* @param pagination
*/
data class TaskListResponse(
val tasks: kotlin.collections.List<Task>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
/**
* Agent Protocol
* Specification of the API protocol for communication with an agent.
*
* The version of the OpenAPI document: v1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package io.github.llmagentbuilder.launcher.ktor.server.models


Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
/**
* Agent Protocol
* Specification of the API protocol for communication with an agent.
*
* The version of the OpenAPI document: v1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package io.github.llmagentbuilder.launcher.ktor.server.models

import io.github.llmagentbuilder.launcher.ktor.server.models.Pagination
import io.github.llmagentbuilder.launcher.ktor.server.models.Step

/**
*
* @param steps
* @param pagination
*
* @param steps
* @param pagination
*/
data class TaskStepsListResponse(
val steps: kotlin.collections.List<Step>,
Expand Down
12 changes: 0 additions & 12 deletions launchers/ktor/src/main/resources/application.conf

This file was deleted.

0 comments on commit 70ff89b

Please sign in to comment.