(t *testing.T)
| 387 | } |
| 388 | |
| 389 | func mustAdvisorRuntime(t *testing.T) *chatadvisor.Runtime { |
| 390 | t.Helper() |
| 391 | |
| 392 | runtime, err := chatadvisor.NewRuntime(chatadvisor.RuntimeConfig{ |
| 393 | Model: &chattest.FakeModel{ |
| 394 | ProviderName: "test-provider", |
| 395 | ModelName: "test-model", |
| 396 | StreamFn: func(_ context.Context, _ fantasy.Call) (fantasy.StreamResponse, error) { |
| 397 | return streamFromParts([]fantasy.StreamPart{ |
| 398 | {Type: fantasy.StreamPartTypeTextStart, ID: "text-1"}, |
| 399 | {Type: fantasy.StreamPartTypeTextDelta, ID: "text-1", Delta: "fallback advice"}, |
| 400 | {Type: fantasy.StreamPartTypeTextEnd, ID: "text-1"}, |
| 401 | {Type: fantasy.StreamPartTypeFinish, FinishReason: fantasy.FinishReasonStop}, |
| 402 | }), nil |
| 403 | }, |
| 404 | }, |
| 405 | MaxUsesPerRun: 2, |
| 406 | MaxOutputTokens: 64, |
| 407 | }) |
| 408 | require.NoError(t, err) |
| 409 | return runtime |
| 410 | } |
| 411 | |
| 412 | func advisorToolCapturingQuestion(t *testing.T, capturedQuestion *string) fantasy.AgentTool { |
| 413 | t.Helper() |
no test coverage detected