You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently there is a DSL which builds an agent. In order to configure tool which can be used by an agent you currently have to instantiate the objects yourself. For example like this:
object SaveInvoiceTool : Tool {
val numberParameter = Parameter.Primitive(
name = "number",
description = "The invoice number",
isRequired = true,
ParameterType.Primitive.String
)
val date = Parameter.Primitive(
name = "date",
description = "The invoice date",
isRequired = false,
ParameterType.Primitive.String
)
val customerName = Parameter.Primitive(
name = "customerName",
description = "The invoice customer",
isRequired = true,
ParameterType.Primitive.String
)
val lines = Parameter.Complex.Array(
name = "lines",
description = "The invoice lines",
isRequired = true,
itemDefinition = Parameter.Complex.Object(
name = "itemDefinition",
description = "The invoice item",
isRequired = true,
parameters = listOf(
Parameter.Primitive(
name = "itemName",
description = "The invoice item",
isRequired = true,
ParameterType.Primitive.String
),
Parameter.Primitive(
name = "costAmount",
description = "The invoiced amound",
isRequired = true,
ParameterType.Primitive.String
)
)
)
)
override val description: String = "Saves the invoice"
override val name = ToolName("saveInvoice")
override val parameters: List<Parameter> = listOf(numberParameter, date, customerName, lines)
override val handler: suspend (JsonObject) -> String = { arguments ->
println("Saved invoice: $arguments")
"Saved"
}
}
Please implement a DSL which under the hood instantiate a tool with parameters. Something like:
tool {
name = "saveInvoice"
description = "Saves the invoice"
stringParameter {
name = "number"
}
}
The text was updated successfully, but these errors were encountered:
Implement tool DSL
Currently there is a DSL which builds an agent. In order to configure tool which can be used by an agent you currently have to instantiate the objects yourself. For example like this:
Please implement a DSL which under the hood instantiate a tool with parameters. Something like:
The text was updated successfully, but these errors were encountered: