Skip to content

Commit

Permalink
Agent.Config is exported.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ric Szopa authored and Ric Szopa committed May 23, 2023
1 parent 39a69c9 commit fc22afe
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions agent/agents.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
type Agent struct {
name string
Messages []openai.ChatCompletionMessage
config agentConfig
Config agentConfig
}

func (ag *Agent) Name() string {
Expand All @@ -27,7 +27,7 @@ func New(name string, options ...Option) *Agent {
}

for _, opt := range options {
opt(&ag.config)
opt(&ag.Config)
}

return ag
Expand All @@ -50,7 +50,7 @@ func (ag *Agent) Listen(message string) {
}

func (ag *Agent) createRequest(options []Option) (agentConfig, openai.ChatCompletionRequest) {
cfg := ag.config.clone()
cfg := ag.Config.clone()
for _, opt := range options {
opt(&cfg)
}
Expand All @@ -61,6 +61,8 @@ func (ag *Agent) createRequest(options []Option) (agentConfig, openai.ChatComple
}

// Respond gets a response from the actor, basing on the current conversation.
// The options passed to Respond will be applied for this call, but won't affect
// subsequent calls.
func (ag *Agent) Respond(ctx context.Context, options ...Option) (message string, err error) {

logger := log.WithField("actor", ag.name)
Expand Down

0 comments on commit fc22afe

Please sign in to comment.