@@ -149,7 +149,7 @@ messages:
149149 require .Contains (t , out .String (), reply ) // response streamed to output
150150 })
151151
152- t .Run ("--file with {{input}} placeholder is substituted with stdin" , func (t * testing.T ) {
152+ t .Run ("--file with {{input}} placeholder is substituted with initial prompt and stdin" , func (t * testing.T ) {
153153 const yamlBody = `
154154name: Summarizer
155155description: Summarizes input text
@@ -208,18 +208,21 @@ messages:
208208
209209 out := new (bytes.Buffer )
210210 cfg := command .NewConfig (out , out , client , true , 100 )
211+
212+ initialPrompt := "Please summarize the provided text."
211213 runCmd := NewRunCommand (cfg )
212214 runCmd .SetArgs ([]string {
213215 "--file" , tmp .Name (),
214216 azuremodels .FormatIdentifier ("openai" , "test-model" ),
217+ initialPrompt ,
215218 })
216219
217220 _ , err = runCmd .ExecuteC ()
218221 require .NoError (t , err )
219222
220223 require .Len (t , capturedReq .Messages , 3 )
221224 require .Equal (t , "You are a text summarizer." , * capturedReq .Messages [0 ].Content )
222- require .Equal (t , piped , * capturedReq .Messages [1 ].Content ) // {{input}} -> "Hello there!"
225+ require .Equal (t , initialPrompt + " \n " + piped , * capturedReq .Messages [1 ].Content ) // {{input}} -> "Please summarize the provided text.\nHello there!"
223226
224227 require .Contains (t , out .String (), reply )
225228 })
0 commit comments