-
Notifications
You must be signed in to change notification settings - Fork 175
Adds optional _meta field to Tool #339
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
Changes from 14 commits
eb637b4
d9b3b8b
6fdcf0e
07a522c
30a2b60
ae24916
12149c0
c95c6ef
f5398a2
0315f76
595790f
6b23147
3a07caa
8b679ad
7e361ad
a9ff1fc
2cab6cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1242,7 +1242,12 @@ public data class Tool( | |
| * Optional additional tool information. | ||
| */ | ||
| val annotations: ToolAnnotations?, | ||
| ) { | ||
|
|
||
| /** | ||
| * Optional metadata for the tool. | ||
| */ | ||
| override val _meta: JsonObject = EmptyJsonObject, | ||
| ) : WithMeta { | ||
| @Serializable | ||
| public data class Input(val properties: JsonObject = EmptyJsonObject, val required: List<String>? = null) { | ||
| @OptIn(ExperimentalSerializationApi::class) | ||
|
|
@@ -1256,6 +1261,32 @@ public data class Tool( | |
| @EncodeDefault | ||
| val type: String = "object" | ||
| } | ||
|
|
||
| public class Builder { | ||
| public var name: String? = null | ||
| public var title: String? = null | ||
| public var description: String? = null | ||
| public var inputSchema: Input = Input() | ||
| public var outputSchema: Output? = null | ||
| public var annotations: ToolAnnotations? = null | ||
|
|
||
| @Suppress("PropertyName") | ||
| public var _meta: JsonObject = EmptyJsonObject | ||
|
|
||
| public fun build(): Tool = Tool( | ||
| name = requireNotNull(name) { "Tool name is required" }, | ||
| title = title, | ||
| description = description, | ||
| inputSchema = inputSchema, | ||
| outputSchema = outputSchema, | ||
| annotations = annotations, | ||
| _meta = _meta, | ||
| ) | ||
| } | ||
|
|
||
| public companion object { | ||
| public fun build(builder: Builder.() -> Unit): Tool = Builder().apply(builder).build() | ||
| } | ||
|
||
| } | ||
|
|
||
| /** | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.