Skip to content
Merged
2 changes: 1 addition & 1 deletion .github/workflows/depsreview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6 # v3
- uses: actions/checkout@v6
- uses: actions/dependency-review-action@v4
with:
allow-licenses: BSD-2-Clause, BSD-3-Clause, MIT, Apache-2.0, MPL-2.0
1 change: 1 addition & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,6 @@ func init() {
rootCmd.PersistentFlags().StringVarP(&global.VoiceflowSubdomain, "voiceflow-subdomain", "b", "", "Voiceflow Base URL (optional). Default: empty")
rootCmd.PersistentFlags().BoolVarP(&global.SkipUpdate, "skip-update-check", "u", false, "Skip the check for updates check run before every command (optional)")
rootCmd.PersistentFlags().StringVarP(&global.Output, "output-format", "o", "text", "Output Format. Options: text, json. Default: text (optional)")
rootCmd.PersistentFlags().BoolVar(&global.ShowTesterMessages, "show-tester-messages", true, "Show tester agent messages in agent-to-agent tests (optional)")

}
3 changes: 3 additions & 0 deletions cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ The server includes auto-generated OpenAPI/Swagger documentation available at /s

voiceflow.SetVoiceflowAPIKey()
openai.SetOpenAIAPIKey()

// Enable tester messages in server mode for better observability
global.ShowTesterMessages = true

config := &server.ServerConfig{
Port: port,
Expand Down
1 change: 1 addition & 0 deletions internal/global/vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ var VersionString string
var Output string
var Verbose bool
var SkipUpdate bool
var ShowTesterMessages bool
13 changes: 11 additions & 2 deletions pkg/test/agent-runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"strings"

"github.com/xavidop/voiceflow-cli/internal/global"
"github.com/xavidop/voiceflow-cli/internal/types/tests"
"github.com/xavidop/voiceflow-cli/internal/types/voiceflow/interact"
)
Expand Down Expand Up @@ -193,10 +194,18 @@ Provide only your response message, without any explanation or meta-commentary.
return "", fmt.Errorf("error generating response: %w", err)
}

// Optimize by trimming response once to avoid redundant string operations
trimmedResponse := strings.TrimSpace(response)

// Add the agent's response to conversation history
atr.AddToChatHistory("assistant", response)
atr.AddToChatHistory("assistant", trimmedResponse)

// Log the generated tester agent response if the flag is enabled
if global.ShowTesterMessages {
atr.addLog(fmt.Sprintf("Tester agent message: %s", trimmedResponse))
}

return strings.TrimSpace(response), nil
return trimmedResponse, nil
}

// checkForUserInfoRequest uses OpenAI to determine which user information is being requested and provides it
Expand Down
6 changes: 5 additions & 1 deletion pkg/test/voiceflow-agent-runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package test
import (
"fmt"

"github.com/xavidop/voiceflow-cli/internal/global"
"github.com/xavidop/voiceflow-cli/internal/types/tests"
"github.com/xavidop/voiceflow-cli/internal/types/voiceflow/interact"
)
Expand Down Expand Up @@ -89,7 +90,10 @@ func (vatr *VoiceflowAgentTestRunner) ExecuteAgentTest(agentTest tests.AgentTest
break
}

vatr.addLog(fmt.Sprintf("Tester agent says: %s", testerMessage))
// Log the tester agent's message to the target agent if the flag is enabled
if global.ShowTesterMessages {
vatr.addLog(fmt.Sprintf("Tester agent says: %s", testerMessage))
}

// Send tester's message to target agent
targetAgentResponse, err = vatr.interactWithTargetAgent("text", testerMessage)
Expand Down
Loading