Skip to content

Commit

Permalink
agents: rename all 'language' to 'lang'
Browse files Browse the repository at this point in the history
  • Loading branch information
chensilun committed Sep 13, 2024
1 parent c691756 commit 79aed08
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions agents/conversational.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@ func (a *ConversationalAgent) GetTools() []tools.Tool {
return a.Tools
}

func constructScratchPad(steps []schema.AgentStep, language i18n.Lang) string {
func constructScratchPad(steps []schema.AgentStep, lang i18n.Lang) string {
var scratchPad string
if len(steps) > 0 {
for _, step := range steps {
scratchPad += step.Action.Log
scratchPad += fmt.Sprintf("\n%s %s", i18n.AgentsMustPhrase(language, "observation"), step.Observation)
scratchPad += fmt.Sprintf("\n%s %s", i18n.AgentsMustPhrase(lang, "observation"), step.Observation)
}
scratchPad += fmt.Sprintf("\n%s", i18n.AgentsMustPhrase(language, "thought"))
scratchPad += fmt.Sprintf("\n%s", i18n.AgentsMustPhrase(lang, "thought"))
}

return scratchPad
Expand Down
6 changes: 3 additions & 3 deletions agents/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ func WithParserErrorHandler(errorHandler *ParserErrorHandler) Option {
}
}

// WithLanguage is an option for setting language the prompt will use.
func WithLanguage(language i18n.Lang) Option {
// WithLang is an option for setting language the prompt will use.
func WithLang(lang i18n.Lang) Option {
return func(co *Options) {
co.lang = language
co.lang = lang
}
}

Expand Down

0 comments on commit 79aed08

Please sign in to comment.