-
Notifications
You must be signed in to change notification settings - Fork 4
/
outputool.go
44 lines (39 loc) · 1.14 KB
/
outputool.go
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
package main
import (
ai "github.com/sashabaranov/go-openai"
"github.com/sashabaranov/go-openai/jsonschema"
)
var _ SoulShackTool = (*CreateOutputTool)(nil)
// filesystem artifact
type CreateOutputTool struct {
DocRoot string
}
func (fs *CreateOutputTool) Execute(ctx ChatContextInterface, tool ai.ToolCall) (ai.ChatCompletionMessage, error) {
panic("implement me")
}
func (fs *CreateOutputTool) GetTool() (ai.Tool, error) {
return ai.Tool{
Type: ai.ToolTypeFunction,
Function: &ai.FunctionDefinition{
Name: "create_output",
Description: "creates a persistant output that can be referenced later",
Parameters: jsonschema.Definition{
Type: jsonschema.Object,
Properties: map[string]jsonschema.Definition{
"owner": {
Type: jsonschema.String,
Description: "the user who created the output",
},
"name": {
Type: jsonschema.String,
Description: "the name of the output",
},
"content": {
Type: jsonschema.String,
Description: "the content to store in the persistent output",
},
},
Required: []string{"name", "content"},
},
}}, nil
}