@@ -288,6 +288,7 @@ type simpleRunner struct {
288
288
func newSimpleRunner (cache * cache.Client , rm engine.RuntimeManager , env []string ) (* simpleRunner , error ) {
289
289
runner , err := runner .New (noopModel {}, credentials.NoopStore {}, runner.Options {
290
290
RuntimeManager : rm ,
291
+ MonitorFactory : simpleMonitorFactory {},
291
292
})
292
293
if err != nil {
293
294
return nil , err
@@ -319,3 +320,33 @@ func (n noopModel) Call(_ context.Context, _ types.CompletionRequest, _ []string
319
320
func (n noopModel ) ProxyInfo () (string , string , error ) {
320
321
return "" , "" , errors .New ("unsupported" )
321
322
}
323
+
324
+ type simpleMonitorFactory struct {
325
+ }
326
+
327
+ func (s simpleMonitorFactory ) Start (_ context.Context , _ * types.Program , _ []string , _ string ) (runner.Monitor , error ) {
328
+ return simpleMonitor {}, nil
329
+ }
330
+
331
+ func (s simpleMonitorFactory ) Pause () func () {
332
+ //TODO implement me
333
+ panic ("implement me" )
334
+ }
335
+
336
+ type simpleMonitor struct {
337
+ }
338
+
339
+ func (s simpleMonitor ) Stop (_ context.Context , _ string , _ error ) {
340
+ }
341
+
342
+ func (s simpleMonitor ) Event (event runner.Event ) {
343
+ if event .Type == runner .EventTypeCallProgress {
344
+ if ! strings .HasPrefix (event .Content , "{" ) {
345
+ fmt .Println (event .Content )
346
+ }
347
+ }
348
+ }
349
+
350
+ func (s simpleMonitor ) Pause () func () {
351
+ return func () {}
352
+ }
0 commit comments