stream in script mode

This commit is contained in:
Ed Zynda
2025-06-27 16:40:42 +03:00
parent 7b2592bbdc
commit 47718a7fed
2 changed files with 9 additions and 4 deletions
+8 -4
View File
@@ -127,6 +127,9 @@ func overrideConfigWithFrontmatter(scriptFile string, variables map[string]strin
// Set the global noExitFlag variable if it wasn't explicitly set via command line
noExitFlag = scriptConfig.NoExit
}
if scriptConfig.Stream != nil && !flagChanged("stream") {
viper.Set("stream", *scriptConfig.Stream)
}
}
// parseCustomVariables extracts custom variables from command line arguments
@@ -549,10 +552,11 @@ func runScriptMode(ctx context.Context, mcpConfig *config.Config, prompt string,
// Create agent configuration
agentConfig := &agent.AgentConfig{
ModelConfig: modelConfig,
MCPConfig: mcpConfig,
SystemPrompt: systemPrompt,
MaxSteps: finalMaxSteps,
ModelConfig: modelConfig,
MCPConfig: mcpConfig,
SystemPrompt: systemPrompt,
MaxSteps: finalMaxSteps,
StreamingEnabled: viper.GetBool("stream"),
}
// Create the agent
+1
View File
@@ -108,6 +108,7 @@ type Config struct {
ProviderURL string `json:"provider-url,omitempty" yaml:"provider-url,omitempty"`
Prompt string `json:"prompt,omitempty" yaml:"prompt,omitempty"`
NoExit bool `json:"no-exit,omitempty" yaml:"no-exit,omitempty"`
Stream *bool `json:"stream,omitempty" yaml:"stream,omitempty"`
// Model generation parameters
MaxTokens int `json:"max-tokens,omitempty" yaml:"max-tokens,omitempty"`