mirror of
https://github.com/mark3labs/kit.git
synced 2026-06-14 03:30:26 +00:00
stream in script mode
This commit is contained in:
+8
-4
@@ -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
|
||||
|
||||
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user