MCPcopy Index your code
hub / github.com/coder/coder / Stream

Method Stream

coderd/x/chatd/chatdebug/model.go:240–269  ·  view source on GitHub ↗
(
	ctx context.Context,
	call fantasy.Call,
)

Source from the content-addressed store, hash-verified

238}
239
240func (d *debugModel) Stream(
241 ctx context.Context,
242 call fantasy.Call,
243) (fantasy.StreamResponse, error) {
244 if d.svc == nil {
245 return d.inner.Stream(ctx, call)
246 }
247 if _, ok := RunFromContext(ctx); !ok {
248 return d.inner.Stream(ctx, call)
249 }
250
251 handle, enrichedCtx := beginStep(ctx, d.svc, d.opts, OperationStream,
252 normalizeCall(call))
253 if handle == nil {
254 return d.inner.Stream(ctx, call)
255 }
256
257 seq, err := d.inner.Stream(enrichedCtx, call)
258 if err != nil {
259 handle.finish(ctx, stepStatusForError(err), nil, nil, normalizeError(ctx, err), nil)
260 return nil, err
261 }
262 if seq == nil {
263 err = xerrors.Errorf("Stream: %w", ErrNilModelResult)
264 handle.finish(ctx, StatusError, nil, nil, normalizeError(ctx, err), nil)
265 return nil, err
266 }
267
268 return wrapStreamSeq(ctx, handle, seq), nil
269}
270
271func (d *debugModel) GenerateObject(
272 ctx context.Context,

Calls 8

RunFromContextFunction · 0.85
beginStepFunction · 0.85
normalizeCallFunction · 0.85
stepStatusForErrorFunction · 0.85
normalizeErrorFunction · 0.85
wrapStreamSeqFunction · 0.85
finishMethod · 0.80
ErrorfMethod · 0.45