forked from github/copilot-sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathToolDef.java
More file actions
109 lines (95 loc) · 2.52 KB
/
ToolDef.java
File metadata and controls
109 lines (95 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------------------------------------------*/
package com.github.copilot.sdk.json;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Low-level tool definition for JSON-RPC communication.
* <p>
* This is an internal class representing the wire format of a tool. For
* registering tools with the SDK, use {@link ToolDefinition} instead.
*
* @see ToolDefinition
* @since 1.0.0
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public final class ToolDef {
@JsonProperty("name")
private String name;
@JsonProperty("description")
private String description;
@JsonProperty("parameters")
private Object parameters;
/**
* Creates an empty tool definition.
*/
public ToolDef() {
}
/**
* Creates a tool definition with all fields.
*
* @param name
* the unique tool identifier
* @param description
* the tool description
* @param parameters
* the JSON Schema for tool parameters
*/
public ToolDef(String name, String description, Object parameters) {
this.name = name;
this.description = description;
this.parameters = parameters;
}
/**
* Gets the tool name.
*
* @return the tool name
*/
public String getName() {
return name;
}
/**
* Sets the tool name.
*
* @param name
* the tool name
*/
public void setName(String name) {
this.name = name;
}
/**
* Gets the tool description.
*
* @return the tool description
*/
public String getDescription() {
return description;
}
/**
* Sets the tool description.
*
* @param description
* the tool description
*/
public void setDescription(String description) {
this.description = description;
}
/**
* Gets the JSON Schema for tool parameters.
*
* @return the parameters schema
*/
public Object getParameters() {
return parameters;
}
/**
* Sets the JSON Schema for tool parameters.
*
* @param parameters
* the parameters schema
*/
public void setParameters(Object parameters) {
this.parameters = parameters;
}
}