From 966b49375e6da9968cf83aa628f00f487176ace3 Mon Sep 17 00:00:00 2001 From: Nick Hale <4175918+njhale@users.noreply.github.com> Date: Tue, 2 Jul 2024 16:38:28 -0400 Subject: [PATCH 1/7] enhance: set sdk cred override env var for ui Pass credential overrides to the UI by setting the UI tool's `GPTSCRIPT_SDKSERVER_CREDENTIAL_OVERRIDE` environment variable before running it. Signed-off-by: Nick Hale <4175918+njhale@users.noreply.github.com> --- pkg/cli/gptscript.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/cli/gptscript.go b/pkg/cli/gptscript.go index 0281cd04..865b3873 100644 --- a/pkg/cli/gptscript.go +++ b/pkg/cli/gptscript.go @@ -363,10 +363,13 @@ func (r *GPTScript) Run(cmd *cobra.Command, args []string) (retErr error) { gptOpt.Env = append(gptOpt.Env, system.BinEnvVar+"="+system.Bin()) } - // If the DefaultModel is set, then pass the correct environment variable. + // Pass the corrected environment variables for SDK server options if r.DefaultModel != "" { gptOpt.Env = append(gptOpt.Env, "GPTSCRIPT_SDKSERVER_DEFAULT_MODEL="+r.DefaultModel) } + if len(r.CredentialOverride) > 0 { + gptOpt.Env = append(gptOpt.Env, "GPTSCRIPT_SDKSERVER_CREDENTIAL_OVERRIDE="+strings.Join(r.CredentialOverride, ",")) + } args = append([]string{args[0]}, "--file="+file) From 51733579624915fdc4babdaaf3ffcce66a90b58a Mon Sep 17 00:00:00 2001 From: Grant Linville Date: Tue, 2 Jul 2024 17:13:38 -0400 Subject: [PATCH 2/7] fix: create cred helper dir properly on Windows (#603) Signed-off-by: Grant Linville --- pkg/credentials/util.go | 3 ++- pkg/repos/get.go | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/credentials/util.go b/pkg/credentials/util.go index f6165308..367b4d1d 100644 --- a/pkg/credentials/util.go +++ b/pkg/credentials/util.go @@ -5,7 +5,7 @@ import ( ) type CredentialHelperDirs struct { - RevisionFile, LastCheckedFile, BinDir, RepoDir string + RevisionFile, LastCheckedFile, BinDir, RepoDir, HelperDir string } func GetCredentialHelperDirs(cacheDir string) CredentialHelperDirs { @@ -14,5 +14,6 @@ func GetCredentialHelperDirs(cacheDir string) CredentialHelperDirs { LastCheckedFile: filepath.Join(cacheDir, "repos", "gptscript-credential-helpers", "last-checked"), BinDir: filepath.Join(cacheDir, "repos", "gptscript-credential-helpers", "bin"), RepoDir: filepath.Join(cacheDir, "repos", "gptscript-credential-helpers", "repo"), + HelperDir: filepath.Join(cacheDir, "repos", "gptscript-credential-helpers"), } } diff --git a/pkg/repos/get.go b/pkg/repos/get.go index be8d8594..2f96d8b3 100644 --- a/pkg/repos/get.go +++ b/pkg/repos/get.go @@ -7,7 +7,6 @@ import ( "fmt" "io/fs" "os" - "path" "path/filepath" "strings" "sync" @@ -133,7 +132,7 @@ func (m *Manager) deferredSetUpCredentialHelpers(ctx context.Context, cliCfg *co return err } - if err := os.MkdirAll(path.Dir(m.credHelperDirs.LastCheckedFile), 0755); err != nil { + if err := os.MkdirAll(m.credHelperDirs.HelperDir, 0755); err != nil { return err } From d39962e645bd63dce05bc2d957017729dac9ebc5 Mon Sep 17 00:00:00 2001 From: Grant Linville Date: Tue, 2 Jul 2024 18:55:19 -0400 Subject: [PATCH 3/7] enhance: generate name for OpenAPI tools when operation ID is blank (#601) Signed-off-by: Grant Linville --- pkg/loader/loader_test.go | 42 ------ pkg/loader/openapi.go | 12 +- pkg/loader/openapi_test.go | 88 ++++++++++++ .../testdata/openapi/TestOpenAPIv2.golden | 110 ++++++++++++++ .../testdata/openapi/TestOpenAPIv3.golden | 134 ++++++++++++++++++ .../TestOpenAPIv3NoOperationIDs.golden | 134 ++++++++++++++++++ .../testdata/openapi_v3_no_operation_ids.yaml | 116 +++++++++++++++ 7 files changed, 593 insertions(+), 43 deletions(-) create mode 100644 pkg/loader/openapi_test.go create mode 100644 pkg/loader/testdata/openapi/TestOpenAPIv2.golden create mode 100644 pkg/loader/testdata/openapi/TestOpenAPIv3.golden create mode 100644 pkg/loader/testdata/openapi/TestOpenAPIv3NoOperationIDs.golden create mode 100644 pkg/loader/testdata/openapi_v3_no_operation_ids.yaml diff --git a/pkg/loader/loader_test.go b/pkg/loader/loader_test.go index a5c328b5..d70c45f5 100644 --- a/pkg/loader/loader_test.go +++ b/pkg/loader/loader_test.go @@ -10,7 +10,6 @@ import ( "path/filepath" "testing" - "github.com/gptscript-ai/gptscript/pkg/types" "github.com/hexops/autogold/v2" "github.com/stretchr/testify/require" ) @@ -68,47 +67,6 @@ func TestIsOpenAPI(t *testing.T) { require.Equal(t, 3, v, "(json) expected openapi v3") } -func TestLoadOpenAPI(t *testing.T) { - numOpenAPITools := func(set types.ToolSet) int { - num := 0 - for _, v := range set { - if v.IsOpenAPI() { - num++ - } - } - return num - } - - prgv3 := types.Program{ - ToolSet: types.ToolSet{}, - } - datav3, err := os.ReadFile("testdata/openapi_v3.yaml") - require.NoError(t, err) - _, err = readTool(context.Background(), nil, &prgv3, &source{Content: datav3}, "") - require.NoError(t, err, "failed to read openapi v3") - require.Equal(t, 3, numOpenAPITools(prgv3.ToolSet), "expected 3 openapi tools") - - prgv2json := types.Program{ - ToolSet: types.ToolSet{}, - } - datav2, err := os.ReadFile("testdata/openapi_v2.json") - require.NoError(t, err) - _, err = readTool(context.Background(), nil, &prgv2json, &source{Content: datav2}, "") - require.NoError(t, err, "failed to read openapi v2") - require.Equal(t, 3, numOpenAPITools(prgv2json.ToolSet), "expected 3 openapi tools") - - prgv2yaml := types.Program{ - ToolSet: types.ToolSet{}, - } - datav2, err = os.ReadFile("testdata/openapi_v2.yaml") - require.NoError(t, err) - _, err = readTool(context.Background(), nil, &prgv2yaml, &source{Content: datav2}, "") - require.NoError(t, err, "failed to read openapi v2 (yaml)") - require.Equal(t, 3, numOpenAPITools(prgv2yaml.ToolSet), "expected 3 openapi tools") - - require.EqualValuesf(t, prgv2json.ToolSet, prgv2yaml.ToolSet, "expected same toolset for openapi v2 json and yaml") -} - func TestHelloWorld(t *testing.T) { prg, err := Program(context.Background(), "https://raw.githubusercontent.com/ibuildthecloud/test/bafe5a62174e8a0ea162277dcfe3a2ddb7eea928/example/sub/tool.gpt", diff --git a/pkg/loader/openapi.go b/pkg/loader/openapi.go index 8790fbb7..45254c9d 100644 --- a/pkg/loader/openapi.go +++ b/pkg/loader/openapi.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" "net/url" + "regexp" "slices" "sort" "strings" @@ -14,6 +15,8 @@ import ( "github.com/gptscript-ai/gptscript/pkg/types" ) +var toolNameRegex = regexp.MustCompile(`[^a-zA-Z0-9_-]+`) + // getOpenAPITools parses an OpenAPI definition and generates a set of tools from it. // Each operation will become a tool definition. // The tool's Instructions will be in the format "#!sys.openapi '{JSON Instructions}'", @@ -115,6 +118,13 @@ func getOpenAPITools(t *openapi3.T, defaultHost string) ([]types.Tool, error) { toolDesc = toolDesc[:1024] } + toolName := operation.OperationID + if toolName == "" { + // When there is no operation ID, we use the method + path as the tool name and remove all characters + // except letters, numbers, underscores, and hyphens. + toolName = toolNameRegex.ReplaceAllString(strings.ToLower(method)+strings.ReplaceAll(pathString, "/", "_"), "") + } + var ( // auths are represented as a list of maps, where each map contains the names of the required security schemes. // Items within the same map are a logical AND. The maps themselves are a logical OR. For example: @@ -133,7 +143,7 @@ func getOpenAPITools(t *openapi3.T, defaultHost string) ([]types.Tool, error) { tool := types.Tool{ ToolDef: types.ToolDef{ Parameters: types.Parameters{ - Name: operation.OperationID, + Name: toolName, Description: toolDesc, Arguments: &openapi3.Schema{ Type: &openapi3.Types{"object"}, diff --git a/pkg/loader/openapi_test.go b/pkg/loader/openapi_test.go new file mode 100644 index 00000000..d00ffcca --- /dev/null +++ b/pkg/loader/openapi_test.go @@ -0,0 +1,88 @@ +package loader + +import ( + "context" + "os" + "testing" + + "github.com/gptscript-ai/gptscript/pkg/types" + "github.com/hexops/autogold/v2" + "github.com/stretchr/testify/require" +) + +func TestLoadOpenAPI(t *testing.T) { + numOpenAPITools := func(set types.ToolSet) int { + num := 0 + for _, v := range set { + if v.IsOpenAPI() { + num++ + } + } + return num + } + + prgv3 := types.Program{ + ToolSet: types.ToolSet{}, + } + datav3, err := os.ReadFile("testdata/openapi_v3.yaml") + require.NoError(t, err) + _, err = readTool(context.Background(), nil, &prgv3, &source{Content: datav3}, "") + require.NoError(t, err, "failed to read openapi v3") + require.Equal(t, 3, numOpenAPITools(prgv3.ToolSet), "expected 3 openapi tools") + + prgv2json := types.Program{ + ToolSet: types.ToolSet{}, + } + datav2, err := os.ReadFile("testdata/openapi_v2.json") + require.NoError(t, err) + _, err = readTool(context.Background(), nil, &prgv2json, &source{Content: datav2}, "") + require.NoError(t, err, "failed to read openapi v2") + require.Equal(t, 3, numOpenAPITools(prgv2json.ToolSet), "expected 3 openapi tools") + + prgv2yaml := types.Program{ + ToolSet: types.ToolSet{}, + } + datav2, err = os.ReadFile("testdata/openapi_v2.yaml") + require.NoError(t, err) + _, err = readTool(context.Background(), nil, &prgv2yaml, &source{Content: datav2}, "") + require.NoError(t, err, "failed to read openapi v2 (yaml)") + require.Equal(t, 3, numOpenAPITools(prgv2yaml.ToolSet), "expected 3 openapi tools") + + require.EqualValuesf(t, prgv2json.ToolSet, prgv2yaml.ToolSet, "expected same toolset for openapi v2 json and yaml") +} + +func TestOpenAPIv3(t *testing.T) { + prgv3 := types.Program{ + ToolSet: types.ToolSet{}, + } + datav3, err := os.ReadFile("testdata/openapi_v3.yaml") + require.NoError(t, err) + _, err = readTool(context.Background(), nil, &prgv3, &source{Content: datav3}, "") + require.NoError(t, err) + + autogold.ExpectFile(t, prgv3.ToolSet, autogold.Dir("testdata/openapi")) +} + +func TestOpenAPIv3NoOperationIDs(t *testing.T) { + prgv3 := types.Program{ + ToolSet: types.ToolSet{}, + } + datav3, err := os.ReadFile("testdata/openapi_v3_no_operation_ids.yaml") + require.NoError(t, err) + _, err = readTool(context.Background(), nil, &prgv3, &source{Content: datav3}, "") + require.NoError(t, err) + + autogold.ExpectFile(t, prgv3.ToolSet, autogold.Dir("testdata/openapi")) +} + +func TestOpenAPIv2(t *testing.T) { + prgv2 := types.Program{ + ToolSet: types.ToolSet{}, + } + datav2, err := os.ReadFile("testdata/openapi_v2.yaml") + require.NoError(t, err) + _, err = readTool(context.Background(), nil, &prgv2, &source{Content: datav2}, "") + require.NoError(t, err) + + autogold.ExpectFile(t, prgv2.ToolSet, autogold.Dir("testdata/openapi")) +} diff --git a/pkg/loader/testdata/openapi/TestOpenAPIv2.golden b/pkg/loader/testdata/openapi/TestOpenAPIv2.golden new file mode 100644 index 00000000..90dd1967 --- /dev/null +++ b/pkg/loader/testdata/openapi/TestOpenAPIv2.golden @@ -0,0 +1,110 @@ +types.ToolSet{ + ":": types.Tool{ + ToolDef: types.ToolDef{Parameters: types.Parameters{ + Description: "This is a tool set for the Swagger Petstore OpenAPI spec", + ModelName: "gpt-4o", + Export: []string{ + "listPets", + "createPets", + "showPetById", + }, + }}, + ID: ":", + ToolMapping: map[string][]types.ToolReference{ + "createPets": {{ + Reference: "createPets", + ToolID: ":createPets", + }}, + "listPets": {{ + Reference: "listPets", + ToolID: ":listPets", + }}, + "showPetById": {{ + Reference: "showPetById", + ToolID: ":showPetById", + }}, + }, + LocalTools: map[string]string{ + "": ":", + "createpets": ":createPets", + "listpets": ":listPets", + "showpetbyid": ":showPetById", + }, + }, + ":createPets": types.Tool{ + ToolDef: types.ToolDef{ + Parameters: types.Parameters{ + Name: "createPets", + Description: "Create a pet", + ModelName: "gpt-4o", + }, + Instructions: `#!sys.openapi '{"server":"http://petstore.swagger.io/v1","path":"/pets","method":"POST","bodyContentMIME":"","apiKeyInfos":null,"queryParameters":null,"pathParameters":null,"headerParameters":null,"cookieParameters":null}'`, + }, + ID: ":createPets", + ToolMapping: map[string][]types.ToolReference{}, + LocalTools: map[string]string{ + "": ":", + "createpets": ":createPets", + "listpets": ":listPets", + "showpetbyid": ":showPetById", + }, + Source: types.ToolSource{LineNo: 2}, + }, + ":listPets": types.Tool{ + ToolDef: types.ToolDef{ + Parameters: types.Parameters{ + Name: "listPets", + Description: "List all pets", + ModelName: "gpt-4o", + Arguments: &openapi3.Schema{ + Type: &openapi3.Types{ + "object", + }, + Required: []string{}, + Properties: openapi3.Schemas{"limit": &openapi3.SchemaRef{Value: &openapi3.Schema{ + Type: &openapi3.Types{"integer"}, + Format: "int32", + Description: "How many items to return at one time (max 100)", + }}}, + }, + }, + Instructions: `#!sys.openapi '{"server":"http://petstore.swagger.io/v1","path":"/pets","method":"GET","bodyContentMIME":"","apiKeyInfos":null,"queryParameters":[{"name":"limit","style":"","explode":null}],"pathParameters":null,"headerParameters":null,"cookieParameters":null}'`, + }, + ID: ":listPets", + ToolMapping: map[string][]types.ToolReference{}, + LocalTools: map[string]string{ + "": ":", + "createpets": ":createPets", + "listpets": ":listPets", + "showpetbyid": ":showPetById", + }, + Source: types.ToolSource{LineNo: 1}, + }, + ":showPetById": types.Tool{ + ToolDef: types.ToolDef{ + Parameters: types.Parameters{ + Name: "showPetById", + Description: "Info for a specific pet", + ModelName: "gpt-4o", + Arguments: &openapi3.Schema{ + Type: &openapi3.Types{"object"}, + Required: []string{"petId"}, + Properties: openapi3.Schemas{"petId": &openapi3.SchemaRef{Value: &openapi3.Schema{ + Type: &openapi3.Types{"string"}, + Description: "The id of the pet to retrieve", + }}}, + }, + }, + Instructions: `#!sys.openapi '{"server":"http://petstore.swagger.io/v1","path":"/pets/{petId}","method":"GET","bodyContentMIME":"","apiKeyInfos":null,"queryParameters":null,"pathParameters":[{"name":"petId","style":"","explode":null}],"headerParameters":null,"cookieParameters":null}'`, + }, + ID: ":showPetById", + ToolMapping: map[string][]types.ToolReference{}, + LocalTools: map[string]string{ + "": ":", + "createpets": ":createPets", + "listpets": ":listPets", + "showpetbyid": ":showPetById", + }, + Source: types.ToolSource{LineNo: 3}, + }, +} diff --git a/pkg/loader/testdata/openapi/TestOpenAPIv3.golden b/pkg/loader/testdata/openapi/TestOpenAPIv3.golden new file mode 100644 index 00000000..72ccafae --- /dev/null +++ b/pkg/loader/testdata/openapi/TestOpenAPIv3.golden @@ -0,0 +1,134 @@ +types.ToolSet{ + ":": types.Tool{ + ToolDef: types.ToolDef{Parameters: types.Parameters{ + Description: "This is a tool set for the Swagger Petstore OpenAPI spec", + ModelName: "gpt-4o", + Export: []string{ + "listPets", + "createPets", + "showPetById", + }, + }}, + ID: ":", + ToolMapping: map[string][]types.ToolReference{ + "createPets": {{ + Reference: "createPets", + ToolID: ":createPets", + }}, + "listPets": {{ + Reference: "listPets", + ToolID: ":listPets", + }}, + "showPetById": {{ + Reference: "showPetById", + ToolID: ":showPetById", + }}, + }, + LocalTools: map[string]string{ + "": ":", + "createpets": ":createPets", + "listpets": ":listPets", + "showpetbyid": ":showPetById", + }, + }, + ":createPets": types.Tool{ + ToolDef: types.ToolDef{ + Parameters: types.Parameters{ + Name: "createPets", + Description: "Create a pet", + ModelName: "gpt-4o", + Arguments: &openapi3.Schema{ + Type: &openapi3.Types{ + "object", + }, + Required: []string{}, + Properties: openapi3.Schemas{"requestBodyContent": &openapi3.SchemaRef{Value: &openapi3.Schema{ + Type: &openapi3.Types{"object"}, + Required: []string{ + "id", + "name", + }, + Properties: openapi3.Schemas{ + "id": &openapi3.SchemaRef{ + Value: &openapi3.Schema{ + Type: &openapi3.Types{ + "integer", + }, + Format: "int64", + }, + }, + "name": &openapi3.SchemaRef{Value: &openapi3.Schema{Type: &openapi3.Types{"string"}}}, + "tag": &openapi3.SchemaRef{Value: &openapi3.Schema{Type: &openapi3.Types{"string"}}}, + }, + }}}, + }, + }, + Instructions: `#!sys.openapi '{"server":"http://petstore.swagger.io/v1","path":"/pets","method":"POST","bodyContentMIME":"application/json","apiKeyInfos":null,"queryParameters":null,"pathParameters":null,"headerParameters":null,"cookieParameters":null}'`, + }, + ID: ":createPets", + ToolMapping: map[string][]types.ToolReference{}, + LocalTools: map[string]string{ + "": ":", + "createpets": ":createPets", + "listpets": ":listPets", + "showpetbyid": ":showPetById", + }, + Source: types.ToolSource{LineNo: 2}, + }, + ":listPets": types.Tool{ + ToolDef: types.ToolDef{ + Parameters: types.Parameters{ + Name: "listPets", + Description: "List all pets", + ModelName: "gpt-4o", + Arguments: &openapi3.Schema{ + Type: &openapi3.Types{"object"}, + Required: []string{}, + Properties: openapi3.Schemas{"limit": &openapi3.SchemaRef{Value: &openapi3.Schema{ + Type: &openapi3.Types{"integer"}, + Format: "int32", + Description: "How many items to return at one time (max 100)", + Max: valast.Ptr(float64(100)), + }}}, + }, + }, + Instructions: `#!sys.openapi '{"server":"http://petstore.swagger.io/v1","path":"/pets","method":"GET","bodyContentMIME":"","apiKeyInfos":null,"queryParameters":[{"name":"limit","style":"","explode":null}],"pathParameters":null,"headerParameters":null,"cookieParameters":null}'`, + }, + ID: ":listPets", + ToolMapping: map[string][]types.ToolReference{}, + LocalTools: map[string]string{ + "": ":", + "createpets": ":createPets", + "listpets": ":listPets", + "showpetbyid": ":showPetById", + }, + Source: types.ToolSource{LineNo: 1}, + }, + ":showPetById": types.Tool{ + ToolDef: types.ToolDef{ + Parameters: types.Parameters{ + Name: "showPetById", + Description: "Info for a specific pet", + ModelName: "gpt-4o", + Arguments: &openapi3.Schema{ + Type: &openapi3.Types{"object"}, + Required: []string{"petId"}, + Properties: openapi3.Schemas{"petId": &openapi3.SchemaRef{Value: &openapi3.Schema{ + Type: &openapi3.Types{"string"}, + Description: "The id of the pet to retrieve", + }}}, + }, + }, + Instructions: `#!sys.openapi '{"server":"http://petstore.swagger.io/v1","path":"/pets/{petId}","method":"GET","bodyContentMIME":"","apiKeyInfos":null,"queryParameters":null,"pathParameters":[{"name":"petId","style":"","explode":null}],"headerParameters":null,"cookieParameters":null}'`, + }, + ID: ":showPetById", + ToolMapping: map[string][]types.ToolReference{}, + LocalTools: map[string]string{ + "": ":", + "createpets": ":createPets", + "listpets": ":listPets", + "showpetbyid": ":showPetById", + }, + Source: types.ToolSource{LineNo: 3}, + }, +} diff --git a/pkg/loader/testdata/openapi/TestOpenAPIv3NoOperationIDs.golden b/pkg/loader/testdata/openapi/TestOpenAPIv3NoOperationIDs.golden new file mode 100644 index 00000000..3bcfd9e5 --- /dev/null +++ b/pkg/loader/testdata/openapi/TestOpenAPIv3NoOperationIDs.golden @@ -0,0 +1,134 @@ +types.ToolSet{ + ":": types.Tool{ + ToolDef: types.ToolDef{Parameters: types.Parameters{ + Description: "This is a tool set for the Swagger Petstore OpenAPI spec", + ModelName: "gpt-4o", + Export: []string{ + "get_pets", + "post_pets", + "get_pets_petId", + }, + }}, + ID: ":", + ToolMapping: map[string][]types.ToolReference{ + "get_pets": {{ + Reference: "get_pets", + ToolID: ":get_pets", + }}, + "get_pets_petId": {{ + Reference: "get_pets_petId", + ToolID: ":get_pets_petId", + }}, + "post_pets": {{ + Reference: "post_pets", + ToolID: ":post_pets", + }}, + }, + LocalTools: map[string]string{ + "": ":", + "get_pets": ":get_pets", + "get_pets_petid": ":get_pets_petId", + "post_pets": ":post_pets", + }, + }, + ":get_pets": types.Tool{ + ToolDef: types.ToolDef{ + Parameters: types.Parameters{ + Name: "get_pets", + Description: "List all pets", + ModelName: "gpt-4o", + Arguments: &openapi3.Schema{ + Type: &openapi3.Types{ + "object", + }, + Required: []string{}, + Properties: openapi3.Schemas{"limit": &openapi3.SchemaRef{Value: &openapi3.Schema{ + Type: &openapi3.Types{"integer"}, + Format: "int32", + Description: "How many items to return at one time (max 100)", + Max: valast.Ptr(float64(100)), + }}}, + }, + }, + Instructions: `#!sys.openapi '{"server":"http://petstore.swagger.io/v1","path":"/pets","method":"GET","bodyContentMIME":"","apiKeyInfos":null,"queryParameters":[{"name":"limit","style":"","explode":null}],"pathParameters":null,"headerParameters":null,"cookieParameters":null}'`, + }, + ID: ":get_pets", + ToolMapping: map[string][]types.ToolReference{}, + LocalTools: map[string]string{ + "": ":", + "get_pets": ":get_pets", + "get_pets_petid": ":get_pets_petId", + "post_pets": ":post_pets", + }, + Source: types.ToolSource{LineNo: 1}, + }, + ":get_pets_petId": types.Tool{ + ToolDef: types.ToolDef{ + Parameters: types.Parameters{ + Name: "get_pets_petId", + Description: "Info for a specific pet", + ModelName: "gpt-4o", + Arguments: &openapi3.Schema{ + Type: &openapi3.Types{"object"}, + Required: []string{"petId"}, + Properties: openapi3.Schemas{"petId": &openapi3.SchemaRef{Value: &openapi3.Schema{ + Type: &openapi3.Types{"string"}, + Description: "The id of the pet to retrieve", + }}}, + }, + }, + Instructions: `#!sys.openapi '{"server":"http://petstore.swagger.io/v1","path":"/pets/{petId}","method":"GET","bodyContentMIME":"","apiKeyInfos":null,"queryParameters":null,"pathParameters":[{"name":"petId","style":"","explode":null}],"headerParameters":null,"cookieParameters":null}'`, + }, + ID: ":get_pets_petId", + ToolMapping: map[string][]types.ToolReference{}, + LocalTools: map[string]string{ + "": ":", + "get_pets": ":get_pets", + "get_pets_petid": ":get_pets_petId", + "post_pets": ":post_pets", + }, + Source: types.ToolSource{LineNo: 3}, + }, + ":post_pets": types.Tool{ + ToolDef: types.ToolDef{ + Parameters: types.Parameters{ + Name: "post_pets", + Description: "Create a pet", + ModelName: "gpt-4o", + Arguments: &openapi3.Schema{ + Type: &openapi3.Types{"object"}, + Required: []string{}, + Properties: openapi3.Schemas{"requestBodyContent": &openapi3.SchemaRef{Value: &openapi3.Schema{ + Type: &openapi3.Types{"object"}, + Required: []string{ + "id", + "name", + }, + Properties: openapi3.Schemas{ + "id": &openapi3.SchemaRef{ + Value: &openapi3.Schema{ + Type: &openapi3.Types{ + "integer", + }, + Format: "int64", + }, + }, + "name": &openapi3.SchemaRef{Value: &openapi3.Schema{Type: &openapi3.Types{"string"}}}, + "tag": &openapi3.SchemaRef{Value: &openapi3.Schema{Type: &openapi3.Types{"string"}}}, + }, + }}}, + }, + }, + Instructions: `#!sys.openapi '{"server":"http://petstore.swagger.io/v1","path":"/pets","method":"POST","bodyContentMIME":"application/json","apiKeyInfos":null,"queryParameters":null,"pathParameters":null,"headerParameters":null,"cookieParameters":null}'`, + }, + ID: ":post_pets", + ToolMapping: map[string][]types.ToolReference{}, + LocalTools: map[string]string{ + "": ":", + "get_pets": ":get_pets", + "get_pets_petid": ":get_pets_petId", + "post_pets": ":post_pets", + }, + Source: types.ToolSource{LineNo: 2}, + }, +} diff --git a/pkg/loader/testdata/openapi_v3_no_operation_ids.yaml b/pkg/loader/testdata/openapi_v3_no_operation_ids.yaml new file mode 100644 index 00000000..53e58b88 --- /dev/null +++ b/pkg/loader/testdata/openapi_v3_no_operation_ids.yaml @@ -0,0 +1,116 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore + license: + name: MIT +servers: + - url: http://petstore.swagger.io/v1 +paths: + /pets: + get: + summary: List all pets + tags: + - pets + parameters: + - name: limit + in: query + description: How many items to return at one time (max 100) + required: false + schema: + type: integer + maximum: 100 + format: int32 + responses: + '200': + description: A paged array of pets + headers: + x-next: + description: A link to the next page of responses + schema: + type: string + content: + application/json: + schema: + $ref: "#/components/schemas/Pets" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + summary: Create a pet + tags: + - pets + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + required: true + responses: + '201': + description: Null response + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /pets/{petId}: + get: + summary: Info for a specific pet + tags: + - pets + parameters: + - name: petId + in: path + required: true + description: The id of the pet to retrieve + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: "#/components/schemas/Pet" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" +components: + schemas: + Pet: + type: object + required: + - id + - name + properties: + id: + type: integer + format: int64 + name: + type: string + tag: + type: string + Pets: + type: array + maxItems: 100 + items: + $ref: "#/components/schemas/Pet" + Error: + type: object + required: + - code + - message + properties: + code: + type: integer + format: int32 + message: + type: string \ No newline at end of file From f90f56d812b452203de7878ed55b7203b4d5824b Mon Sep 17 00:00:00 2001 From: Nick Hale <4175918+njhale@users.noreply.github.com> Date: Tue, 2 Jul 2024 17:13:05 -0400 Subject: [PATCH 4/7] chore: bump tui for cred overrides Signed-off-by: Nick Hale <4175918+njhale@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 868dc060..36106b3f 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/gptscript-ai/broadcaster v0.0.0-20240625175512-c43682019b86 github.com/gptscript-ai/chat-completion-client v0.0.0-20240531200700-af8e7ecf0379 github.com/gptscript-ai/cmd v0.0.0-20240625175447-4250b42feb7d - github.com/gptscript-ai/tui v0.0.0-20240627044440-d416df63c10d + github.com/gptscript-ai/tui v0.0.0-20240702222655-901e7ec1faf5 github.com/hexops/autogold/v2 v2.2.1 github.com/hexops/valast v1.4.4 github.com/jaytaylor/html2text v0.0.0-20230321000545-74c2419ad056 @@ -62,7 +62,7 @@ require ( github.com/google/go-cmp v0.6.0 // indirect github.com/gookit/color v1.5.4 // indirect github.com/gorilla/css v1.0.0 // indirect - github.com/gptscript-ai/go-gptscript v0.0.0-20240625134437-4b83849794cc // indirect + github.com/gptscript-ai/go-gptscript v0.9.1 // indirect github.com/hashicorp/errwrap v1.0.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hexops/autogold v1.3.1 // indirect diff --git a/go.sum b/go.sum index 8a6d9dc8..9f29c3e4 100644 --- a/go.sum +++ b/go.sum @@ -171,10 +171,10 @@ github.com/gptscript-ai/chat-completion-client v0.0.0-20240531200700-af8e7ecf037 github.com/gptscript-ai/chat-completion-client v0.0.0-20240531200700-af8e7ecf0379/go.mod h1:7P/o6/IWa1KqsntVf68hSnLKuu3+xuqm6lYhch1w4jo= github.com/gptscript-ai/cmd v0.0.0-20240625175447-4250b42feb7d h1:sKf7T7twhGXs6AVbvD9pKDVewykkwSAPwEpmIEQIR/4= github.com/gptscript-ai/cmd v0.0.0-20240625175447-4250b42feb7d/go.mod h1:DJAo1xTht1LDkNYFNydVjTHd576TC7MlpsVRl3oloVw= -github.com/gptscript-ai/go-gptscript v0.0.0-20240625134437-4b83849794cc h1:ABV7VAK65YBkqL7VlNp5ryVXnRqkKQ+U/NZfUO3ypqA= -github.com/gptscript-ai/go-gptscript v0.0.0-20240625134437-4b83849794cc/go.mod h1:Dh6vYRAiVcyC3ElZIGzTvNF1FxtYwA07BHfSiFKQY7s= -github.com/gptscript-ai/tui v0.0.0-20240627044440-d416df63c10d h1:hbJ5rkwMDDntqbvHMbsEoP8Nsa5nqTOzF+ktkw3uDQQ= -github.com/gptscript-ai/tui v0.0.0-20240627044440-d416df63c10d/go.mod h1:NwFdBDmGQvjLFFDnSRBRakkhw0MIO1sSdRnWNk4cCQ0= +github.com/gptscript-ai/go-gptscript v0.9.1 h1:O9oSmYvzQ2GZkPfDhXpiMGdtO9BMCVGeWLdJH88AJzg= +github.com/gptscript-ai/go-gptscript v0.9.1/go.mod h1:Dh6vYRAiVcyC3ElZIGzTvNF1FxtYwA07BHfSiFKQY7s= +github.com/gptscript-ai/tui v0.0.0-20240702222655-901e7ec1faf5 h1:qCNJVFDHT2p0cuLo920DmUQoUngAuXGgqldYNwmC/R0= +github.com/gptscript-ai/tui v0.0.0-20240702222655-901e7ec1faf5/go.mod h1:mYzM8AwIiAdImy2g0BsdTPPuSbsONTMw5GIHDc/2o7g= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= From be843033189d9005c1f493283102cc22dbd1051c Mon Sep 17 00:00:00 2001 From: Nick Hale <4175918+njhale@users.noreply.github.com> Date: Tue, 2 Jul 2024 17:13:37 -0400 Subject: [PATCH 5/7] enhance: pass cred overrides to tui Make cred overrides work when using the TUI. Signed-off-by: Nick Hale <4175918+njhale@users.noreply.github.com> --- pkg/cli/gptscript.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/cli/gptscript.go b/pkg/cli/gptscript.go index 865b3873..4820efd8 100644 --- a/pkg/cli/gptscript.go +++ b/pkg/cli/gptscript.go @@ -472,6 +472,7 @@ func (r *GPTScript) Run(cmd *cobra.Command, args []string) (retErr error) { DefaultModel: r.DefaultModel, TrustedRepoPrefixes: []string{"github.com/gptscript-ai"}, DisableCache: r.DisableCache, + CredentialOverrides: r.CredentialOverride, Input: toolInput, CacheDir: r.CacheDir, SubTool: r.SubTool, From ce0d86765c5566c1c0818d31d2a6c98470fd795a Mon Sep 17 00:00:00 2001 From: Nick Hale <4175918+njhale@users.noreply.github.com> Date: Tue, 2 Jul 2024 19:47:03 -0400 Subject: [PATCH 6/7] chore: add smoke tests for claude-3-5-sonnet Signed-off-by: Nick Hale <4175918+njhale@users.noreply.github.com> --- .github/workflows/smoke.yaml | 32 +- .../claude-3-5-sonnet-20240620-expected.json | 929 ++++++++++++++++++ .../claude-3-5-sonnet-20240620-expected.json | 878 +++++++++++++++++ 3 files changed, 1838 insertions(+), 1 deletion(-) create mode 100644 pkg/tests/smoke/testdata/Bob/claude-3-5-sonnet-20240620-expected.json create mode 100644 pkg/tests/smoke/testdata/BobAsShell/claude-3-5-sonnet-20240620-expected.json diff --git a/.github/workflows/smoke.yaml b/.github/workflows/smoke.yaml index 5c26ef8d..a687e684 100644 --- a/.github/workflows/smoke.yaml +++ b/.github/workflows/smoke.yaml @@ -148,6 +148,37 @@ jobs: export PATH="$(pwd)/bin:${PATH}" make smoke + claude-3-5-sonnet-20240620: + needs: check-label + if: ${{ needs.check-label.outputs.run_smoke_tests == 'true' }} + runs-on: ubuntu-22.04 + steps: + - name: Checkout base repository + uses: actions/checkout@v4 + with: + fetch-depth: 1 + - name: Checkout PR code if running for a PR + if: ${{ github.event_name == 'pull_request_target' }} + uses: actions/checkout@v4 + with: + fetch-depth: 1 + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.event.pull_request.head.ref }} + - uses: actions/setup-go@v5 + with: + cache: false + go-version: "1.21" + - env: + OPENAI_API_KEY: ${{ secrets.SMOKE_OPENAI_API_KEY }} + GPTSCRIPT_DEFAULT_MODEL: claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider + ANTHROPIC_API_KEY: ${{ secrets.SMOKE_ANTHROPIC_API_KEY }} + GPTSCRIPT_CREDENTIAL_OVERRIDE: "github.com/gptscript-ai/claude3-anthropic-provider/credential:ANTHROPIC_API_KEY" + name: Run smoke test for claude-3-5-sonnet-20240620 + run: | + echo "Running smoke test for model claude-3-5-sonnet-20240620" + export PATH="$(pwd)/bin:${PATH}" + make smoke + mistral-large-2402: needs: check-label if: ${{ needs.check-label.outputs.run_smoke_tests == 'true' }} @@ -177,4 +208,3 @@ jobs: echo "Running smoke test for model mistral-large-2402" export PATH="$(pwd)/bin:${PATH}" make smoke - diff --git a/pkg/tests/smoke/testdata/Bob/claude-3-5-sonnet-20240620-expected.json b/pkg/tests/smoke/testdata/Bob/claude-3-5-sonnet-20240620-expected.json new file mode 100644 index 00000000..63673b21 --- /dev/null +++ b/pkg/tests/smoke/testdata/Bob/claude-3-5-sonnet-20240620-expected.json @@ -0,0 +1,929 @@ +[ + { + "time": "2024-07-02T19:39:41.734737-04:00", + "type": "runStart", + "usage": {} + }, + { + "time": "2024-07-02T19:39:41.735252-04:00", + "callContext": { + "id": "1719963582", + "tool": { + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "tools": [ + "bob" + ], + "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", + "id": "testdata/Bob/test.gpt:", + "toolMapping": { + "bob": [ + { + "reference": "bob", + "toolID": "testdata/Bob/test.gpt:bob" + } + ] + }, + "localTools": { + "": "testdata/Bob/test.gpt:", + "bob": "testdata/Bob/test.gpt:bob" + }, + "source": { + "location": "testdata/Bob/test.gpt", + "lineNo": 1 + }, + "workingDir": "testdata/Bob" + }, + "currentAgent": {}, + "inputContext": null + }, + "type": "callStart", + "usage": {} + }, + { + "time": "2024-07-02T19:39:42.643066-04:00", + "type": "runStart", + "usage": {} + }, + { + "time": "2024-07-02T19:39:42.643356-04:00", + "callContext": { + "id": "1719963583", + "tool": { + "name": "Anthropic Claude3 Model Provider", + "description": "Model provider for Anthropic hosted Claude3 models", + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "modelProvider": true, + "internalPrompt": null, + "credentials": [ + "github.com/gptscript-ai/credential as github.com/gptscript-ai/claude3-anthropic-provider/credential with \"Please enter your Anthropic API Key\" as message and token as field and \"ANTHROPIC_API_KEY\" as env" + ], + "instructions": "#!sys.daemon /usr/bin/env python3 ${GPTSCRIPT_TOOL_DIR}/main.py", + "id": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/6b5a88075b1e4501e845f4dab5be16ea8739aa4c/tool.gpt:Anthropic Claude3 Model Provider", + "toolMapping": { + "github.com/gptscript-ai/credential as github.com/gptscript-ai/claude3-anthropic-provider/credential with \"Please enter your Anthropic API Key\" as message and token as field and \"ANTHROPIC_API_KEY\" as env": [ + { + "reference": "github.com/gptscript-ai/credential as github.com/gptscript-ai/claude3-anthropic-provider/credential with \"Please enter your Anthropic API Key\" as message and token as field and \"ANTHROPIC_API_KEY\" as env", + "toolID": "https://raw.githubusercontent.com/gptscript-ai/credential/651dfad6e7cf3a385ef408afa93ce522c10f8508/tool.gpt:token" + } + ] + }, + "localTools": { + "anthropic claude3 model provider": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/6b5a88075b1e4501e845f4dab5be16ea8739aa4c/tool.gpt:Anthropic Claude3 Model Provider" + }, + "source": { + "location": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/6b5a88075b1e4501e845f4dab5be16ea8739aa4c/tool.gpt", + "lineNo": 1, + "repo": { + "VCS": "git", + "Root": "https://github.com/gptscript-ai/claude3-anthropic-provider.git", + "Path": "/", + "Name": "tool.gpt", + "Revision": "6b5a88075b1e4501e845f4dab5be16ea8739aa4c" + } + }, + "workingDir": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/6b5a88075b1e4501e845f4dab5be16ea8739aa4c" + }, + "currentAgent": {}, + "inputContext": null, + "toolCategory": "provider", + "displayText": "Running sys.daemon" + }, + "type": "callStart", + "usage": {} + }, + { + "time": "2024-07-02T19:39:43.666188-04:00", + "callContext": { + "id": "1719963583", + "tool": { + "name": "Anthropic Claude3 Model Provider", + "description": "Model provider for Anthropic hosted Claude3 models", + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "modelProvider": true, + "internalPrompt": null, + "credentials": [ + "github.com/gptscript-ai/credential as github.com/gptscript-ai/claude3-anthropic-provider/credential with \"Please enter your Anthropic API Key\" as message and token as field and \"ANTHROPIC_API_KEY\" as env" + ], + "instructions": "#!sys.daemon /usr/bin/env python3 ${GPTSCRIPT_TOOL_DIR}/main.py", + "id": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/6b5a88075b1e4501e845f4dab5be16ea8739aa4c/tool.gpt:Anthropic Claude3 Model Provider", + "toolMapping": { + "github.com/gptscript-ai/credential as github.com/gptscript-ai/claude3-anthropic-provider/credential with \"Please enter your Anthropic API Key\" as message and token as field and \"ANTHROPIC_API_KEY\" as env": [ + { + "reference": "github.com/gptscript-ai/credential as github.com/gptscript-ai/claude3-anthropic-provider/credential with \"Please enter your Anthropic API Key\" as message and token as field and \"ANTHROPIC_API_KEY\" as env", + "toolID": "https://raw.githubusercontent.com/gptscript-ai/credential/651dfad6e7cf3a385ef408afa93ce522c10f8508/tool.gpt:token" + } + ] + }, + "localTools": { + "anthropic claude3 model provider": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/6b5a88075b1e4501e845f4dab5be16ea8739aa4c/tool.gpt:Anthropic Claude3 Model Provider" + }, + "source": { + "location": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/6b5a88075b1e4501e845f4dab5be16ea8739aa4c/tool.gpt", + "lineNo": 1, + "repo": { + "VCS": "git", + "Root": "https://github.com/gptscript-ai/claude3-anthropic-provider.git", + "Path": "/", + "Name": "tool.gpt", + "Revision": "6b5a88075b1e4501e845f4dab5be16ea8739aa4c" + } + }, + "workingDir": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/6b5a88075b1e4501e845f4dab5be16ea8739aa4c" + }, + "currentAgent": {}, + "inputContext": null, + "toolCategory": "provider", + "displayText": "Running sys.daemon" + }, + "type": "callFinish", + "usage": {}, + "content": "http://127.0.0.1:10887" + }, + { + "time": "2024-07-02T19:39:43.666385-04:00", + "type": "runFinish", + "usage": {} + }, + { + "time": "2024-07-02T19:39:43.666475-04:00", + "callContext": { + "id": "1719963582", + "tool": { + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "tools": [ + "bob" + ], + "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", + "id": "testdata/Bob/test.gpt:", + "toolMapping": { + "bob": [ + { + "reference": "bob", + "toolID": "testdata/Bob/test.gpt:bob" + } + ] + }, + "localTools": { + "": "testdata/Bob/test.gpt:", + "bob": "testdata/Bob/test.gpt:bob" + }, + "source": { + "location": "testdata/Bob/test.gpt", + "lineNo": 1 + }, + "workingDir": "testdata/Bob" + }, + "currentAgent": {}, + "inputContext": null + }, + "type": "callChat", + "chatCompletionId": "1719963584", + "usage": {}, + "chatRequest": { + "model": "claude-3-5-sonnet-20240620", + "messages": [ + { + "role": "system", + "content": "Ask Bob \"how are you doing\" and repeat his reply exactly." + } + ], + "temperature": 0, + "tools": [ + { + "type": "function", + "function": { + "name": "bob", + "description": "I'm Bob, a friendly guy.", + "parameters": { + "properties": { + "question": { + "description": "The question to ask Bob.", + "type": "string" + } + }, + "type": "object" + } + } + } + ] + } + }, + { + "time": "2024-07-02T19:39:43.66707-04:00", + "callContext": { + "id": "1719963582", + "tool": { + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "tools": [ + "bob" + ], + "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", + "id": "testdata/Bob/test.gpt:", + "toolMapping": { + "bob": [ + { + "reference": "bob", + "toolID": "testdata/Bob/test.gpt:bob" + } + ] + }, + "localTools": { + "": "testdata/Bob/test.gpt:", + "bob": "testdata/Bob/test.gpt:bob" + }, + "source": { + "location": "testdata/Bob/test.gpt", + "lineNo": 1 + }, + "workingDir": "testdata/Bob" + }, + "currentAgent": {}, + "inputContext": null + }, + "type": "callProgress", + "chatCompletionId": "1719963584", + "usage": {}, + "content": "Waiting for model response..." + }, + { + "time": "2024-07-02T19:39:45.331397-04:00", + "callContext": { + "id": "1719963582", + "tool": { + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "tools": [ + "bob" + ], + "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", + "id": "testdata/Bob/test.gpt:", + "toolMapping": { + "bob": [ + { + "reference": "bob", + "toolID": "testdata/Bob/test.gpt:bob" + } + ] + }, + "localTools": { + "": "testdata/Bob/test.gpt:", + "bob": "testdata/Bob/test.gpt:bob" + }, + "source": { + "location": "testdata/Bob/test.gpt", + "lineNo": 1 + }, + "workingDir": "testdata/Bob" + }, + "currentAgent": {}, + "inputContext": null + }, + "type": "callProgress", + "chatCompletionId": "1719963584", + "usage": {}, + "content": "\u003ctool call\u003e bob -\u003e {\"question\": \"how are you doing\"}" + }, + { + "time": "2024-07-02T19:39:45.332721-04:00", + "callContext": { + "id": "1719963582", + "tool": { + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "tools": [ + "bob" + ], + "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", + "id": "testdata/Bob/test.gpt:", + "toolMapping": { + "bob": [ + { + "reference": "bob", + "toolID": "testdata/Bob/test.gpt:bob" + } + ] + }, + "localTools": { + "": "testdata/Bob/test.gpt:", + "bob": "testdata/Bob/test.gpt:bob" + }, + "source": { + "location": "testdata/Bob/test.gpt", + "lineNo": 1 + }, + "workingDir": "testdata/Bob" + }, + "currentAgent": {}, + "inputContext": null + }, + "type": "callChat", + "chatCompletionId": "1719963584", + "usage": {}, + "chatResponse": { + "role": "assistant", + "content": [ + { + "toolCall": { + "index": 0, + "id": "toolu_01XLGhfvziYUf8rFoQEbvw4P", + "function": { + "name": "bob", + "arguments": "{\"question\": \"how are you doing\"}" + } + } + } + ], + "usage": {} + } + }, + { + "time": "2024-07-02T19:39:45.332824-04:00", + "callContext": { + "id": "1719963582", + "tool": { + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "tools": [ + "bob" + ], + "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", + "id": "testdata/Bob/test.gpt:", + "toolMapping": { + "bob": [ + { + "reference": "bob", + "toolID": "testdata/Bob/test.gpt:bob" + } + ] + }, + "localTools": { + "": "testdata/Bob/test.gpt:", + "bob": "testdata/Bob/test.gpt:bob" + }, + "source": { + "location": "testdata/Bob/test.gpt", + "lineNo": 1 + }, + "workingDir": "testdata/Bob" + }, + "currentAgent": {}, + "inputContext": null + }, + "toolSubCalls": { + "toolu_01XLGhfvziYUf8rFoQEbvw4P": { + "toolID": "testdata/Bob/test.gpt:bob", + "input": "{\"question\": \"how are you doing\"}" + } + }, + "type": "callSubCalls", + "usage": {} + }, + { + "time": "2024-07-02T19:39:45.332869-04:00", + "callContext": { + "id": "toolu_01XLGhfvziYUf8rFoQEbvw4P", + "tool": { + "name": "bob", + "description": "I'm Bob, a friendly guy.", + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "arguments": { + "properties": { + "question": { + "description": "The question to ask Bob.", + "type": "string" + } + }, + "type": "object" + }, + "instructions": "When asked how I am doing, respond with exactly \"Thanks for asking \"${question}\", I'm doing great fellow friendly AI tool!\"", + "id": "testdata/Bob/test.gpt:bob", + "localTools": { + "": "testdata/Bob/test.gpt:", + "bob": "testdata/Bob/test.gpt:bob" + }, + "source": { + "location": "testdata/Bob/test.gpt", + "lineNo": 6 + }, + "workingDir": "testdata/Bob" + }, + "currentAgent": {}, + "inputContext": null, + "toolName": "bob", + "parentID": "1719963582" + }, + "type": "callStart", + "usage": {}, + "content": "{\"question\": \"how are you doing\"}" + }, + { + "time": "2024-07-02T19:39:45.487113-04:00", + "callContext": { + "id": "toolu_01XLGhfvziYUf8rFoQEbvw4P", + "tool": { + "name": "bob", + "description": "I'm Bob, a friendly guy.", + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "arguments": { + "properties": { + "question": { + "description": "The question to ask Bob.", + "type": "string" + } + }, + "type": "object" + }, + "instructions": "When asked how I am doing, respond with exactly \"Thanks for asking \"${question}\", I'm doing great fellow friendly AI tool!\"", + "id": "testdata/Bob/test.gpt:bob", + "localTools": { + "": "testdata/Bob/test.gpt:", + "bob": "testdata/Bob/test.gpt:bob" + }, + "source": { + "location": "testdata/Bob/test.gpt", + "lineNo": 6 + }, + "workingDir": "testdata/Bob" + }, + "currentAgent": {}, + "inputContext": null, + "toolName": "bob", + "parentID": "1719963582" + }, + "type": "callChat", + "chatCompletionId": "1719963585", + "usage": {}, + "chatRequest": { + "model": "claude-3-5-sonnet-20240620", + "messages": [ + { + "role": "system", + "content": "When asked how I am doing, respond with exactly \"Thanks for asking \"${question}\", I'm doing great fellow friendly AI tool!\"" + }, + { + "role": "user", + "content": "{\"question\": \"how are you doing\"}" + } + ], + "temperature": 0 + } + }, + { + "time": "2024-07-02T19:39:45.487696-04:00", + "callContext": { + "id": "toolu_01XLGhfvziYUf8rFoQEbvw4P", + "tool": { + "name": "bob", + "description": "I'm Bob, a friendly guy.", + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "arguments": { + "properties": { + "question": { + "description": "The question to ask Bob.", + "type": "string" + } + }, + "type": "object" + }, + "instructions": "When asked how I am doing, respond with exactly \"Thanks for asking \"${question}\", I'm doing great fellow friendly AI tool!\"", + "id": "testdata/Bob/test.gpt:bob", + "localTools": { + "": "testdata/Bob/test.gpt:", + "bob": "testdata/Bob/test.gpt:bob" + }, + "source": { + "location": "testdata/Bob/test.gpt", + "lineNo": 6 + }, + "workingDir": "testdata/Bob" + }, + "currentAgent": {}, + "inputContext": null, + "toolName": "bob", + "parentID": "1719963582" + }, + "type": "callProgress", + "chatCompletionId": "1719963585", + "usage": {}, + "content": "Waiting for model response..." + }, + { + "time": "2024-07-02T19:39:46.547634-04:00", + "callContext": { + "id": "toolu_01XLGhfvziYUf8rFoQEbvw4P", + "tool": { + "name": "bob", + "description": "I'm Bob, a friendly guy.", + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "arguments": { + "properties": { + "question": { + "description": "The question to ask Bob.", + "type": "string" + } + }, + "type": "object" + }, + "instructions": "When asked how I am doing, respond with exactly \"Thanks for asking \"${question}\", I'm doing great fellow friendly AI tool!\"", + "id": "testdata/Bob/test.gpt:bob", + "localTools": { + "": "testdata/Bob/test.gpt:", + "bob": "testdata/Bob/test.gpt:bob" + }, + "source": { + "location": "testdata/Bob/test.gpt", + "lineNo": 6 + }, + "workingDir": "testdata/Bob" + }, + "currentAgent": {}, + "inputContext": null, + "toolName": "bob", + "parentID": "1719963582" + }, + "type": "callProgress", + "chatCompletionId": "1719963585", + "usage": {}, + "content": "Thanks for asking \"how are you doing\", I'm doing great fellow friendly AI tool!" + }, + { + "time": "2024-07-02T19:39:46.549112-04:00", + "callContext": { + "id": "toolu_01XLGhfvziYUf8rFoQEbvw4P", + "tool": { + "name": "bob", + "description": "I'm Bob, a friendly guy.", + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "arguments": { + "properties": { + "question": { + "description": "The question to ask Bob.", + "type": "string" + } + }, + "type": "object" + }, + "instructions": "When asked how I am doing, respond with exactly \"Thanks for asking \"${question}\", I'm doing great fellow friendly AI tool!\"", + "id": "testdata/Bob/test.gpt:bob", + "localTools": { + "": "testdata/Bob/test.gpt:", + "bob": "testdata/Bob/test.gpt:bob" + }, + "source": { + "location": "testdata/Bob/test.gpt", + "lineNo": 6 + }, + "workingDir": "testdata/Bob" + }, + "currentAgent": {}, + "inputContext": null, + "toolName": "bob", + "parentID": "1719963582" + }, + "type": "callChat", + "chatCompletionId": "1719963585", + "usage": {}, + "chatResponse": { + "role": "assistant", + "content": [ + { + "text": "Thanks for asking \"how are you doing\", I'm doing great fellow friendly AI tool!" + } + ], + "usage": {} + } + }, + { + "time": "2024-07-02T19:39:46.549192-04:00", + "callContext": { + "id": "toolu_01XLGhfvziYUf8rFoQEbvw4P", + "tool": { + "name": "bob", + "description": "I'm Bob, a friendly guy.", + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "arguments": { + "properties": { + "question": { + "description": "The question to ask Bob.", + "type": "string" + } + }, + "type": "object" + }, + "instructions": "When asked how I am doing, respond with exactly \"Thanks for asking \"${question}\", I'm doing great fellow friendly AI tool!\"", + "id": "testdata/Bob/test.gpt:bob", + "localTools": { + "": "testdata/Bob/test.gpt:", + "bob": "testdata/Bob/test.gpt:bob" + }, + "source": { + "location": "testdata/Bob/test.gpt", + "lineNo": 6 + }, + "workingDir": "testdata/Bob" + }, + "currentAgent": {}, + "inputContext": null, + "toolName": "bob", + "parentID": "1719963582" + }, + "type": "callFinish", + "usage": {}, + "content": "Thanks for asking \"how are you doing\", I'm doing great fellow friendly AI tool!" + }, + { + "time": "2024-07-02T19:39:46.549253-04:00", + "callContext": { + "id": "1719963582", + "tool": { + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "tools": [ + "bob" + ], + "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", + "id": "testdata/Bob/test.gpt:", + "toolMapping": { + "bob": [ + { + "reference": "bob", + "toolID": "testdata/Bob/test.gpt:bob" + } + ] + }, + "localTools": { + "": "testdata/Bob/test.gpt:", + "bob": "testdata/Bob/test.gpt:bob" + }, + "source": { + "location": "testdata/Bob/test.gpt", + "lineNo": 1 + }, + "workingDir": "testdata/Bob" + }, + "currentAgent": {}, + "inputContext": null + }, + "toolResults": 1, + "type": "callContinue", + "usage": {} + }, + { + "time": "2024-07-02T19:39:46.710406-04:00", + "callContext": { + "id": "1719963582", + "tool": { + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "tools": [ + "bob" + ], + "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", + "id": "testdata/Bob/test.gpt:", + "toolMapping": { + "bob": [ + { + "reference": "bob", + "toolID": "testdata/Bob/test.gpt:bob" + } + ] + }, + "localTools": { + "": "testdata/Bob/test.gpt:", + "bob": "testdata/Bob/test.gpt:bob" + }, + "source": { + "location": "testdata/Bob/test.gpt", + "lineNo": 1 + }, + "workingDir": "testdata/Bob" + }, + "currentAgent": {}, + "inputContext": null + }, + "type": "callChat", + "chatCompletionId": "1719963586", + "usage": {}, + "chatRequest": { + "model": "claude-3-5-sonnet-20240620", + "messages": [ + { + "role": "system", + "content": "Ask Bob \"how are you doing\" and repeat his reply exactly." + }, + { + "role": "assistant", + "content": "", + "tool_calls": [ + { + "id": "toolu_01XLGhfvziYUf8rFoQEbvw4P", + "type": "function", + "function": { + "name": "bob", + "arguments": "{\"question\": \"how are you doing\"}" + } + } + ] + }, + { + "role": "tool", + "content": "Thanks for asking \"how are you doing\", I'm doing great fellow friendly AI tool!", + "name": "bob", + "tool_call_id": "toolu_01XLGhfvziYUf8rFoQEbvw4P" + } + ], + "temperature": 0, + "tools": [ + { + "type": "function", + "function": { + "name": "bob", + "description": "I'm Bob, a friendly guy.", + "parameters": { + "properties": { + "question": { + "description": "The question to ask Bob.", + "type": "string" + } + }, + "type": "object" + } + } + } + ] + } + }, + { + "time": "2024-07-02T19:39:46.710675-04:00", + "callContext": { + "id": "1719963582", + "tool": { + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "tools": [ + "bob" + ], + "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", + "id": "testdata/Bob/test.gpt:", + "toolMapping": { + "bob": [ + { + "reference": "bob", + "toolID": "testdata/Bob/test.gpt:bob" + } + ] + }, + "localTools": { + "": "testdata/Bob/test.gpt:", + "bob": "testdata/Bob/test.gpt:bob" + }, + "source": { + "location": "testdata/Bob/test.gpt", + "lineNo": 1 + }, + "workingDir": "testdata/Bob" + }, + "currentAgent": {}, + "inputContext": null + }, + "type": "callProgress", + "chatCompletionId": "1719963586", + "usage": {}, + "content": "Waiting for model response..." + }, + { + "time": "2024-07-02T19:39:48.861353-04:00", + "callContext": { + "id": "1719963582", + "tool": { + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "tools": [ + "bob" + ], + "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", + "id": "testdata/Bob/test.gpt:", + "toolMapping": { + "bob": [ + { + "reference": "bob", + "toolID": "testdata/Bob/test.gpt:bob" + } + ] + }, + "localTools": { + "": "testdata/Bob/test.gpt:", + "bob": "testdata/Bob/test.gpt:bob" + }, + "source": { + "location": "testdata/Bob/test.gpt", + "lineNo": 1 + }, + "workingDir": "testdata/Bob" + }, + "currentAgent": {}, + "inputContext": null + }, + "type": "callProgress", + "chatCompletionId": "1719963586", + "usage": {}, + "content": "Bob's reply to the question \"how are you doing\" is:\n\n\"Thanks for asking \"how are you doing\", I'm doing great fellow friendly AI tool!\"\n\nI have repeated his reply exactly as requested." + }, + { + "time": "2024-07-02T19:39:48.862116-04:00", + "callContext": { + "id": "1719963582", + "tool": { + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "tools": [ + "bob" + ], + "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", + "id": "testdata/Bob/test.gpt:", + "toolMapping": { + "bob": [ + { + "reference": "bob", + "toolID": "testdata/Bob/test.gpt:bob" + } + ] + }, + "localTools": { + "": "testdata/Bob/test.gpt:", + "bob": "testdata/Bob/test.gpt:bob" + }, + "source": { + "location": "testdata/Bob/test.gpt", + "lineNo": 1 + }, + "workingDir": "testdata/Bob" + }, + "currentAgent": {}, + "inputContext": null + }, + "type": "callChat", + "chatCompletionId": "1719963586", + "usage": {}, + "chatResponse": { + "role": "assistant", + "content": [ + { + "text": "Bob's reply to the question \"how are you doing\" is:\n\n\"Thanks for asking \"how are you doing\", I'm doing great fellow friendly AI tool!\"\n\nI have repeated his reply exactly as requested." + } + ], + "usage": {} + } + }, + { + "time": "2024-07-02T19:39:48.862154-04:00", + "callContext": { + "id": "1719963582", + "tool": { + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "tools": [ + "bob" + ], + "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", + "id": "testdata/Bob/test.gpt:", + "toolMapping": { + "bob": [ + { + "reference": "bob", + "toolID": "testdata/Bob/test.gpt:bob" + } + ] + }, + "localTools": { + "": "testdata/Bob/test.gpt:", + "bob": "testdata/Bob/test.gpt:bob" + }, + "source": { + "location": "testdata/Bob/test.gpt", + "lineNo": 1 + }, + "workingDir": "testdata/Bob" + }, + "currentAgent": {}, + "inputContext": null + }, + "type": "callFinish", + "usage": {}, + "content": "Bob's reply to the question \"how are you doing\" is:\n\n\"Thanks for asking \"how are you doing\", I'm doing great fellow friendly AI tool!\"\n\nI have repeated his reply exactly as requested." + }, + { + "time": "2024-07-02T19:39:48.862164-04:00", + "type": "runFinish", + "usage": {} + } +] diff --git a/pkg/tests/smoke/testdata/BobAsShell/claude-3-5-sonnet-20240620-expected.json b/pkg/tests/smoke/testdata/BobAsShell/claude-3-5-sonnet-20240620-expected.json new file mode 100644 index 00000000..4f3dd9d7 --- /dev/null +++ b/pkg/tests/smoke/testdata/BobAsShell/claude-3-5-sonnet-20240620-expected.json @@ -0,0 +1,878 @@ +[ + { + "time": "2024-07-02T19:39:48.881112-04:00", + "type": "runStart", + "usage": {} + }, + { + "time": "2024-07-02T19:39:48.881306-04:00", + "callContext": { + "id": "1719963589", + "tool": { + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "tools": [ + "bob" + ], + "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", + "id": "testdata/BobAsShell/test.gpt:", + "toolMapping": { + "bob": [ + { + "reference": "bob", + "toolID": "testdata/BobAsShell/test.gpt:bob" + } + ] + }, + "localTools": { + "": "testdata/BobAsShell/test.gpt:", + "bob": "testdata/BobAsShell/test.gpt:bob" + }, + "source": { + "location": "testdata/BobAsShell/test.gpt", + "lineNo": 1 + }, + "workingDir": "testdata/BobAsShell" + }, + "currentAgent": {}, + "inputContext": null + }, + "type": "callStart", + "usage": {} + }, + { + "time": "2024-07-02T19:39:49.304999-04:00", + "type": "runStart", + "usage": {} + }, + { + "time": "2024-07-02T19:39:49.305331-04:00", + "callContext": { + "id": "1719963590", + "tool": { + "name": "Anthropic Claude3 Model Provider", + "description": "Model provider for Anthropic hosted Claude3 models", + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "modelProvider": true, + "internalPrompt": null, + "credentials": [ + "github.com/gptscript-ai/credential as github.com/gptscript-ai/claude3-anthropic-provider/credential with \"Please enter your Anthropic API Key\" as message and token as field and \"ANTHROPIC_API_KEY\" as env" + ], + "instructions": "#!sys.daemon /usr/bin/env python3 ${GPTSCRIPT_TOOL_DIR}/main.py", + "id": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/6b5a88075b1e4501e845f4dab5be16ea8739aa4c/tool.gpt:Anthropic Claude3 Model Provider", + "toolMapping": { + "github.com/gptscript-ai/credential as github.com/gptscript-ai/claude3-anthropic-provider/credential with \"Please enter your Anthropic API Key\" as message and token as field and \"ANTHROPIC_API_KEY\" as env": [ + { + "reference": "github.com/gptscript-ai/credential as github.com/gptscript-ai/claude3-anthropic-provider/credential with \"Please enter your Anthropic API Key\" as message and token as field and \"ANTHROPIC_API_KEY\" as env", + "toolID": "https://raw.githubusercontent.com/gptscript-ai/credential/651dfad6e7cf3a385ef408afa93ce522c10f8508/tool.gpt:token" + } + ] + }, + "localTools": { + "anthropic claude3 model provider": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/6b5a88075b1e4501e845f4dab5be16ea8739aa4c/tool.gpt:Anthropic Claude3 Model Provider" + }, + "source": { + "location": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/6b5a88075b1e4501e845f4dab5be16ea8739aa4c/tool.gpt", + "lineNo": 1, + "repo": { + "VCS": "git", + "Root": "https://github.com/gptscript-ai/claude3-anthropic-provider.git", + "Path": "/", + "Name": "tool.gpt", + "Revision": "6b5a88075b1e4501e845f4dab5be16ea8739aa4c" + } + }, + "workingDir": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/6b5a88075b1e4501e845f4dab5be16ea8739aa4c" + }, + "currentAgent": {}, + "inputContext": null, + "toolCategory": "provider", + "displayText": "Running sys.daemon" + }, + "type": "callStart", + "usage": {} + }, + { + "time": "2024-07-02T19:39:50.324048-04:00", + "callContext": { + "id": "1719963590", + "tool": { + "name": "Anthropic Claude3 Model Provider", + "description": "Model provider for Anthropic hosted Claude3 models", + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "modelProvider": true, + "internalPrompt": null, + "credentials": [ + "github.com/gptscript-ai/credential as github.com/gptscript-ai/claude3-anthropic-provider/credential with \"Please enter your Anthropic API Key\" as message and token as field and \"ANTHROPIC_API_KEY\" as env" + ], + "instructions": "#!sys.daemon /usr/bin/env python3 ${GPTSCRIPT_TOOL_DIR}/main.py", + "id": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/6b5a88075b1e4501e845f4dab5be16ea8739aa4c/tool.gpt:Anthropic Claude3 Model Provider", + "toolMapping": { + "github.com/gptscript-ai/credential as github.com/gptscript-ai/claude3-anthropic-provider/credential with \"Please enter your Anthropic API Key\" as message and token as field and \"ANTHROPIC_API_KEY\" as env": [ + { + "reference": "github.com/gptscript-ai/credential as github.com/gptscript-ai/claude3-anthropic-provider/credential with \"Please enter your Anthropic API Key\" as message and token as field and \"ANTHROPIC_API_KEY\" as env", + "toolID": "https://raw.githubusercontent.com/gptscript-ai/credential/651dfad6e7cf3a385ef408afa93ce522c10f8508/tool.gpt:token" + } + ] + }, + "localTools": { + "anthropic claude3 model provider": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/6b5a88075b1e4501e845f4dab5be16ea8739aa4c/tool.gpt:Anthropic Claude3 Model Provider" + }, + "source": { + "location": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/6b5a88075b1e4501e845f4dab5be16ea8739aa4c/tool.gpt", + "lineNo": 1, + "repo": { + "VCS": "git", + "Root": "https://github.com/gptscript-ai/claude3-anthropic-provider.git", + "Path": "/", + "Name": "tool.gpt", + "Revision": "6b5a88075b1e4501e845f4dab5be16ea8739aa4c" + } + }, + "workingDir": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/6b5a88075b1e4501e845f4dab5be16ea8739aa4c" + }, + "currentAgent": {}, + "inputContext": null, + "toolCategory": "provider", + "displayText": "Running sys.daemon" + }, + "type": "callFinish", + "usage": {}, + "content": "http://127.0.0.1:10585" + }, + { + "time": "2024-07-02T19:39:50.324287-04:00", + "type": "runFinish", + "usage": {} + }, + { + "time": "2024-07-02T19:39:50.324366-04:00", + "callContext": { + "id": "1719963589", + "tool": { + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "tools": [ + "bob" + ], + "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", + "id": "testdata/BobAsShell/test.gpt:", + "toolMapping": { + "bob": [ + { + "reference": "bob", + "toolID": "testdata/BobAsShell/test.gpt:bob" + } + ] + }, + "localTools": { + "": "testdata/BobAsShell/test.gpt:", + "bob": "testdata/BobAsShell/test.gpt:bob" + }, + "source": { + "location": "testdata/BobAsShell/test.gpt", + "lineNo": 1 + }, + "workingDir": "testdata/BobAsShell" + }, + "currentAgent": {}, + "inputContext": null + }, + "type": "callChat", + "chatCompletionId": "1719963591", + "usage": {}, + "chatRequest": { + "model": "claude-3-5-sonnet-20240620", + "messages": [ + { + "role": "system", + "content": "Ask Bob \"how are you doing\" and repeat his reply exactly." + } + ], + "temperature": 0, + "tools": [ + { + "type": "function", + "function": { + "name": "bob", + "description": "I'm Bob, a friendly guy.", + "parameters": { + "properties": { + "question": { + "description": "The question to ask Bob.", + "type": "string" + } + }, + "type": "object" + } + } + } + ] + } + }, + { + "time": "2024-07-02T19:39:50.324921-04:00", + "callContext": { + "id": "1719963589", + "tool": { + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "tools": [ + "bob" + ], + "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", + "id": "testdata/BobAsShell/test.gpt:", + "toolMapping": { + "bob": [ + { + "reference": "bob", + "toolID": "testdata/BobAsShell/test.gpt:bob" + } + ] + }, + "localTools": { + "": "testdata/BobAsShell/test.gpt:", + "bob": "testdata/BobAsShell/test.gpt:bob" + }, + "source": { + "location": "testdata/BobAsShell/test.gpt", + "lineNo": 1 + }, + "workingDir": "testdata/BobAsShell" + }, + "currentAgent": {}, + "inputContext": null + }, + "type": "callProgress", + "chatCompletionId": "1719963591", + "usage": {}, + "content": "Waiting for model response..." + }, + { + "time": "2024-07-02T19:39:51.941234-04:00", + "callContext": { + "id": "1719963589", + "tool": { + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "tools": [ + "bob" + ], + "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", + "id": "testdata/BobAsShell/test.gpt:", + "toolMapping": { + "bob": [ + { + "reference": "bob", + "toolID": "testdata/BobAsShell/test.gpt:bob" + } + ] + }, + "localTools": { + "": "testdata/BobAsShell/test.gpt:", + "bob": "testdata/BobAsShell/test.gpt:bob" + }, + "source": { + "location": "testdata/BobAsShell/test.gpt", + "lineNo": 1 + }, + "workingDir": "testdata/BobAsShell" + }, + "currentAgent": {}, + "inputContext": null + }, + "type": "callProgress", + "chatCompletionId": "1719963591", + "usage": {}, + "content": "\u003ctool call\u003e bob -\u003e {\"question\": \"how are you doing\"}" + }, + { + "time": "2024-07-02T19:39:51.941444-04:00", + "callContext": { + "id": "1719963589", + "tool": { + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "tools": [ + "bob" + ], + "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", + "id": "testdata/BobAsShell/test.gpt:", + "toolMapping": { + "bob": [ + { + "reference": "bob", + "toolID": "testdata/BobAsShell/test.gpt:bob" + } + ] + }, + "localTools": { + "": "testdata/BobAsShell/test.gpt:", + "bob": "testdata/BobAsShell/test.gpt:bob" + }, + "source": { + "location": "testdata/BobAsShell/test.gpt", + "lineNo": 1 + }, + "workingDir": "testdata/BobAsShell" + }, + "currentAgent": {}, + "inputContext": null + }, + "type": "callChat", + "chatCompletionId": "1719963591", + "usage": {}, + "chatResponse": { + "role": "assistant", + "content": [ + { + "toolCall": { + "index": 0, + "id": "toolu_01SHRzoGuUEQtwBp2ktaqu7P", + "function": { + "name": "bob", + "arguments": "{\"question\": \"how are you doing\"}" + } + } + } + ], + "usage": {} + } + }, + { + "time": "2024-07-02T19:39:51.941523-04:00", + "callContext": { + "id": "1719963589", + "tool": { + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "tools": [ + "bob" + ], + "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", + "id": "testdata/BobAsShell/test.gpt:", + "toolMapping": { + "bob": [ + { + "reference": "bob", + "toolID": "testdata/BobAsShell/test.gpt:bob" + } + ] + }, + "localTools": { + "": "testdata/BobAsShell/test.gpt:", + "bob": "testdata/BobAsShell/test.gpt:bob" + }, + "source": { + "location": "testdata/BobAsShell/test.gpt", + "lineNo": 1 + }, + "workingDir": "testdata/BobAsShell" + }, + "currentAgent": {}, + "inputContext": null + }, + "toolSubCalls": { + "toolu_01SHRzoGuUEQtwBp2ktaqu7P": { + "toolID": "testdata/BobAsShell/test.gpt:bob", + "input": "{\"question\": \"how are you doing\"}" + } + }, + "type": "callSubCalls", + "usage": {} + }, + { + "time": "2024-07-02T19:39:51.941567-04:00", + "callContext": { + "id": "toolu_01SHRzoGuUEQtwBp2ktaqu7P", + "tool": { + "name": "bob", + "description": "I'm Bob, a friendly guy.", + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "arguments": { + "properties": { + "question": { + "description": "The question to ask Bob.", + "type": "string" + } + }, + "type": "object" + }, + "instructions": "#!/bin/bash\n\necho \"Thanks for asking ${question}, I'm doing great fellow friendly AI tool!\"", + "id": "testdata/BobAsShell/test.gpt:bob", + "localTools": { + "": "testdata/BobAsShell/test.gpt:", + "bob": "testdata/BobAsShell/test.gpt:bob" + }, + "source": { + "location": "testdata/BobAsShell/test.gpt", + "lineNo": 7 + }, + "workingDir": "testdata/BobAsShell" + }, + "currentAgent": {}, + "inputContext": null, + "toolName": "bob", + "parentID": "1719963589", + "displayText": "Running bob from testdata/BobAsShell/test.gpt" + }, + "type": "callStart", + "usage": {}, + "content": "{\"question\": \"how are you doing\"}" + }, + { + "time": "2024-07-02T19:39:51.942241-04:00", + "callContext": { + "id": "toolu_01SHRzoGuUEQtwBp2ktaqu7P", + "tool": { + "name": "bob", + "description": "I'm Bob, a friendly guy.", + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "arguments": { + "properties": { + "question": { + "description": "The question to ask Bob.", + "type": "string" + } + }, + "type": "object" + }, + "instructions": "#!/bin/bash\n\necho \"Thanks for asking ${question}, I'm doing great fellow friendly AI tool!\"", + "id": "testdata/BobAsShell/test.gpt:bob", + "localTools": { + "": "testdata/BobAsShell/test.gpt:", + "bob": "testdata/BobAsShell/test.gpt:bob" + }, + "source": { + "location": "testdata/BobAsShell/test.gpt", + "lineNo": 7 + }, + "workingDir": "testdata/BobAsShell" + }, + "currentAgent": {}, + "inputContext": null, + "toolName": "bob", + "parentID": "1719963589", + "displayText": "Running bob from testdata/BobAsShell/test.gpt" + }, + "type": "callChat", + "chatCompletionId": "1719963592", + "usage": {}, + "chatRequest": { + "model": "", + "messages": null + } + }, + { + "time": "2024-07-02T19:39:51.945596-04:00", + "callContext": { + "id": "toolu_01SHRzoGuUEQtwBp2ktaqu7P", + "tool": { + "name": "bob", + "description": "I'm Bob, a friendly guy.", + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "arguments": { + "properties": { + "question": { + "description": "The question to ask Bob.", + "type": "string" + } + }, + "type": "object" + }, + "instructions": "#!/bin/bash\n\necho \"Thanks for asking ${question}, I'm doing great fellow friendly AI tool!\"", + "id": "testdata/BobAsShell/test.gpt:bob", + "localTools": { + "": "testdata/BobAsShell/test.gpt:", + "bob": "testdata/BobAsShell/test.gpt:bob" + }, + "source": { + "location": "testdata/BobAsShell/test.gpt", + "lineNo": 7 + }, + "workingDir": "testdata/BobAsShell" + }, + "currentAgent": {}, + "inputContext": null, + "toolName": "bob", + "parentID": "1719963589", + "displayText": "Running bob from testdata/BobAsShell/test.gpt" + }, + "type": "callProgress", + "chatCompletionId": "1719963592", + "usage": {}, + "content": "Thanks for asking how are you doing, I'm doing great fellow friendly AI tool!\n" + }, + { + "time": "2024-07-02T19:39:51.945769-04:00", + "callContext": { + "id": "toolu_01SHRzoGuUEQtwBp2ktaqu7P", + "tool": { + "name": "bob", + "description": "I'm Bob, a friendly guy.", + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "arguments": { + "properties": { + "question": { + "description": "The question to ask Bob.", + "type": "string" + } + }, + "type": "object" + }, + "instructions": "#!/bin/bash\n\necho \"Thanks for asking ${question}, I'm doing great fellow friendly AI tool!\"", + "id": "testdata/BobAsShell/test.gpt:bob", + "localTools": { + "": "testdata/BobAsShell/test.gpt:", + "bob": "testdata/BobAsShell/test.gpt:bob" + }, + "source": { + "location": "testdata/BobAsShell/test.gpt", + "lineNo": 7 + }, + "workingDir": "testdata/BobAsShell" + }, + "currentAgent": {}, + "inputContext": null, + "toolName": "bob", + "parentID": "1719963589", + "displayText": "Running bob from testdata/BobAsShell/test.gpt" + }, + "type": "callChat", + "chatCompletionId": "1719963592", + "usage": {}, + "chatResponse": { + "usage": {} + } + }, + { + "time": "2024-07-02T19:39:51.945833-04:00", + "callContext": { + "id": "toolu_01SHRzoGuUEQtwBp2ktaqu7P", + "tool": { + "name": "bob", + "description": "I'm Bob, a friendly guy.", + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "arguments": { + "properties": { + "question": { + "description": "The question to ask Bob.", + "type": "string" + } + }, + "type": "object" + }, + "instructions": "#!/bin/bash\n\necho \"Thanks for asking ${question}, I'm doing great fellow friendly AI tool!\"", + "id": "testdata/BobAsShell/test.gpt:bob", + "localTools": { + "": "testdata/BobAsShell/test.gpt:", + "bob": "testdata/BobAsShell/test.gpt:bob" + }, + "source": { + "location": "testdata/BobAsShell/test.gpt", + "lineNo": 7 + }, + "workingDir": "testdata/BobAsShell" + }, + "currentAgent": {}, + "inputContext": null, + "toolName": "bob", + "parentID": "1719963589", + "displayText": "Running bob from testdata/BobAsShell/test.gpt" + }, + "type": "callFinish", + "usage": {}, + "content": "Thanks for asking how are you doing, I'm doing great fellow friendly AI tool!\n" + }, + { + "time": "2024-07-02T19:39:51.945871-04:00", + "callContext": { + "id": "1719963589", + "tool": { + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "tools": [ + "bob" + ], + "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", + "id": "testdata/BobAsShell/test.gpt:", + "toolMapping": { + "bob": [ + { + "reference": "bob", + "toolID": "testdata/BobAsShell/test.gpt:bob" + } + ] + }, + "localTools": { + "": "testdata/BobAsShell/test.gpt:", + "bob": "testdata/BobAsShell/test.gpt:bob" + }, + "source": { + "location": "testdata/BobAsShell/test.gpt", + "lineNo": 1 + }, + "workingDir": "testdata/BobAsShell" + }, + "currentAgent": {}, + "inputContext": null + }, + "toolResults": 1, + "type": "callContinue", + "usage": {} + }, + { + "time": "2024-07-02T19:39:52.112712-04:00", + "callContext": { + "id": "1719963589", + "tool": { + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "tools": [ + "bob" + ], + "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", + "id": "testdata/BobAsShell/test.gpt:", + "toolMapping": { + "bob": [ + { + "reference": "bob", + "toolID": "testdata/BobAsShell/test.gpt:bob" + } + ] + }, + "localTools": { + "": "testdata/BobAsShell/test.gpt:", + "bob": "testdata/BobAsShell/test.gpt:bob" + }, + "source": { + "location": "testdata/BobAsShell/test.gpt", + "lineNo": 1 + }, + "workingDir": "testdata/BobAsShell" + }, + "currentAgent": {}, + "inputContext": null + }, + "type": "callChat", + "chatCompletionId": "1719963593", + "usage": {}, + "chatRequest": { + "model": "claude-3-5-sonnet-20240620", + "messages": [ + { + "role": "system", + "content": "Ask Bob \"how are you doing\" and repeat his reply exactly." + }, + { + "role": "assistant", + "content": "", + "tool_calls": [ + { + "id": "toolu_01SHRzoGuUEQtwBp2ktaqu7P", + "type": "function", + "function": { + "name": "bob", + "arguments": "{\"question\": \"how are you doing\"}" + } + } + ] + }, + { + "role": "tool", + "content": "Thanks for asking how are you doing, I'm doing great fellow friendly AI tool!\n", + "name": "bob", + "tool_call_id": "toolu_01SHRzoGuUEQtwBp2ktaqu7P" + } + ], + "temperature": 0, + "tools": [ + { + "type": "function", + "function": { + "name": "bob", + "description": "I'm Bob, a friendly guy.", + "parameters": { + "properties": { + "question": { + "description": "The question to ask Bob.", + "type": "string" + } + }, + "type": "object" + } + } + } + ] + } + }, + { + "time": "2024-07-02T19:39:52.11309-04:00", + "callContext": { + "id": "1719963589", + "tool": { + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "tools": [ + "bob" + ], + "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", + "id": "testdata/BobAsShell/test.gpt:", + "toolMapping": { + "bob": [ + { + "reference": "bob", + "toolID": "testdata/BobAsShell/test.gpt:bob" + } + ] + }, + "localTools": { + "": "testdata/BobAsShell/test.gpt:", + "bob": "testdata/BobAsShell/test.gpt:bob" + }, + "source": { + "location": "testdata/BobAsShell/test.gpt", + "lineNo": 1 + }, + "workingDir": "testdata/BobAsShell" + }, + "currentAgent": {}, + "inputContext": null + }, + "type": "callProgress", + "chatCompletionId": "1719963593", + "usage": {}, + "content": "Waiting for model response..." + }, + { + "time": "2024-07-02T19:39:53.567604-04:00", + "callContext": { + "id": "1719963589", + "tool": { + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "tools": [ + "bob" + ], + "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", + "id": "testdata/BobAsShell/test.gpt:", + "toolMapping": { + "bob": [ + { + "reference": "bob", + "toolID": "testdata/BobAsShell/test.gpt:bob" + } + ] + }, + "localTools": { + "": "testdata/BobAsShell/test.gpt:", + "bob": "testdata/BobAsShell/test.gpt:bob" + }, + "source": { + "location": "testdata/BobAsShell/test.gpt", + "lineNo": 1 + }, + "workingDir": "testdata/BobAsShell" + }, + "currentAgent": {}, + "inputContext": null + }, + "type": "callProgress", + "chatCompletionId": "1719963593", + "usage": {}, + "content": "Bob's reply to the question \"how are you doing\" is:\n\n\"Thanks for asking how are you doing, I'm doing great fellow friendly AI tool!\"\n\nI have repeated his reply exactly as requested." + }, + { + "time": "2024-07-02T19:39:53.568556-04:00", + "callContext": { + "id": "1719963589", + "tool": { + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "tools": [ + "bob" + ], + "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", + "id": "testdata/BobAsShell/test.gpt:", + "toolMapping": { + "bob": [ + { + "reference": "bob", + "toolID": "testdata/BobAsShell/test.gpt:bob" + } + ] + }, + "localTools": { + "": "testdata/BobAsShell/test.gpt:", + "bob": "testdata/BobAsShell/test.gpt:bob" + }, + "source": { + "location": "testdata/BobAsShell/test.gpt", + "lineNo": 1 + }, + "workingDir": "testdata/BobAsShell" + }, + "currentAgent": {}, + "inputContext": null + }, + "type": "callChat", + "chatCompletionId": "1719963593", + "usage": {}, + "chatResponse": { + "role": "assistant", + "content": [ + { + "text": "Bob's reply to the question \"how are you doing\" is:\n\n\"Thanks for asking how are you doing, I'm doing great fellow friendly AI tool!\"\n\nI have repeated his reply exactly as requested." + } + ], + "usage": {} + } + }, + { + "time": "2024-07-02T19:39:53.568602-04:00", + "callContext": { + "id": "1719963589", + "tool": { + "modelName": "claude-3-5-sonnet-20240620 from github.com/gptscript-ai/claude3-anthropic-provider", + "internalPrompt": null, + "tools": [ + "bob" + ], + "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", + "id": "testdata/BobAsShell/test.gpt:", + "toolMapping": { + "bob": [ + { + "reference": "bob", + "toolID": "testdata/BobAsShell/test.gpt:bob" + } + ] + }, + "localTools": { + "": "testdata/BobAsShell/test.gpt:", + "bob": "testdata/BobAsShell/test.gpt:bob" + }, + "source": { + "location": "testdata/BobAsShell/test.gpt", + "lineNo": 1 + }, + "workingDir": "testdata/BobAsShell" + }, + "currentAgent": {}, + "inputContext": null + }, + "type": "callFinish", + "usage": {}, + "content": "Bob's reply to the question \"how are you doing\" is:\n\n\"Thanks for asking how are you doing, I'm doing great fellow friendly AI tool!\"\n\nI have repeated his reply exactly as requested." + }, + { + "time": "2024-07-02T19:39:53.568622-04:00", + "type": "runFinish", + "usage": {} + } +] From 7e4b9cca7aa10fa5b83f3f52c12353933565ad65 Mon Sep 17 00:00:00 2001 From: Nick Hale <4175918+njhale@users.noreply.github.com> Date: Tue, 2 Jul 2024 19:48:48 -0400 Subject: [PATCH 7/7] chore: remove smoke tests for claude-3-opus Signed-off-by: Nick Hale <4175918+njhale@users.noreply.github.com> --- .github/workflows/smoke.yaml | 31 - .../Bob/claude-3-opus-20240229-expected.json | 929 ------------------ .../claude-3-opus-20240229-expected.json | 878 ----------------- 3 files changed, 1838 deletions(-) delete mode 100644 pkg/tests/smoke/testdata/Bob/claude-3-opus-20240229-expected.json delete mode 100644 pkg/tests/smoke/testdata/BobAsShell/claude-3-opus-20240229-expected.json diff --git a/.github/workflows/smoke.yaml b/.github/workflows/smoke.yaml index a687e684..0106ed6d 100644 --- a/.github/workflows/smoke.yaml +++ b/.github/workflows/smoke.yaml @@ -117,37 +117,6 @@ jobs: export PATH="$(pwd)/bin:${PATH}" make smoke - claude-3-opus-20240229: - needs: check-label - if: ${{ needs.check-label.outputs.run_smoke_tests == 'true' }} - runs-on: ubuntu-22.04 - steps: - - name: Checkout base repository - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - name: Checkout PR code if running for a PR - if: ${{ github.event_name == 'pull_request_target' }} - uses: actions/checkout@v4 - with: - fetch-depth: 1 - repository: ${{ github.event.pull_request.head.repo.full_name }} - ref: ${{ github.event.pull_request.head.ref }} - - uses: actions/setup-go@v5 - with: - cache: false - go-version: "1.21" - - env: - OPENAI_API_KEY: ${{ secrets.SMOKE_OPENAI_API_KEY }} - GPTSCRIPT_DEFAULT_MODEL: claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider - ANTHROPIC_API_KEY: ${{ secrets.SMOKE_ANTHROPIC_API_KEY }} - GPTSCRIPT_CREDENTIAL_OVERRIDE: "github.com/gptscript-ai/claude3-anthropic-provider/credential:ANTHROPIC_API_KEY" - name: Run smoke test for claude-3-opus-20240229 - run: | - echo "Running smoke test for model claude-3-opus-20240229" - export PATH="$(pwd)/bin:${PATH}" - make smoke - claude-3-5-sonnet-20240620: needs: check-label if: ${{ needs.check-label.outputs.run_smoke_tests == 'true' }} diff --git a/pkg/tests/smoke/testdata/Bob/claude-3-opus-20240229-expected.json b/pkg/tests/smoke/testdata/Bob/claude-3-opus-20240229-expected.json deleted file mode 100644 index 1e924928..00000000 --- a/pkg/tests/smoke/testdata/Bob/claude-3-opus-20240229-expected.json +++ /dev/null @@ -1,929 +0,0 @@ -[ - { - "time": "2024-06-28T10:48:16.036954-04:00", - "type": "runStart", - "usage": {} - }, - { - "time": "2024-06-28T10:48:16.037294-04:00", - "callContext": { - "id": "1719586097", - "tool": { - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "tools": [ - "bob" - ], - "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", - "id": "testdata/Bob/test.gpt:", - "toolMapping": { - "bob": [ - { - "reference": "bob", - "toolID": "testdata/Bob/test.gpt:bob" - } - ] - }, - "localTools": { - "": "testdata/Bob/test.gpt:", - "bob": "testdata/Bob/test.gpt:bob" - }, - "source": { - "location": "testdata/Bob/test.gpt", - "lineNo": 1 - }, - "workingDir": "testdata/Bob" - }, - "currentAgent": {}, - "inputContext": null - }, - "type": "callStart", - "usage": {} - }, - { - "time": "2024-06-28T10:48:17.325263-04:00", - "type": "runStart", - "usage": {} - }, - { - "time": "2024-06-28T10:48:17.325584-04:00", - "callContext": { - "id": "1719586098", - "tool": { - "name": "Anthropic Claude3 Model Provider", - "description": "Model provider for Anthropic hosted Claude3 models", - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "modelProvider": true, - "internalPrompt": null, - "credentials": [ - "github.com/gptscript-ai/credential as github.com/gptscript-ai/claude3-anthropic-provider/credential with \"Please enter your Anthropic API Key\" as message and token as field and \"ANTHROPIC_API_KEY\" as env" - ], - "instructions": "#!sys.daemon /usr/bin/env python3 ${GPTSCRIPT_TOOL_DIR}/main.py", - "id": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/dfd21adc6be9fbda34b79a71e661ac0cfb725548/tool.gpt:Anthropic Claude3 Model Provider", - "toolMapping": { - "github.com/gptscript-ai/credential as github.com/gptscript-ai/claude3-anthropic-provider/credential with \"Please enter your Anthropic API Key\" as message and token as field and \"ANTHROPIC_API_KEY\" as env": [ - { - "reference": "github.com/gptscript-ai/credential as github.com/gptscript-ai/claude3-anthropic-provider/credential with \"Please enter your Anthropic API Key\" as message and token as field and \"ANTHROPIC_API_KEY\" as env", - "toolID": "https://raw.githubusercontent.com/gptscript-ai/credential/651dfad6e7cf3a385ef408afa93ce522c10f8508/tool.gpt:token" - } - ] - }, - "localTools": { - "anthropic claude3 model provider": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/dfd21adc6be9fbda34b79a71e661ac0cfb725548/tool.gpt:Anthropic Claude3 Model Provider" - }, - "source": { - "location": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/dfd21adc6be9fbda34b79a71e661ac0cfb725548/tool.gpt", - "lineNo": 1, - "repo": { - "VCS": "git", - "Root": "https://github.com/gptscript-ai/claude3-anthropic-provider.git", - "Path": "/", - "Name": "tool.gpt", - "Revision": "dfd21adc6be9fbda34b79a71e661ac0cfb725548" - } - }, - "workingDir": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/dfd21adc6be9fbda34b79a71e661ac0cfb725548" - }, - "currentAgent": {}, - "inputContext": null, - "toolCategory": "provider", - "displayText": "Running sys.daemon" - }, - "type": "callStart", - "usage": {} - }, - { - "time": "2024-06-28T10:48:18.342475-04:00", - "callContext": { - "id": "1719586098", - "tool": { - "name": "Anthropic Claude3 Model Provider", - "description": "Model provider for Anthropic hosted Claude3 models", - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "modelProvider": true, - "internalPrompt": null, - "credentials": [ - "github.com/gptscript-ai/credential as github.com/gptscript-ai/claude3-anthropic-provider/credential with \"Please enter your Anthropic API Key\" as message and token as field and \"ANTHROPIC_API_KEY\" as env" - ], - "instructions": "#!sys.daemon /usr/bin/env python3 ${GPTSCRIPT_TOOL_DIR}/main.py", - "id": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/dfd21adc6be9fbda34b79a71e661ac0cfb725548/tool.gpt:Anthropic Claude3 Model Provider", - "toolMapping": { - "github.com/gptscript-ai/credential as github.com/gptscript-ai/claude3-anthropic-provider/credential with \"Please enter your Anthropic API Key\" as message and token as field and \"ANTHROPIC_API_KEY\" as env": [ - { - "reference": "github.com/gptscript-ai/credential as github.com/gptscript-ai/claude3-anthropic-provider/credential with \"Please enter your Anthropic API Key\" as message and token as field and \"ANTHROPIC_API_KEY\" as env", - "toolID": "https://raw.githubusercontent.com/gptscript-ai/credential/651dfad6e7cf3a385ef408afa93ce522c10f8508/tool.gpt:token" - } - ] - }, - "localTools": { - "anthropic claude3 model provider": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/dfd21adc6be9fbda34b79a71e661ac0cfb725548/tool.gpt:Anthropic Claude3 Model Provider" - }, - "source": { - "location": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/dfd21adc6be9fbda34b79a71e661ac0cfb725548/tool.gpt", - "lineNo": 1, - "repo": { - "VCS": "git", - "Root": "https://github.com/gptscript-ai/claude3-anthropic-provider.git", - "Path": "/", - "Name": "tool.gpt", - "Revision": "dfd21adc6be9fbda34b79a71e661ac0cfb725548" - } - }, - "workingDir": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/dfd21adc6be9fbda34b79a71e661ac0cfb725548" - }, - "currentAgent": {}, - "inputContext": null, - "toolCategory": "provider", - "displayText": "Running sys.daemon" - }, - "type": "callFinish", - "usage": {}, - "content": "http://127.0.0.1:10961" - }, - { - "time": "2024-06-28T10:48:18.342649-04:00", - "type": "runFinish", - "usage": {} - }, - { - "time": "2024-06-28T10:48:18.342718-04:00", - "callContext": { - "id": "1719586097", - "tool": { - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "tools": [ - "bob" - ], - "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", - "id": "testdata/Bob/test.gpt:", - "toolMapping": { - "bob": [ - { - "reference": "bob", - "toolID": "testdata/Bob/test.gpt:bob" - } - ] - }, - "localTools": { - "": "testdata/Bob/test.gpt:", - "bob": "testdata/Bob/test.gpt:bob" - }, - "source": { - "location": "testdata/Bob/test.gpt", - "lineNo": 1 - }, - "workingDir": "testdata/Bob" - }, - "currentAgent": {}, - "inputContext": null - }, - "type": "callChat", - "chatCompletionId": "1719586099", - "usage": {}, - "chatRequest": { - "model": "claude-3-opus-20240229", - "messages": [ - { - "role": "system", - "content": "Ask Bob \"how are you doing\" and repeat his reply exactly." - } - ], - "temperature": 0, - "tools": [ - { - "type": "function", - "function": { - "name": "bob", - "description": "I'm Bob, a friendly guy.", - "parameters": { - "properties": { - "question": { - "description": "The question to ask Bob.", - "type": "string" - } - }, - "type": "object" - } - } - } - ] - } - }, - { - "time": "2024-06-28T10:48:18.343115-04:00", - "callContext": { - "id": "1719586097", - "tool": { - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "tools": [ - "bob" - ], - "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", - "id": "testdata/Bob/test.gpt:", - "toolMapping": { - "bob": [ - { - "reference": "bob", - "toolID": "testdata/Bob/test.gpt:bob" - } - ] - }, - "localTools": { - "": "testdata/Bob/test.gpt:", - "bob": "testdata/Bob/test.gpt:bob" - }, - "source": { - "location": "testdata/Bob/test.gpt", - "lineNo": 1 - }, - "workingDir": "testdata/Bob" - }, - "currentAgent": {}, - "inputContext": null - }, - "type": "callProgress", - "chatCompletionId": "1719586099", - "usage": {}, - "content": "Waiting for model response..." - }, - { - "time": "2024-06-28T10:48:21.291497-04:00", - "callContext": { - "id": "1719586097", - "tool": { - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "tools": [ - "bob" - ], - "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", - "id": "testdata/Bob/test.gpt:", - "toolMapping": { - "bob": [ - { - "reference": "bob", - "toolID": "testdata/Bob/test.gpt:bob" - } - ] - }, - "localTools": { - "": "testdata/Bob/test.gpt:", - "bob": "testdata/Bob/test.gpt:bob" - }, - "source": { - "location": "testdata/Bob/test.gpt", - "lineNo": 1 - }, - "workingDir": "testdata/Bob" - }, - "currentAgent": {}, - "inputContext": null - }, - "type": "callProgress", - "chatCompletionId": "1719586099", - "usage": {}, - "content": "\u003ctool call\u003e bob -\u003e {\"question\": \"how are you doing\"}" - }, - { - "time": "2024-06-28T10:48:21.291864-04:00", - "callContext": { - "id": "1719586097", - "tool": { - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "tools": [ - "bob" - ], - "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", - "id": "testdata/Bob/test.gpt:", - "toolMapping": { - "bob": [ - { - "reference": "bob", - "toolID": "testdata/Bob/test.gpt:bob" - } - ] - }, - "localTools": { - "": "testdata/Bob/test.gpt:", - "bob": "testdata/Bob/test.gpt:bob" - }, - "source": { - "location": "testdata/Bob/test.gpt", - "lineNo": 1 - }, - "workingDir": "testdata/Bob" - }, - "currentAgent": {}, - "inputContext": null - }, - "type": "callChat", - "chatCompletionId": "1719586099", - "usage": {}, - "chatResponse": { - "role": "assistant", - "content": [ - { - "toolCall": { - "index": 0, - "id": "bob", - "function": { - "name": "bob", - "arguments": "{\"question\": \"how are you doing\"}" - } - } - } - ], - "usage": {} - } - }, - { - "time": "2024-06-28T10:48:21.291966-04:00", - "callContext": { - "id": "1719586097", - "tool": { - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "tools": [ - "bob" - ], - "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", - "id": "testdata/Bob/test.gpt:", - "toolMapping": { - "bob": [ - { - "reference": "bob", - "toolID": "testdata/Bob/test.gpt:bob" - } - ] - }, - "localTools": { - "": "testdata/Bob/test.gpt:", - "bob": "testdata/Bob/test.gpt:bob" - }, - "source": { - "location": "testdata/Bob/test.gpt", - "lineNo": 1 - }, - "workingDir": "testdata/Bob" - }, - "currentAgent": {}, - "inputContext": null - }, - "toolSubCalls": { - "bob": { - "toolID": "testdata/Bob/test.gpt:bob", - "input": "{\"question\": \"how are you doing\"}" - } - }, - "type": "callSubCalls", - "usage": {} - }, - { - "time": "2024-06-28T10:48:21.291997-04:00", - "callContext": { - "id": "bob", - "tool": { - "name": "bob", - "description": "I'm Bob, a friendly guy.", - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "arguments": { - "properties": { - "question": { - "description": "The question to ask Bob.", - "type": "string" - } - }, - "type": "object" - }, - "instructions": "When asked how I am doing, respond with exactly \"Thanks for asking \"${question}\", I'm doing great fellow friendly AI tool!\"", - "id": "testdata/Bob/test.gpt:bob", - "localTools": { - "": "testdata/Bob/test.gpt:", - "bob": "testdata/Bob/test.gpt:bob" - }, - "source": { - "location": "testdata/Bob/test.gpt", - "lineNo": 6 - }, - "workingDir": "testdata/Bob" - }, - "currentAgent": {}, - "inputContext": null, - "toolName": "bob", - "parentID": "1719586097" - }, - "type": "callStart", - "usage": {}, - "content": "{\"question\": \"how are you doing\"}" - }, - { - "time": "2024-06-28T10:48:21.50264-04:00", - "callContext": { - "id": "bob", - "tool": { - "name": "bob", - "description": "I'm Bob, a friendly guy.", - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "arguments": { - "properties": { - "question": { - "description": "The question to ask Bob.", - "type": "string" - } - }, - "type": "object" - }, - "instructions": "When asked how I am doing, respond with exactly \"Thanks for asking \"${question}\", I'm doing great fellow friendly AI tool!\"", - "id": "testdata/Bob/test.gpt:bob", - "localTools": { - "": "testdata/Bob/test.gpt:", - "bob": "testdata/Bob/test.gpt:bob" - }, - "source": { - "location": "testdata/Bob/test.gpt", - "lineNo": 6 - }, - "workingDir": "testdata/Bob" - }, - "currentAgent": {}, - "inputContext": null, - "toolName": "bob", - "parentID": "1719586097" - }, - "type": "callChat", - "chatCompletionId": "1719586100", - "usage": {}, - "chatRequest": { - "model": "claude-3-opus-20240229", - "messages": [ - { - "role": "system", - "content": "When asked how I am doing, respond with exactly \"Thanks for asking \"${question}\", I'm doing great fellow friendly AI tool!\"" - }, - { - "role": "user", - "content": "{\"question\": \"how are you doing\"}" - } - ], - "temperature": 0 - } - }, - { - "time": "2024-06-28T10:48:21.503008-04:00", - "callContext": { - "id": "bob", - "tool": { - "name": "bob", - "description": "I'm Bob, a friendly guy.", - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "arguments": { - "properties": { - "question": { - "description": "The question to ask Bob.", - "type": "string" - } - }, - "type": "object" - }, - "instructions": "When asked how I am doing, respond with exactly \"Thanks for asking \"${question}\", I'm doing great fellow friendly AI tool!\"", - "id": "testdata/Bob/test.gpt:bob", - "localTools": { - "": "testdata/Bob/test.gpt:", - "bob": "testdata/Bob/test.gpt:bob" - }, - "source": { - "location": "testdata/Bob/test.gpt", - "lineNo": 6 - }, - "workingDir": "testdata/Bob" - }, - "currentAgent": {}, - "inputContext": null, - "toolName": "bob", - "parentID": "1719586097" - }, - "type": "callProgress", - "chatCompletionId": "1719586100", - "usage": {}, - "content": "Waiting for model response..." - }, - { - "time": "2024-06-28T10:48:22.875617-04:00", - "callContext": { - "id": "bob", - "tool": { - "name": "bob", - "description": "I'm Bob, a friendly guy.", - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "arguments": { - "properties": { - "question": { - "description": "The question to ask Bob.", - "type": "string" - } - }, - "type": "object" - }, - "instructions": "When asked how I am doing, respond with exactly \"Thanks for asking \"${question}\", I'm doing great fellow friendly AI tool!\"", - "id": "testdata/Bob/test.gpt:bob", - "localTools": { - "": "testdata/Bob/test.gpt:", - "bob": "testdata/Bob/test.gpt:bob" - }, - "source": { - "location": "testdata/Bob/test.gpt", - "lineNo": 6 - }, - "workingDir": "testdata/Bob" - }, - "currentAgent": {}, - "inputContext": null, - "toolName": "bob", - "parentID": "1719586097" - }, - "type": "callProgress", - "chatCompletionId": "1719586100", - "usage": {}, - "content": "Thanks for asking \"how are you doing\", I'm doing great fellow friendly AI tool!" - }, - { - "time": "2024-06-28T10:48:22.875964-04:00", - "callContext": { - "id": "bob", - "tool": { - "name": "bob", - "description": "I'm Bob, a friendly guy.", - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "arguments": { - "properties": { - "question": { - "description": "The question to ask Bob.", - "type": "string" - } - }, - "type": "object" - }, - "instructions": "When asked how I am doing, respond with exactly \"Thanks for asking \"${question}\", I'm doing great fellow friendly AI tool!\"", - "id": "testdata/Bob/test.gpt:bob", - "localTools": { - "": "testdata/Bob/test.gpt:", - "bob": "testdata/Bob/test.gpt:bob" - }, - "source": { - "location": "testdata/Bob/test.gpt", - "lineNo": 6 - }, - "workingDir": "testdata/Bob" - }, - "currentAgent": {}, - "inputContext": null, - "toolName": "bob", - "parentID": "1719586097" - }, - "type": "callChat", - "chatCompletionId": "1719586100", - "usage": {}, - "chatResponse": { - "role": "assistant", - "content": [ - { - "text": "Thanks for asking \"how are you doing\", I'm doing great fellow friendly AI tool!" - } - ], - "usage": {} - } - }, - { - "time": "2024-06-28T10:48:22.876034-04:00", - "callContext": { - "id": "bob", - "tool": { - "name": "bob", - "description": "I'm Bob, a friendly guy.", - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "arguments": { - "properties": { - "question": { - "description": "The question to ask Bob.", - "type": "string" - } - }, - "type": "object" - }, - "instructions": "When asked how I am doing, respond with exactly \"Thanks for asking \"${question}\", I'm doing great fellow friendly AI tool!\"", - "id": "testdata/Bob/test.gpt:bob", - "localTools": { - "": "testdata/Bob/test.gpt:", - "bob": "testdata/Bob/test.gpt:bob" - }, - "source": { - "location": "testdata/Bob/test.gpt", - "lineNo": 6 - }, - "workingDir": "testdata/Bob" - }, - "currentAgent": {}, - "inputContext": null, - "toolName": "bob", - "parentID": "1719586097" - }, - "type": "callFinish", - "usage": {}, - "content": "Thanks for asking \"how are you doing\", I'm doing great fellow friendly AI tool!" - }, - { - "time": "2024-06-28T10:48:22.876064-04:00", - "callContext": { - "id": "1719586097", - "tool": { - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "tools": [ - "bob" - ], - "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", - "id": "testdata/Bob/test.gpt:", - "toolMapping": { - "bob": [ - { - "reference": "bob", - "toolID": "testdata/Bob/test.gpt:bob" - } - ] - }, - "localTools": { - "": "testdata/Bob/test.gpt:", - "bob": "testdata/Bob/test.gpt:bob" - }, - "source": { - "location": "testdata/Bob/test.gpt", - "lineNo": 1 - }, - "workingDir": "testdata/Bob" - }, - "currentAgent": {}, - "inputContext": null - }, - "toolResults": 1, - "type": "callContinue", - "usage": {} - }, - { - "time": "2024-06-28T10:48:23.086894-04:00", - "callContext": { - "id": "1719586097", - "tool": { - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "tools": [ - "bob" - ], - "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", - "id": "testdata/Bob/test.gpt:", - "toolMapping": { - "bob": [ - { - "reference": "bob", - "toolID": "testdata/Bob/test.gpt:bob" - } - ] - }, - "localTools": { - "": "testdata/Bob/test.gpt:", - "bob": "testdata/Bob/test.gpt:bob" - }, - "source": { - "location": "testdata/Bob/test.gpt", - "lineNo": 1 - }, - "workingDir": "testdata/Bob" - }, - "currentAgent": {}, - "inputContext": null - }, - "type": "callChat", - "chatCompletionId": "1719586101", - "usage": {}, - "chatRequest": { - "model": "claude-3-opus-20240229", - "messages": [ - { - "role": "system", - "content": "Ask Bob \"how are you doing\" and repeat his reply exactly." - }, - { - "role": "assistant", - "content": "", - "tool_calls": [ - { - "id": "bob", - "type": "function", - "function": { - "name": "bob", - "arguments": "{\"question\": \"how are you doing\"}" - } - } - ] - }, - { - "role": "tool", - "content": "Thanks for asking \"how are you doing\", I'm doing great fellow friendly AI tool!", - "name": "bob", - "tool_call_id": "bob" - } - ], - "temperature": 0, - "tools": [ - { - "type": "function", - "function": { - "name": "bob", - "description": "I'm Bob, a friendly guy.", - "parameters": { - "properties": { - "question": { - "description": "The question to ask Bob.", - "type": "string" - } - }, - "type": "object" - } - } - } - ] - } - }, - { - "time": "2024-06-28T10:48:23.087303-04:00", - "callContext": { - "id": "1719586097", - "tool": { - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "tools": [ - "bob" - ], - "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", - "id": "testdata/Bob/test.gpt:", - "toolMapping": { - "bob": [ - { - "reference": "bob", - "toolID": "testdata/Bob/test.gpt:bob" - } - ] - }, - "localTools": { - "": "testdata/Bob/test.gpt:", - "bob": "testdata/Bob/test.gpt:bob" - }, - "source": { - "location": "testdata/Bob/test.gpt", - "lineNo": 1 - }, - "workingDir": "testdata/Bob" - }, - "currentAgent": {}, - "inputContext": null - }, - "type": "callProgress", - "chatCompletionId": "1719586101", - "usage": {}, - "content": "Waiting for model response..." - }, - { - "time": "2024-06-28T10:48:25.243408-04:00", - "callContext": { - "id": "1719586097", - "tool": { - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "tools": [ - "bob" - ], - "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", - "id": "testdata/Bob/test.gpt:", - "toolMapping": { - "bob": [ - { - "reference": "bob", - "toolID": "testdata/Bob/test.gpt:bob" - } - ] - }, - "localTools": { - "": "testdata/Bob/test.gpt:", - "bob": "testdata/Bob/test.gpt:bob" - }, - "source": { - "location": "testdata/Bob/test.gpt", - "lineNo": 1 - }, - "workingDir": "testdata/Bob" - }, - "currentAgent": {}, - "inputContext": null - }, - "type": "callProgress", - "chatCompletionId": "1719586101", - "usage": {}, - "content": "Thanks for asking \"how are you doing\", I'm doing great fellow friendly AI tool!" - }, - { - "time": "2024-06-28T10:48:25.243765-04:00", - "callContext": { - "id": "1719586097", - "tool": { - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "tools": [ - "bob" - ], - "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", - "id": "testdata/Bob/test.gpt:", - "toolMapping": { - "bob": [ - { - "reference": "bob", - "toolID": "testdata/Bob/test.gpt:bob" - } - ] - }, - "localTools": { - "": "testdata/Bob/test.gpt:", - "bob": "testdata/Bob/test.gpt:bob" - }, - "source": { - "location": "testdata/Bob/test.gpt", - "lineNo": 1 - }, - "workingDir": "testdata/Bob" - }, - "currentAgent": {}, - "inputContext": null - }, - "type": "callChat", - "chatCompletionId": "1719586101", - "usage": {}, - "chatResponse": { - "role": "assistant", - "content": [ - { - "text": "Thanks for asking \"how are you doing\", I'm doing great fellow friendly AI tool!" - } - ], - "usage": {} - } - }, - { - "time": "2024-06-28T10:48:25.243793-04:00", - "callContext": { - "id": "1719586097", - "tool": { - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "tools": [ - "bob" - ], - "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", - "id": "testdata/Bob/test.gpt:", - "toolMapping": { - "bob": [ - { - "reference": "bob", - "toolID": "testdata/Bob/test.gpt:bob" - } - ] - }, - "localTools": { - "": "testdata/Bob/test.gpt:", - "bob": "testdata/Bob/test.gpt:bob" - }, - "source": { - "location": "testdata/Bob/test.gpt", - "lineNo": 1 - }, - "workingDir": "testdata/Bob" - }, - "currentAgent": {}, - "inputContext": null - }, - "type": "callFinish", - "usage": {}, - "content": "Thanks for asking \"how are you doing\", I'm doing great fellow friendly AI tool!" - }, - { - "time": "2024-06-28T10:48:25.243836-04:00", - "type": "runFinish", - "usage": {} - } -] diff --git a/pkg/tests/smoke/testdata/BobAsShell/claude-3-opus-20240229-expected.json b/pkg/tests/smoke/testdata/BobAsShell/claude-3-opus-20240229-expected.json deleted file mode 100644 index 88077e74..00000000 --- a/pkg/tests/smoke/testdata/BobAsShell/claude-3-opus-20240229-expected.json +++ /dev/null @@ -1,878 +0,0 @@ -[ - { - "time": "2024-06-28T10:48:25.264658-04:00", - "type": "runStart", - "usage": {} - }, - { - "time": "2024-06-28T10:48:25.264853-04:00", - "callContext": { - "id": "1719586106", - "tool": { - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "tools": [ - "bob" - ], - "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", - "id": "testdata/BobAsShell/test.gpt:", - "toolMapping": { - "bob": [ - { - "reference": "bob", - "toolID": "testdata/BobAsShell/test.gpt:bob" - } - ] - }, - "localTools": { - "": "testdata/BobAsShell/test.gpt:", - "bob": "testdata/BobAsShell/test.gpt:bob" - }, - "source": { - "location": "testdata/BobAsShell/test.gpt", - "lineNo": 1 - }, - "workingDir": "testdata/BobAsShell" - }, - "currentAgent": {}, - "inputContext": null - }, - "type": "callStart", - "usage": {} - }, - { - "time": "2024-06-28T10:48:26.063945-04:00", - "type": "runStart", - "usage": {} - }, - { - "time": "2024-06-28T10:48:26.064323-04:00", - "callContext": { - "id": "1719586107", - "tool": { - "name": "Anthropic Claude3 Model Provider", - "description": "Model provider for Anthropic hosted Claude3 models", - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "modelProvider": true, - "internalPrompt": null, - "credentials": [ - "github.com/gptscript-ai/credential as github.com/gptscript-ai/claude3-anthropic-provider/credential with \"Please enter your Anthropic API Key\" as message and token as field and \"ANTHROPIC_API_KEY\" as env" - ], - "instructions": "#!sys.daemon /usr/bin/env python3 ${GPTSCRIPT_TOOL_DIR}/main.py", - "id": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/dfd21adc6be9fbda34b79a71e661ac0cfb725548/tool.gpt:Anthropic Claude3 Model Provider", - "toolMapping": { - "github.com/gptscript-ai/credential as github.com/gptscript-ai/claude3-anthropic-provider/credential with \"Please enter your Anthropic API Key\" as message and token as field and \"ANTHROPIC_API_KEY\" as env": [ - { - "reference": "github.com/gptscript-ai/credential as github.com/gptscript-ai/claude3-anthropic-provider/credential with \"Please enter your Anthropic API Key\" as message and token as field and \"ANTHROPIC_API_KEY\" as env", - "toolID": "https://raw.githubusercontent.com/gptscript-ai/credential/651dfad6e7cf3a385ef408afa93ce522c10f8508/tool.gpt:token" - } - ] - }, - "localTools": { - "anthropic claude3 model provider": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/dfd21adc6be9fbda34b79a71e661ac0cfb725548/tool.gpt:Anthropic Claude3 Model Provider" - }, - "source": { - "location": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/dfd21adc6be9fbda34b79a71e661ac0cfb725548/tool.gpt", - "lineNo": 1, - "repo": { - "VCS": "git", - "Root": "https://github.com/gptscript-ai/claude3-anthropic-provider.git", - "Path": "/", - "Name": "tool.gpt", - "Revision": "dfd21adc6be9fbda34b79a71e661ac0cfb725548" - } - }, - "workingDir": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/dfd21adc6be9fbda34b79a71e661ac0cfb725548" - }, - "currentAgent": {}, - "inputContext": null, - "toolCategory": "provider", - "displayText": "Running sys.daemon" - }, - "type": "callStart", - "usage": {} - }, - { - "time": "2024-06-28T10:48:27.081163-04:00", - "callContext": { - "id": "1719586107", - "tool": { - "name": "Anthropic Claude3 Model Provider", - "description": "Model provider for Anthropic hosted Claude3 models", - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "modelProvider": true, - "internalPrompt": null, - "credentials": [ - "github.com/gptscript-ai/credential as github.com/gptscript-ai/claude3-anthropic-provider/credential with \"Please enter your Anthropic API Key\" as message and token as field and \"ANTHROPIC_API_KEY\" as env" - ], - "instructions": "#!sys.daemon /usr/bin/env python3 ${GPTSCRIPT_TOOL_DIR}/main.py", - "id": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/dfd21adc6be9fbda34b79a71e661ac0cfb725548/tool.gpt:Anthropic Claude3 Model Provider", - "toolMapping": { - "github.com/gptscript-ai/credential as github.com/gptscript-ai/claude3-anthropic-provider/credential with \"Please enter your Anthropic API Key\" as message and token as field and \"ANTHROPIC_API_KEY\" as env": [ - { - "reference": "github.com/gptscript-ai/credential as github.com/gptscript-ai/claude3-anthropic-provider/credential with \"Please enter your Anthropic API Key\" as message and token as field and \"ANTHROPIC_API_KEY\" as env", - "toolID": "https://raw.githubusercontent.com/gptscript-ai/credential/651dfad6e7cf3a385ef408afa93ce522c10f8508/tool.gpt:token" - } - ] - }, - "localTools": { - "anthropic claude3 model provider": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/dfd21adc6be9fbda34b79a71e661ac0cfb725548/tool.gpt:Anthropic Claude3 Model Provider" - }, - "source": { - "location": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/dfd21adc6be9fbda34b79a71e661ac0cfb725548/tool.gpt", - "lineNo": 1, - "repo": { - "VCS": "git", - "Root": "https://github.com/gptscript-ai/claude3-anthropic-provider.git", - "Path": "/", - "Name": "tool.gpt", - "Revision": "dfd21adc6be9fbda34b79a71e661ac0cfb725548" - } - }, - "workingDir": "https://raw.githubusercontent.com/gptscript-ai/claude3-anthropic-provider/dfd21adc6be9fbda34b79a71e661ac0cfb725548" - }, - "currentAgent": {}, - "inputContext": null, - "toolCategory": "provider", - "displayText": "Running sys.daemon" - }, - "type": "callFinish", - "usage": {}, - "content": "http://127.0.0.1:10315" - }, - { - "time": "2024-06-28T10:48:27.081351-04:00", - "type": "runFinish", - "usage": {} - }, - { - "time": "2024-06-28T10:48:27.081414-04:00", - "callContext": { - "id": "1719586106", - "tool": { - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "tools": [ - "bob" - ], - "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", - "id": "testdata/BobAsShell/test.gpt:", - "toolMapping": { - "bob": [ - { - "reference": "bob", - "toolID": "testdata/BobAsShell/test.gpt:bob" - } - ] - }, - "localTools": { - "": "testdata/BobAsShell/test.gpt:", - "bob": "testdata/BobAsShell/test.gpt:bob" - }, - "source": { - "location": "testdata/BobAsShell/test.gpt", - "lineNo": 1 - }, - "workingDir": "testdata/BobAsShell" - }, - "currentAgent": {}, - "inputContext": null - }, - "type": "callChat", - "chatCompletionId": "1719586108", - "usage": {}, - "chatRequest": { - "model": "claude-3-opus-20240229", - "messages": [ - { - "role": "system", - "content": "Ask Bob \"how are you doing\" and repeat his reply exactly." - } - ], - "temperature": 0, - "tools": [ - { - "type": "function", - "function": { - "name": "bob", - "description": "I'm Bob, a friendly guy.", - "parameters": { - "properties": { - "question": { - "description": "The question to ask Bob.", - "type": "string" - } - }, - "type": "object" - } - } - } - ] - } - }, - { - "time": "2024-06-28T10:48:27.081844-04:00", - "callContext": { - "id": "1719586106", - "tool": { - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "tools": [ - "bob" - ], - "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", - "id": "testdata/BobAsShell/test.gpt:", - "toolMapping": { - "bob": [ - { - "reference": "bob", - "toolID": "testdata/BobAsShell/test.gpt:bob" - } - ] - }, - "localTools": { - "": "testdata/BobAsShell/test.gpt:", - "bob": "testdata/BobAsShell/test.gpt:bob" - }, - "source": { - "location": "testdata/BobAsShell/test.gpt", - "lineNo": 1 - }, - "workingDir": "testdata/BobAsShell" - }, - "currentAgent": {}, - "inputContext": null - }, - "type": "callProgress", - "chatCompletionId": "1719586108", - "usage": {}, - "content": "Waiting for model response..." - }, - { - "time": "2024-06-28T10:48:30.452648-04:00", - "callContext": { - "id": "1719586106", - "tool": { - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "tools": [ - "bob" - ], - "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", - "id": "testdata/BobAsShell/test.gpt:", - "toolMapping": { - "bob": [ - { - "reference": "bob", - "toolID": "testdata/BobAsShell/test.gpt:bob" - } - ] - }, - "localTools": { - "": "testdata/BobAsShell/test.gpt:", - "bob": "testdata/BobAsShell/test.gpt:bob" - }, - "source": { - "location": "testdata/BobAsShell/test.gpt", - "lineNo": 1 - }, - "workingDir": "testdata/BobAsShell" - }, - "currentAgent": {}, - "inputContext": null - }, - "type": "callProgress", - "chatCompletionId": "1719586108", - "usage": {}, - "content": "\u003ctool call\u003e bob -\u003e {\"question\": \"how are you doing\"}" - }, - { - "time": "2024-06-28T10:48:30.452871-04:00", - "callContext": { - "id": "1719586106", - "tool": { - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "tools": [ - "bob" - ], - "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", - "id": "testdata/BobAsShell/test.gpt:", - "toolMapping": { - "bob": [ - { - "reference": "bob", - "toolID": "testdata/BobAsShell/test.gpt:bob" - } - ] - }, - "localTools": { - "": "testdata/BobAsShell/test.gpt:", - "bob": "testdata/BobAsShell/test.gpt:bob" - }, - "source": { - "location": "testdata/BobAsShell/test.gpt", - "lineNo": 1 - }, - "workingDir": "testdata/BobAsShell" - }, - "currentAgent": {}, - "inputContext": null - }, - "type": "callChat", - "chatCompletionId": "1719586108", - "usage": {}, - "chatResponse": { - "role": "assistant", - "content": [ - { - "toolCall": { - "index": 0, - "id": "bob", - "function": { - "name": "bob", - "arguments": "{\"question\": \"how are you doing\"}" - } - } - } - ], - "usage": {} - } - }, - { - "time": "2024-06-28T10:48:30.452992-04:00", - "callContext": { - "id": "1719586106", - "tool": { - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "tools": [ - "bob" - ], - "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", - "id": "testdata/BobAsShell/test.gpt:", - "toolMapping": { - "bob": [ - { - "reference": "bob", - "toolID": "testdata/BobAsShell/test.gpt:bob" - } - ] - }, - "localTools": { - "": "testdata/BobAsShell/test.gpt:", - "bob": "testdata/BobAsShell/test.gpt:bob" - }, - "source": { - "location": "testdata/BobAsShell/test.gpt", - "lineNo": 1 - }, - "workingDir": "testdata/BobAsShell" - }, - "currentAgent": {}, - "inputContext": null - }, - "toolSubCalls": { - "bob": { - "toolID": "testdata/BobAsShell/test.gpt:bob", - "input": "{\"question\": \"how are you doing\"}" - } - }, - "type": "callSubCalls", - "usage": {} - }, - { - "time": "2024-06-28T10:48:30.453034-04:00", - "callContext": { - "id": "bob", - "tool": { - "name": "bob", - "description": "I'm Bob, a friendly guy.", - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "arguments": { - "properties": { - "question": { - "description": "The question to ask Bob.", - "type": "string" - } - }, - "type": "object" - }, - "instructions": "#!/bin/bash\n\necho \"Thanks for asking ${question}, I'm doing great fellow friendly AI tool!\"", - "id": "testdata/BobAsShell/test.gpt:bob", - "localTools": { - "": "testdata/BobAsShell/test.gpt:", - "bob": "testdata/BobAsShell/test.gpt:bob" - }, - "source": { - "location": "testdata/BobAsShell/test.gpt", - "lineNo": 7 - }, - "workingDir": "testdata/BobAsShell" - }, - "currentAgent": {}, - "inputContext": null, - "toolName": "bob", - "parentID": "1719586106", - "displayText": "Running bob from testdata/BobAsShell/test.gpt" - }, - "type": "callStart", - "usage": {}, - "content": "{\"question\": \"how are you doing\"}" - }, - { - "time": "2024-06-28T10:48:30.453498-04:00", - "callContext": { - "id": "bob", - "tool": { - "name": "bob", - "description": "I'm Bob, a friendly guy.", - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "arguments": { - "properties": { - "question": { - "description": "The question to ask Bob.", - "type": "string" - } - }, - "type": "object" - }, - "instructions": "#!/bin/bash\n\necho \"Thanks for asking ${question}, I'm doing great fellow friendly AI tool!\"", - "id": "testdata/BobAsShell/test.gpt:bob", - "localTools": { - "": "testdata/BobAsShell/test.gpt:", - "bob": "testdata/BobAsShell/test.gpt:bob" - }, - "source": { - "location": "testdata/BobAsShell/test.gpt", - "lineNo": 7 - }, - "workingDir": "testdata/BobAsShell" - }, - "currentAgent": {}, - "inputContext": null, - "toolName": "bob", - "parentID": "1719586106", - "displayText": "Running bob from testdata/BobAsShell/test.gpt" - }, - "type": "callChat", - "chatCompletionId": "1719586109", - "usage": {}, - "chatRequest": { - "model": "", - "messages": null - } - }, - { - "time": "2024-06-28T10:48:30.455907-04:00", - "callContext": { - "id": "bob", - "tool": { - "name": "bob", - "description": "I'm Bob, a friendly guy.", - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "arguments": { - "properties": { - "question": { - "description": "The question to ask Bob.", - "type": "string" - } - }, - "type": "object" - }, - "instructions": "#!/bin/bash\n\necho \"Thanks for asking ${question}, I'm doing great fellow friendly AI tool!\"", - "id": "testdata/BobAsShell/test.gpt:bob", - "localTools": { - "": "testdata/BobAsShell/test.gpt:", - "bob": "testdata/BobAsShell/test.gpt:bob" - }, - "source": { - "location": "testdata/BobAsShell/test.gpt", - "lineNo": 7 - }, - "workingDir": "testdata/BobAsShell" - }, - "currentAgent": {}, - "inputContext": null, - "toolName": "bob", - "parentID": "1719586106", - "displayText": "Running bob from testdata/BobAsShell/test.gpt" - }, - "type": "callProgress", - "chatCompletionId": "1719586109", - "usage": {}, - "content": "Thanks for asking how are you doing, I'm doing great fellow friendly AI tool!\n" - }, - { - "time": "2024-06-28T10:48:30.45611-04:00", - "callContext": { - "id": "bob", - "tool": { - "name": "bob", - "description": "I'm Bob, a friendly guy.", - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "arguments": { - "properties": { - "question": { - "description": "The question to ask Bob.", - "type": "string" - } - }, - "type": "object" - }, - "instructions": "#!/bin/bash\n\necho \"Thanks for asking ${question}, I'm doing great fellow friendly AI tool!\"", - "id": "testdata/BobAsShell/test.gpt:bob", - "localTools": { - "": "testdata/BobAsShell/test.gpt:", - "bob": "testdata/BobAsShell/test.gpt:bob" - }, - "source": { - "location": "testdata/BobAsShell/test.gpt", - "lineNo": 7 - }, - "workingDir": "testdata/BobAsShell" - }, - "currentAgent": {}, - "inputContext": null, - "toolName": "bob", - "parentID": "1719586106", - "displayText": "Running bob from testdata/BobAsShell/test.gpt" - }, - "type": "callChat", - "chatCompletionId": "1719586109", - "usage": {}, - "chatResponse": { - "usage": {} - } - }, - { - "time": "2024-06-28T10:48:30.456161-04:00", - "callContext": { - "id": "bob", - "tool": { - "name": "bob", - "description": "I'm Bob, a friendly guy.", - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "arguments": { - "properties": { - "question": { - "description": "The question to ask Bob.", - "type": "string" - } - }, - "type": "object" - }, - "instructions": "#!/bin/bash\n\necho \"Thanks for asking ${question}, I'm doing great fellow friendly AI tool!\"", - "id": "testdata/BobAsShell/test.gpt:bob", - "localTools": { - "": "testdata/BobAsShell/test.gpt:", - "bob": "testdata/BobAsShell/test.gpt:bob" - }, - "source": { - "location": "testdata/BobAsShell/test.gpt", - "lineNo": 7 - }, - "workingDir": "testdata/BobAsShell" - }, - "currentAgent": {}, - "inputContext": null, - "toolName": "bob", - "parentID": "1719586106", - "displayText": "Running bob from testdata/BobAsShell/test.gpt" - }, - "type": "callFinish", - "usage": {}, - "content": "Thanks for asking how are you doing, I'm doing great fellow friendly AI tool!\n" - }, - { - "time": "2024-06-28T10:48:30.456194-04:00", - "callContext": { - "id": "1719586106", - "tool": { - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "tools": [ - "bob" - ], - "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", - "id": "testdata/BobAsShell/test.gpt:", - "toolMapping": { - "bob": [ - { - "reference": "bob", - "toolID": "testdata/BobAsShell/test.gpt:bob" - } - ] - }, - "localTools": { - "": "testdata/BobAsShell/test.gpt:", - "bob": "testdata/BobAsShell/test.gpt:bob" - }, - "source": { - "location": "testdata/BobAsShell/test.gpt", - "lineNo": 1 - }, - "workingDir": "testdata/BobAsShell" - }, - "currentAgent": {}, - "inputContext": null - }, - "toolResults": 1, - "type": "callContinue", - "usage": {} - }, - { - "time": "2024-06-28T10:48:30.652688-04:00", - "callContext": { - "id": "1719586106", - "tool": { - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "tools": [ - "bob" - ], - "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", - "id": "testdata/BobAsShell/test.gpt:", - "toolMapping": { - "bob": [ - { - "reference": "bob", - "toolID": "testdata/BobAsShell/test.gpt:bob" - } - ] - }, - "localTools": { - "": "testdata/BobAsShell/test.gpt:", - "bob": "testdata/BobAsShell/test.gpt:bob" - }, - "source": { - "location": "testdata/BobAsShell/test.gpt", - "lineNo": 1 - }, - "workingDir": "testdata/BobAsShell" - }, - "currentAgent": {}, - "inputContext": null - }, - "type": "callChat", - "chatCompletionId": "1719586110", - "usage": {}, - "chatRequest": { - "model": "claude-3-opus-20240229", - "messages": [ - { - "role": "system", - "content": "Ask Bob \"how are you doing\" and repeat his reply exactly." - }, - { - "role": "assistant", - "content": "", - "tool_calls": [ - { - "id": "bob", - "type": "function", - "function": { - "name": "bob", - "arguments": "{\"question\": \"how are you doing\"}" - } - } - ] - }, - { - "role": "tool", - "content": "Thanks for asking how are you doing, I'm doing great fellow friendly AI tool!\n", - "name": "bob", - "tool_call_id": "bob" - } - ], - "temperature": 0, - "tools": [ - { - "type": "function", - "function": { - "name": "bob", - "description": "I'm Bob, a friendly guy.", - "parameters": { - "properties": { - "question": { - "description": "The question to ask Bob.", - "type": "string" - } - }, - "type": "object" - } - } - } - ] - } - }, - { - "time": "2024-06-28T10:48:30.652933-04:00", - "callContext": { - "id": "1719586106", - "tool": { - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "tools": [ - "bob" - ], - "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", - "id": "testdata/BobAsShell/test.gpt:", - "toolMapping": { - "bob": [ - { - "reference": "bob", - "toolID": "testdata/BobAsShell/test.gpt:bob" - } - ] - }, - "localTools": { - "": "testdata/BobAsShell/test.gpt:", - "bob": "testdata/BobAsShell/test.gpt:bob" - }, - "source": { - "location": "testdata/BobAsShell/test.gpt", - "lineNo": 1 - }, - "workingDir": "testdata/BobAsShell" - }, - "currentAgent": {}, - "inputContext": null - }, - "type": "callProgress", - "chatCompletionId": "1719586110", - "usage": {}, - "content": "Waiting for model response..." - }, - { - "time": "2024-06-28T10:48:33.127339-04:00", - "callContext": { - "id": "1719586106", - "tool": { - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "tools": [ - "bob" - ], - "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", - "id": "testdata/BobAsShell/test.gpt:", - "toolMapping": { - "bob": [ - { - "reference": "bob", - "toolID": "testdata/BobAsShell/test.gpt:bob" - } - ] - }, - "localTools": { - "": "testdata/BobAsShell/test.gpt:", - "bob": "testdata/BobAsShell/test.gpt:bob" - }, - "source": { - "location": "testdata/BobAsShell/test.gpt", - "lineNo": 1 - }, - "workingDir": "testdata/BobAsShell" - }, - "currentAgent": {}, - "inputContext": null - }, - "type": "callProgress", - "chatCompletionId": "1719586110", - "usage": {}, - "content": "Thanks for asking how are you doing, I'm doing great fellow friendly AI tool!" - }, - { - "time": "2024-06-28T10:48:33.127696-04:00", - "callContext": { - "id": "1719586106", - "tool": { - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "tools": [ - "bob" - ], - "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", - "id": "testdata/BobAsShell/test.gpt:", - "toolMapping": { - "bob": [ - { - "reference": "bob", - "toolID": "testdata/BobAsShell/test.gpt:bob" - } - ] - }, - "localTools": { - "": "testdata/BobAsShell/test.gpt:", - "bob": "testdata/BobAsShell/test.gpt:bob" - }, - "source": { - "location": "testdata/BobAsShell/test.gpt", - "lineNo": 1 - }, - "workingDir": "testdata/BobAsShell" - }, - "currentAgent": {}, - "inputContext": null - }, - "type": "callChat", - "chatCompletionId": "1719586110", - "usage": {}, - "chatResponse": { - "role": "assistant", - "content": [ - { - "text": "Thanks for asking how are you doing, I'm doing great fellow friendly AI tool!" - } - ], - "usage": {} - } - }, - { - "time": "2024-06-28T10:48:33.127717-04:00", - "callContext": { - "id": "1719586106", - "tool": { - "modelName": "claude-3-opus-20240229 from github.com/gptscript-ai/claude3-anthropic-provider", - "internalPrompt": null, - "tools": [ - "bob" - ], - "instructions": "Ask Bob \"how are you doing\" and repeat his reply exactly.", - "id": "testdata/BobAsShell/test.gpt:", - "toolMapping": { - "bob": [ - { - "reference": "bob", - "toolID": "testdata/BobAsShell/test.gpt:bob" - } - ] - }, - "localTools": { - "": "testdata/BobAsShell/test.gpt:", - "bob": "testdata/BobAsShell/test.gpt:bob" - }, - "source": { - "location": "testdata/BobAsShell/test.gpt", - "lineNo": 1 - }, - "workingDir": "testdata/BobAsShell" - }, - "currentAgent": {}, - "inputContext": null - }, - "type": "callFinish", - "usage": {}, - "content": "Thanks for asking how are you doing, I'm doing great fellow friendly AI tool!" - }, - { - "time": "2024-06-28T10:48:33.127758-04:00", - "type": "runFinish", - "usage": {} - } -]