Skip to content

Commit 91ccf88

Browse files
chore: rename sys.print to sys.echo
1 parent 4297025 commit 91ccf88

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

pkg/engine/engine.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ func (e *Engine) Start(ctx Context, input string) (ret *Return, _ error) {
186186
return e.runDaemon(ctx.Ctx, ctx.Program, tool, input)
187187
} else if tool.IsOpenAPI() {
188188
return e.runOpenAPI(tool, input)
189-
} else if tool.IsPrint() {
190-
return e.runPrint(tool)
189+
} else if tool.IsEcho() {
190+
return e.runEcho(tool)
191191
}
192192
s, err := e.runCommand(ctx.WrappedContext(), tool, input, ctx.ToolCategory)
193193
if err != nil {

pkg/engine/print.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import (
88
"github.com/gptscript-ai/gptscript/pkg/types"
99
)
1010

11-
func (e *Engine) runPrint(tool types.Tool) (cmdOut *Return, cmdErr error) {
11+
func (e *Engine) runEcho(tool types.Tool) (cmdOut *Return, cmdErr error) {
1212
id := fmt.Sprint(atomic.AddInt64(&completionID, 1))
13-
out := strings.TrimPrefix(tool.Instructions, types.PrintPrefix+"\n")
13+
out := strings.TrimPrefix(tool.Instructions, types.EchoPrefix+"\n")
1414

1515
e.Progress <- types.CompletionStatus{
1616
CompletionID: id,

pkg/loader/loader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ func readTool(ctx context.Context, cache *cache.Client, prg *types.Program, base
173173
Parameters: types.Parameters{
174174
Name: base.Name,
175175
},
176-
Instructions: types.PrintPrefix + "\n" + string(data),
176+
Instructions: types.EchoPrefix + "\n" + string(data),
177177
},
178178
}
179179
}

pkg/types/tool.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
const (
1616
DaemonPrefix = "#!sys.daemon"
1717
OpenAPIPrefix = "#!sys.openapi"
18-
PrintPrefix = "#!sys.print"
18+
EchoPrefix = "#!sys.echo"
1919
CommandPrefix = "#!"
2020
)
2121

@@ -411,8 +411,8 @@ func (t Tool) IsOpenAPI() bool {
411411
return strings.HasPrefix(t.Instructions, OpenAPIPrefix)
412412
}
413413

414-
func (t Tool) IsPrint() bool {
415-
return strings.HasPrefix(t.Instructions, PrintPrefix)
414+
func (t Tool) IsEcho() bool {
415+
return strings.HasPrefix(t.Instructions, EchoPrefix)
416416
}
417417

418418
func (t Tool) IsHTTP() bool {

0 commit comments

Comments
 (0)