@@ -149,7 +149,7 @@ messages:
149
149
require .Contains (t , out .String (), reply ) // response streamed to output
150
150
})
151
151
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 ) {
153
153
const yamlBody = `
154
154
name: Summarizer
155
155
description: Summarizes input text
@@ -208,18 +208,21 @@ messages:
208
208
209
209
out := new (bytes.Buffer )
210
210
cfg := command .NewConfig (out , out , client , true , 100 )
211
+
212
+ initialPrompt := "Please summarize the provided text."
211
213
runCmd := NewRunCommand (cfg )
212
214
runCmd .SetArgs ([]string {
213
215
"--file" , tmp .Name (),
214
216
azuremodels .FormatIdentifier ("openai" , "test-model" ),
217
+ initialPrompt ,
215
218
})
216
219
217
220
_ , err = runCmd .ExecuteC ()
218
221
require .NoError (t , err )
219
222
220
223
require .Len (t , capturedReq .Messages , 3 )
221
224
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}} -> "Hello there!"
223
226
224
227
require .Contains (t , out .String (), reply )
225
228
})
0 commit comments