Skip to content

Commit

Permalink
chore: remove noreply email setting
Browse files Browse the repository at this point in the history
Remove the `OBOT_NO_REPLY_EMAIL_ADDRESS` setting from obot server.
This was specifically added for the `SendGrid` tool which will be
updated to use credentials to capture this setting instead.

Signed-off-by: Nick Hale <[email protected]>
  • Loading branch information
njhale committed Jan 9, 2025
1 parent 0110594 commit 0e331e4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
35 changes: 16 additions & 19 deletions pkg/invoke/invoker.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,24 @@ var (
const ephemeralRunPrefix = "ephemeral-run"

type Invoker struct {
gptClient *gptscript.GPTScript
uncached kclient.WithWatch
gatewayClient *client.Client
tokenService *jwt.TokenService
events *events.Emitter
noReplyEmailAddress string
serverURL string
serverPort int
gptClient *gptscript.GPTScript
uncached kclient.WithWatch
gatewayClient *client.Client
tokenService *jwt.TokenService
events *events.Emitter
serverURL string
serverPort int
}

func NewInvoker(c kclient.WithWatch, gptClient *gptscript.GPTScript, gatewayClient *client.Client, noReplyEmailAddress, serverURL string, serverPort int, tokenService *jwt.TokenService, events *events.Emitter) *Invoker {
func NewInvoker(c kclient.WithWatch, gptClient *gptscript.GPTScript, gatewayClient *client.Client, serverURL string, serverPort int, tokenService *jwt.TokenService, events *events.Emitter) *Invoker {
return &Invoker{
uncached: c,
gptClient: gptClient,
gatewayClient: gatewayClient,
tokenService: tokenService,
events: events,
serverURL: serverURL,
serverPort: serverPort,
noReplyEmailAddress: noReplyEmailAddress,
uncached: c,
gptClient: gptClient,
gatewayClient: gatewayClient,
tokenService: tokenService,
events: events,
serverURL: serverURL,
serverPort: serverPort,
}
}

Expand Down Expand Up @@ -530,8 +528,7 @@ func (i *Invoker) Resume(ctx context.Context, c kclient.WithWatch, thread *v1.Th
"OBOT_USER_NAME="+userName,
"OBOT_USER_EMAIL="+userEmail,
"OBOT_USER_TIMEZONE="+userTimezone,
"OBOT_NO_REPLY_EMAIL="+i.noReplyEmailAddress,
"GPTSCRIPT_HTTP_ENV=OBOT_TOKEN,OBOT_RUN_ID,OBOT_THREAD_ID,OBOT_WORKFLOW_ID,OBOT_WORKFLOW_STEP_ID,OBOT_AGENT_ID,OBOT_NO_REPLY_EMAIL",
"GPTSCRIPT_HTTP_ENV=OBOT_TOKEN,OBOT_RUN_ID,OBOT_THREAD_ID,OBOT_WORKFLOW_ID,OBOT_WORKFLOW_STEP_ID,OBOT_AGENT_ID",
),
DefaultModel: run.Spec.DefaultModel,
DefaultModelProvider: modelProvider,
Expand Down
3 changes: 1 addition & 2 deletions pkg/services/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ type Config struct {
EncryptionConfigFile string `usage:"The path to the encryption configuration file" default:"./encryption.yaml"`
KnowledgeSetIngestionLimit int `usage:"The maximum number of files to ingest into a knowledge set" default:"3000" env:"OBOT_KNOWLEDGESET_INGESTION_LIMIT" name:"knowledge-set-ingestion-limit"`
EmailServerName string `usage:"The name of the email server to display for email receivers"`
NoReplyEmailAddress string `usage:"The email to use for no-reply emails from obot"`
Docker bool `usage:"Enable Docker support" default:"false" env:"OBOT_DOCKER"`

AuthConfig
Expand Down Expand Up @@ -233,7 +232,7 @@ func New(ctx context.Context, config Config) (*Services, error) {
tokenServer = &jwt.TokenService{}
events = events.NewEmitter(storageClient)
gatewayClient = client.New(gatewayDB, config.AuthAdminEmails)
invoker = invoke.NewInvoker(storageClient, c, gatewayClient, config.NoReplyEmailAddress, config.Hostname, config.HTTPListenPort, tokenServer, events)
invoker = invoke.NewInvoker(storageClient, c, gatewayClient, config.Hostname, config.HTTPListenPort, tokenServer, events)
modelProviderDispatcher = dispatcher.New(invoker, storageClient, c)

proxyServer *proxy.Proxy
Expand Down

0 comments on commit 0e331e4

Please sign in to comment.