Skip to content

Commit

Permalink
chore: read GPTSCRIPT_CREDENTIAL_OVERRIDE
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuildthecloud committed Jan 8, 2025
1 parent 85ab705 commit f839833
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/services/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/gptscript-ai/gptscript/pkg/cache"
gptscriptai "github.com/gptscript-ai/gptscript/pkg/gptscript"
"github.com/gptscript-ai/gptscript/pkg/loader"
"github.com/gptscript-ai/gptscript/pkg/runner"
"github.com/gptscript-ai/gptscript/pkg/sdkserver"
baaah "github.com/obot-platform/nah"
"github.com/obot-platform/nah/pkg/leader"
Expand Down Expand Up @@ -115,11 +116,18 @@ func newGPTScript(ctx context.Context, workspaceTool, datasetsTool, toolsRegistr
})
}

credOverrides := strings.Split(os.Getenv("GPTSCRIPT_CREDENTIAL_OVERRIDE"), ",")
if len(credOverrides) == 1 && strings.TrimSpace(credOverrides[0]) == "" {
credOverrides = nil
}
url, err := sdkserver.EmbeddedStart(ctx, sdkserver.Options{
Options: gptscriptai.Options{
Cache: cache.Options{
CacheDir: os.Getenv("GPTSCRIPT_CACHE_DIR"),
},
Runner: runner.Options{
CredentialOverrides: credOverrides,
},
SystemToolsDir: os.Getenv("GPTSCRIPT_SYSTEM_TOOLS_DIR"),
},
DatasetTool: datasetsTool,
Expand Down

0 comments on commit f839833

Please sign in to comment.