Add --input-has-vars flag to control variable substitution in input

- Add InputHasVars field to ChatRequest struct
- Only process template variables in user input when flag is set
- Fixes issue with Ansible/Jekyll templates that use {{var}} syntax

This change makes template variable substitution in user input opt-in
via the --input-has-vars flag, preserving literal curly braces by
default.
This commit is contained in:
Matt Joyce
2024-12-10 18:49:18 +11:00
parent f5f50cc4c9
commit 01519d7486
3 changed files with 8 additions and 3 deletions

View File

@@ -12,6 +12,7 @@ type ChatRequest struct {
Message *goopenai.ChatCompletionMessage
Language string
Meta string
InputHasVars bool
}
type ChatOptions struct {