Skip to content

feat: add sys.context to introspect your current tools and agents #527

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

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 27 additions & 10 deletions pkg/builtin/builtin.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ var SafeTools = map[string]struct{}{
"sys.echo": {},
"sys.prompt": {},
"sys.time.now": {},
"sys.context": {},
}

var tools = map[string]types.Tool{
Expand Down Expand Up @@ -228,16 +229,15 @@ var tools = map[string]types.Tool{
BuiltinFunc: SysChatHistory,
},
},
}

func SysProgram() *types.Program {
result := &types.Program{
ToolSet: types.ToolSet{},
}
for _, tool := range ListTools() {
result.ToolSet[tool.ID] = tool
}
return result
"sys.context": {
ToolDef: types.ToolDef{
Parameters: types.Parameters{
Description: "Retrieves the current internal GPTScript tool call context information",
Arguments: types.ObjectSchema(),
},
BuiltinFunc: SysContext,
},
},
}

func ListTools() (result []types.Tool) {
Expand Down Expand Up @@ -626,6 +626,23 @@ func invalidArgument(input string, err error) string {
return fmt.Sprintf("Failed to parse arguments %s: %v", input, err)
}

func SysContext(ctx context.Context, _ []string, _ string, _ chan<- string) (string, error) {
engineContext, _ := engine.FromContext(ctx)

callContext := *engineContext.GetCallContext()
callContext.ID = ""
callContext.ParentID = ""
data, err := json.Marshal(map[string]any{
"program": engineContext.Program,
"call": callContext,
})
if err != nil {
return invalidArgument("", err), nil
}

return string(data), nil
}

func SysChatHistory(ctx context.Context, _ []string, _ string, _ chan<- string) (string, error) {
engineContext, _ := engine.FromContext(ctx)

Expand Down
4 changes: 2 additions & 2 deletions pkg/embedded/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package embedded
import (
"io/fs"
"os"
"strings"

"github.com/gptscript-ai/gptscript/internal"
"github.com/gptscript-ai/gptscript/pkg/cli"
Expand All @@ -22,10 +21,11 @@ func Run(opts ...Options) bool {
}

system.SetBinToSelf()
if len(os.Args) > 1 && strings.HasPrefix(os.Args[1], "sys.") {
if os.Getenv("GPTSCRIPT_EMBEDDED") == "true" {
cli.Main()
return true
}

_ = os.Setenv("GPTSCRIPT_EMBEDDED", "true")
return false
}
13 changes: 10 additions & 3 deletions pkg/engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func WithToolCategory(ctx context.Context, toolCategory ToolCategory) context.Co
return context.WithValue(ctx, toolCategoryKey{}, toolCategory)
}

func NewContext(ctx context.Context, prg *types.Program, input string) Context {
func NewContext(ctx context.Context, prg *types.Program, input string) (Context, error) {
category, _ := ctx.Value(toolCategoryKey{}).(ToolCategory)

callCtx := Context{
Expand All @@ -178,7 +178,14 @@ func NewContext(ctx context.Context, prg *types.Program, input string) Context {
Program: prg,
Input: input,
}
return callCtx

agentGroup, err := callCtx.Tool.GetAgents(*prg)
if err != nil {
return callCtx, err
}

callCtx.AgentGroup = agentGroup
return callCtx, nil
}

func (c *Context) SubCallContext(ctx context.Context, input, toolID, callID string, toolCategory ToolCategory) (Context, error) {
Expand All @@ -191,7 +198,7 @@ func (c *Context) SubCallContext(ctx context.Context, input, toolID, callID stri
callID = counter.Next()
}

agentGroup, err := c.Tool.GetAgentGroup(c.AgentGroup, toolID)
agentGroup, err := c.Tool.GetNextAgentGroup(*c.Program, c.AgentGroup, toolID)
if err != nil {
return Context{}, err
}
Expand Down
6 changes: 5 additions & 1 deletion pkg/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ func (r *Runner) Chat(ctx context.Context, prevState ChatState, prg types.Progra
monitor.Stop(resp.Content, err)
}()

callCtx := engine.NewContext(ctx, &prg, input)
callCtx, err := engine.NewContext(ctx, &prg, input)
if err != nil {
return resp, err
}

if state == nil || state.StartContinuation {
if state != nil {
state = state.WithResumeInput(&input)
Expand Down
31 changes: 31 additions & 0 deletions pkg/tests/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"runtime"
"testing"

"github.com/gptscript-ai/gptscript/pkg/engine"
"github.com/gptscript-ai/gptscript/pkg/tests/tester"
"github.com/gptscript-ai/gptscript/pkg/types"
"github.com/hexops/autogold/v2"
Expand Down Expand Up @@ -847,3 +848,33 @@ func TestInput(t *testing.T) {
autogold.Expect("TEST RESULT CALL: 2").Equal(t, resp.Content)
autogold.ExpectFile(t, toJSONString(t, resp), autogold.Name(t.Name()+"/step2"))
}

func TestSysContext(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip()
}

r := tester.NewRunner(t)

prg, err := r.Load("")
require.NoError(t, err)

resp, err := r.Chat(context.Background(), nil, prg, nil, "input 1")
require.NoError(t, err)
r.AssertResponded(t)
assert.False(t, resp.Done)
autogold.Expect("TEST RESULT CALL: 1").Equal(t, resp.Content)
autogold.ExpectFile(t, toJSONString(t, resp), autogold.Name(t.Name()+"/step1"))

data, err := os.ReadFile("testdata/TestSysContext/context.json")
require.NoError(t, err)

context := struct {
Call engine.CallContext `json:"call"`
}{}
err = json.Unmarshal(data, &context)
require.NoError(t, err)

require.Len(t, context.Call.AgentGroup, 1)
assert.Equal(t, context.Call.AgentGroup[0].Named, "iAmSuperman")
}
9 changes: 9 additions & 0 deletions pkg/tests/testdata/TestSysContext/call1-resp.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
`{
"role": "assistant",
"content": [
{
"text": "TEST RESULT CALL: 1"
}
],
"usage": {}
}`
41 changes: 41 additions & 0 deletions pkg/tests/testdata/TestSysContext/call1.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
`{
"model": "gpt-4o",
"internalSystemPrompt": false,
"tools": [
{
"function": {
"toolID": "testdata/TestSysContext/file.gpt:I am Superman Agent",
"name": "iAmSuperman",
"parameters": {
"properties": {
"prompt": {
"description": "Prompt to send to the tool. This may be an instruction or question.",
"type": "string"
}
},
"type": "object"
}
}
}
],
"messages": [
{
"role": "system",
"content": [
{
"text": "{\"call\":{\"id\":\"\",\"tool\":{\"name\":\"sys.context\",\"description\":\"Retrieves the current internal GPTScript tool call context information\",\"modelName\":\"gpt-4o\",\"internalPrompt\":null,\"arguments\":{\"type\":\"object\"},\"instructions\":\"#!sys.context\",\"id\":\"sys.context\",\"source\":{}},\"agentGroup\":[{\"named\":\"iAmSuperman\",\"reference\":\"./file.gpt\",\"toolID\":\"testdata/TestSysContext/file.gpt:I am Superman Agent\"}],\"inputContext\":null,\"toolCategory\":\"context\",\"toolName\":\"sys.context\"},\"program\":{\"name\":\"testdata/TestSysContext/test.gpt\",\"entryToolId\":\"testdata/TestSysContext/test.gpt:\",\"toolSet\":{\"sys.context\":{\"name\":\"sys.context\",\"description\":\"Retrieves the current internal GPTScript tool call context information\",\"modelName\":\"gpt-4o\",\"internalPrompt\":null,\"arguments\":{\"type\":\"object\"},\"instructions\":\"#!sys.context\",\"id\":\"sys.context\",\"source\":{}},\"testdata/TestSysContext/file.gpt:I am Superman Agent\":{\"name\":\"I am Superman Agent\",\"modelName\":\"gpt-4o\",\"internalPrompt\":null,\"instructions\":\"I'm super\",\"id\":\"testdata/TestSysContext/file.gpt:I am Superman Agent\",\"localTools\":{\"i am superman agent\":\"testdata/TestSysContext/file.gpt:I am Superman Agent\"},\"source\":{\"location\":\"testdata/TestSysContext/file.gpt\",\"lineNo\":1},\"workingDir\":\"testdata/TestSysContext\"},\"testdata/TestSysContext/test.gpt:\":{\"modelName\":\"gpt-4o\",\"chat\":true,\"internalPrompt\":null,\"context\":[\"agents\"],\"agents\":[\"./file.gpt\"],\"instructions\":\"Tool body\",\"id\":\"testdata/TestSysContext/test.gpt:\",\"toolMapping\":{\"./file.gpt\":[{\"reference\":\"./file.gpt\",\"toolID\":\"testdata/TestSysContext/file.gpt:I am Superman Agent\"}],\"agents\":[{\"reference\":\"agents\",\"toolID\":\"testdata/TestSysContext/test.gpt:agents\"}]},\"localTools\":{\"\":\"testdata/TestSysContext/test.gpt:\",\"agents\":\"testdata/TestSysContext/test.gpt:agents\"},\"source\":{\"location\":\"testdata/TestSysContext/test.gpt\",\"lineNo\":1},\"workingDir\":\"testdata/TestSysContext\"},\"testdata/TestSysContext/test.gpt:agents\":{\"name\":\"agents\",\"modelName\":\"gpt-4o\",\"internalPrompt\":null,\"context\":[\"sys.context\"],\"instructions\":\"#!/bin/bash\\n\\necho \\\"${GPTSCRIPT_CONTEXT}\\\"\\necho \\\"${GPTSCRIPT_CONTEXT}\\\" \\u003e ${GPTSCRIPT_TOOL_DIR}/context.json\",\"id\":\"testdata/TestSysContext/test.gpt:agents\",\"toolMapping\":{\"sys.context\":[{\"reference\":\"sys.context\",\"toolID\":\"sys.context\"}]},\"localTools\":{\"\":\"testdata/TestSysContext/test.gpt:\",\"agents\":\"testdata/TestSysContext/test.gpt:agents\"},\"source\":{\"location\":\"testdata/TestSysContext/test.gpt\",\"lineNo\":8},\"workingDir\":\"testdata/TestSysContext\"}}}}\n\nTool body"
}
],
"usage": {}
},
{
"role": "user",
"content": [
{
"text": "input 1"
}
],
"usage": {}
}
]
}`
41 changes: 41 additions & 0 deletions pkg/tests/testdata/TestSysContext/call1.golden.bkp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
`{
"model": "gpt-4o",
"internalSystemPrompt": false,
"tools": [
{
"function": {
"toolID": "testdata/TestSysContext/test.gpt:foo",
"name": "foo",
"parameters": {
"properties": {
"prompt": {
"description": "Prompt to send to the tool. This may be an instruction or question.",
"type": "string"
}
},
"type": "object"
}
}
}
],
"messages": [
{
"role": "system",
"content": [
{
"text": "{\"call\":{\"id\":\"\",\"tool\":{\"name\":\"sys.context\",\"description\":\"Retrieves the current internal GPTScript tool call context information\",\"modelName\":\"gpt-4o\",\"internalPrompt\":null,\"arguments\":{\"type\":\"object\"},\"instructions\":\"#!sys.context\",\"id\":\"sys.context\",\"source\":{}},\"inputContext\":null,\"toolCategory\":\"context\",\"toolName\":\"sys.context\",\"parentID\":\"1718924874\",\"displayText\":\"Running sys.context\"},\"program\":{\"name\":\"testdata/TestSysContext/test.gpt\",\"entryToolId\":\"testdata/TestSysContext/test.gpt:\",\"toolSet\":{\"sys.context\":{\"name\":\"sys.context\",\"description\":\"Retrieves the current internal GPTScript tool call context information\",\"modelName\":\"gpt-4o\",\"internalPrompt\":null,\"arguments\":{\"type\":\"object\"},\"instructions\":\"#!sys.context\",\"id\":\"sys.context\",\"source\":{}},\"testdata/TestSysContext/test.gpt:\":{\"modelName\":\"gpt-4o\",\"chat\":true,\"internalPrompt\":null,\"context\":[\"agents\"],\"agents\":[\"foo\"],\"instructions\":\"Tool body\",\"id\":\"testdata/TestSysContext/test.gpt:\",\"toolMapping\":{\"agents\":[{\"reference\":\"agents\",\"toolID\":\"testdata/TestSysContext/test.gpt:agents\"}],\"foo\":[{\"reference\":\"foo\",\"toolID\":\"testdata/TestSysContext/test.gpt:foo\"}]},\"localTools\":{\"\":\"testdata/TestSysContext/test.gpt:\",\"agents\":\"testdata/TestSysContext/test.gpt:agents\",\"foo\":\"testdata/TestSysContext/test.gpt:foo\"},\"source\":{\"location\":\"testdata/TestSysContext/test.gpt\",\"lineNo\":1},\"workingDir\":\"testdata/TestSysContext\"},\"testdata/TestSysContext/test.gpt:agents\":{\"name\":\"agents\",\"modelName\":\"gpt-4o\",\"internalPrompt\":null,\"context\":[\"sys.context\"],\"instructions\":\"#!/bin/bash\\n\\necho \\\"${GPTSCRIPT_CONTEXT}\\\"\\necho \\\"${GPTSCRIPT_CONTEXT}\\\" \\u003e ${GPTSCRIPT_TOOL_DIR}/context.json\",\"id\":\"testdata/TestSysContext/test.gpt:agents\",\"toolMapping\":{\"sys.context\":[{\"reference\":\"sys.context\",\"toolID\":\"sys.context\"}]},\"localTools\":{\"\":\"testdata/TestSysContext/test.gpt:\",\"agents\":\"testdata/TestSysContext/test.gpt:agents\",\"foo\":\"testdata/TestSysContext/test.gpt:foo\"},\"source\":{\"location\":\"testdata/TestSysContext/test.gpt\",\"lineNo\":13},\"workingDir\":\"testdata/TestSysContext\"},\"testdata/TestSysContext/test.gpt:foo\":{\"name\":\"foo\",\"modelName\":\"gpt-4o\",\"internalPrompt\":null,\"instructions\":\"I'm an agent\",\"id\":\"testdata/TestSysContext/test.gpt:foo\",\"localTools\":{\"\":\"testdata/TestSysContext/test.gpt:\",\"agents\":\"testdata/TestSysContext/test.gpt:agents\",\"foo\":\"testdata/TestSysContext/test.gpt:foo\"},\"source\":{\"location\":\"testdata/TestSysContext/test.gpt\",\"lineNo\":8},\"workingDir\":\"testdata/TestSysContext\"}}}}\n\nTool body"
}
],
"usage": {}
},
{
"role": "user",
"content": [
{
"text": "input 1"
}
],
"usage": {}
}
]
}`
1 change: 1 addition & 0 deletions pkg/tests/testdata/TestSysContext/context.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"call":{"id":"","tool":{"name":"sys.context","description":"Retrieves the current internal GPTScript tool call context information","modelName":"gpt-4o","internalPrompt":null,"arguments":{"type":"object"},"instructions":"#!sys.context","id":"sys.context","source":{}},"agentGroup":[{"named":"iAmSuperman","reference":"./file.gpt","toolID":"testdata/TestSysContext/file.gpt:I am Superman Agent"}],"inputContext":null,"toolCategory":"context","toolName":"sys.context"},"program":{"name":"testdata/TestSysContext/test.gpt","entryToolId":"testdata/TestSysContext/test.gpt:","toolSet":{"sys.context":{"name":"sys.context","description":"Retrieves the current internal GPTScript tool call context information","modelName":"gpt-4o","internalPrompt":null,"arguments":{"type":"object"},"instructions":"#!sys.context","id":"sys.context","source":{}},"testdata/TestSysContext/file.gpt:I am Superman Agent":{"name":"I am Superman Agent","modelName":"gpt-4o","internalPrompt":null,"instructions":"I'm super","id":"testdata/TestSysContext/file.gpt:I am Superman Agent","localTools":{"i am superman agent":"testdata/TestSysContext/file.gpt:I am Superman Agent"},"source":{"location":"testdata/TestSysContext/file.gpt","lineNo":1},"workingDir":"testdata/TestSysContext"},"testdata/TestSysContext/test.gpt:":{"modelName":"gpt-4o","chat":true,"internalPrompt":null,"context":["agents"],"agents":["./file.gpt"],"instructions":"Tool body","id":"testdata/TestSysContext/test.gpt:","toolMapping":{"./file.gpt":[{"reference":"./file.gpt","toolID":"testdata/TestSysContext/file.gpt:I am Superman Agent"}],"agents":[{"reference":"agents","toolID":"testdata/TestSysContext/test.gpt:agents"}]},"localTools":{"":"testdata/TestSysContext/test.gpt:","agents":"testdata/TestSysContext/test.gpt:agents"},"source":{"location":"testdata/TestSysContext/test.gpt","lineNo":1},"workingDir":"testdata/TestSysContext"},"testdata/TestSysContext/test.gpt:agents":{"name":"agents","modelName":"gpt-4o","internalPrompt":null,"context":["sys.context"],"instructions":"#!/bin/bash\n\necho \"${GPTSCRIPT_CONTEXT}\"\necho \"${GPTSCRIPT_CONTEXT}\" \u003e ${GPTSCRIPT_TOOL_DIR}/context.json","id":"testdata/TestSysContext/test.gpt:agents","toolMapping":{"sys.context":[{"reference":"sys.context","toolID":"sys.context"}]},"localTools":{"":"testdata/TestSysContext/test.gpt:","agents":"testdata/TestSysContext/test.gpt:agents"},"source":{"location":"testdata/TestSysContext/test.gpt","lineNo":8},"workingDir":"testdata/TestSysContext"}}}}
3 changes: 3 additions & 0 deletions pkg/tests/testdata/TestSysContext/file.gpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: I am Superman Agent

I'm super
64 changes: 64 additions & 0 deletions pkg/tests/testdata/TestSysContext/step1.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
`{
"done": false,
"content": "TEST RESULT CALL: 1",
"toolID": "testdata/TestSysContext/test.gpt:",
"state": {
"continuation": {
"state": {
"input": "input 1",
"completion": {
"model": "gpt-4o",
"internalSystemPrompt": false,
"tools": [
{
"function": {
"toolID": "testdata/TestSysContext/file.gpt:I am Superman Agent",
"name": "iAmSuperman",
"parameters": {
"properties": {
"prompt": {
"description": "Prompt to send to the tool. This may be an instruction or question.",
"type": "string"
}
},
"type": "object"
}
}
}
],
"messages": [
{
"role": "system",
"content": [
{
"text": "{\"call\":{\"id\":\"\",\"tool\":{\"name\":\"sys.context\",\"description\":\"Retrieves the current internal GPTScript tool call context information\",\"modelName\":\"gpt-4o\",\"internalPrompt\":null,\"arguments\":{\"type\":\"object\"},\"instructions\":\"#!sys.context\",\"id\":\"sys.context\",\"source\":{}},\"agentGroup\":[{\"named\":\"iAmSuperman\",\"reference\":\"./file.gpt\",\"toolID\":\"testdata/TestSysContext/file.gpt:I am Superman Agent\"}],\"inputContext\":null,\"toolCategory\":\"context\",\"toolName\":\"sys.context\"},\"program\":{\"name\":\"testdata/TestSysContext/test.gpt\",\"entryToolId\":\"testdata/TestSysContext/test.gpt:\",\"toolSet\":{\"sys.context\":{\"name\":\"sys.context\",\"description\":\"Retrieves the current internal GPTScript tool call context information\",\"modelName\":\"gpt-4o\",\"internalPrompt\":null,\"arguments\":{\"type\":\"object\"},\"instructions\":\"#!sys.context\",\"id\":\"sys.context\",\"source\":{}},\"testdata/TestSysContext/file.gpt:I am Superman Agent\":{\"name\":\"I am Superman Agent\",\"modelName\":\"gpt-4o\",\"internalPrompt\":null,\"instructions\":\"I'm super\",\"id\":\"testdata/TestSysContext/file.gpt:I am Superman Agent\",\"localTools\":{\"i am superman agent\":\"testdata/TestSysContext/file.gpt:I am Superman Agent\"},\"source\":{\"location\":\"testdata/TestSysContext/file.gpt\",\"lineNo\":1},\"workingDir\":\"testdata/TestSysContext\"},\"testdata/TestSysContext/test.gpt:\":{\"modelName\":\"gpt-4o\",\"chat\":true,\"internalPrompt\":null,\"context\":[\"agents\"],\"agents\":[\"./file.gpt\"],\"instructions\":\"Tool body\",\"id\":\"testdata/TestSysContext/test.gpt:\",\"toolMapping\":{\"./file.gpt\":[{\"reference\":\"./file.gpt\",\"toolID\":\"testdata/TestSysContext/file.gpt:I am Superman Agent\"}],\"agents\":[{\"reference\":\"agents\",\"toolID\":\"testdata/TestSysContext/test.gpt:agents\"}]},\"localTools\":{\"\":\"testdata/TestSysContext/test.gpt:\",\"agents\":\"testdata/TestSysContext/test.gpt:agents\"},\"source\":{\"location\":\"testdata/TestSysContext/test.gpt\",\"lineNo\":1},\"workingDir\":\"testdata/TestSysContext\"},\"testdata/TestSysContext/test.gpt:agents\":{\"name\":\"agents\",\"modelName\":\"gpt-4o\",\"internalPrompt\":null,\"context\":[\"sys.context\"],\"instructions\":\"#!/bin/bash\\n\\necho \\\"${GPTSCRIPT_CONTEXT}\\\"\\necho \\\"${GPTSCRIPT_CONTEXT}\\\" \\u003e ${GPTSCRIPT_TOOL_DIR}/context.json\",\"id\":\"testdata/TestSysContext/test.gpt:agents\",\"toolMapping\":{\"sys.context\":[{\"reference\":\"sys.context\",\"toolID\":\"sys.context\"}]},\"localTools\":{\"\":\"testdata/TestSysContext/test.gpt:\",\"agents\":\"testdata/TestSysContext/test.gpt:agents\"},\"source\":{\"location\":\"testdata/TestSysContext/test.gpt\",\"lineNo\":8},\"workingDir\":\"testdata/TestSysContext\"}}}}\n\nTool body"
}
],
"usage": {}
},
{
"role": "user",
"content": [
{
"text": "input 1"
}
],
"usage": {}
},
{
"role": "assistant",
"content": [
{
"text": "TEST RESULT CALL: 1"
}
],
"usage": {}
}
]
}
},
"result": "TEST RESULT CALL: 1"
},
"continuationToolID": "testdata/TestSysContext/test.gpt:"
}
}`
22 changes: 22 additions & 0 deletions pkg/tests/testdata/TestSysContext/test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package main

import (
"encoding/json"
"fmt"
"os"

"github.com/gptscript-ai/gptscript/pkg/engine"
)

func main() {
data := struct {
Call engine.CallContext `json:"call,omitempty"`
}{}
if err := json.Unmarshal([]byte(os.Getenv("GPTSCRIPT_CONTEXT")), &data); err != nil {
panic(err)
}

for _, agent := range data.Call.AgentGroup {
fmt.Println(agent.Reference, agent.ToolID)
}
}
14 changes: 14 additions & 0 deletions pkg/tests/testdata/TestSysContext/test.gpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
context: agents
agents: ./file.gpt
chat: true

Tool body

---
name: agents
context: sys.context

#!/bin/bash

echo "${GPTSCRIPT_CONTEXT}"
echo "${GPTSCRIPT_CONTEXT}" > ${GPTSCRIPT_TOOL_DIR}/context.json
Loading
Loading