Commit 5afafe9
[AiAgent] Include explanation in function call history entry
When the model provides both a text explanation and a function call
in the same response, ensure both are added to the conversation history
as a single message with multiple parts.
Previously, the explanation was treated as a standalone answer which
caused the explanation from the function calls to be not included
in the history.
This CL:
* Modifies AiAgent.ts to avoid pushing a separate text-only history
entry when a function call is also present.
* Passes the explanation text to `#callFunction`.
* Updates #callFunction to combine the explanation (if present) and
the function call into a single multi-part history entry.
* Adds a unit test in AiAgent.test.ts to verify that the history is
correctly constructed with both the explanation and the function call.
Fixed: 464443653
Change-Id: I2b8e47eb2be7329efe78cd10a0c6b873123f6f23
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/7209254
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Auto-Submit: Ergün Erdoğmuş <ergunsh@chromium.org>
Commit-Queue: Nikolay Vitkov <nvitkov@chromium.org>
Reviewed-by: Nikolay Vitkov <nvitkov@chromium.org>1 parent 9b261e7 commit 5afafe9
4 files changed
Lines changed: 77 additions & 16 deletions
File tree
- front_end/models/ai_assistance/agents
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
473 | 473 | | |
474 | 474 | | |
475 | 475 | | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
476 | 517 | | |
477 | 518 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
573 | 573 | | |
574 | 574 | | |
575 | 575 | | |
576 | | - | |
577 | | - | |
578 | | - | |
579 | | - | |
580 | | - | |
581 | | - | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
582 | 584 | | |
583 | 585 | | |
584 | 586 | | |
| |||
587 | 589 | | |
588 | 590 | | |
589 | 591 | | |
590 | | - | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
591 | 595 | | |
592 | 596 | | |
593 | 597 | | |
594 | 598 | | |
595 | | - | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
596 | 603 | | |
597 | 604 | | |
598 | 605 | | |
| |||
623 | 630 | | |
624 | 631 | | |
625 | 632 | | |
626 | | - | |
| 633 | + | |
627 | 634 | | |
628 | 635 | | |
629 | 636 | | |
630 | 637 | | |
631 | 638 | | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
632 | 651 | | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
| 652 | + | |
639 | 653 | | |
640 | 654 | | |
641 | 655 | | |
| |||
744 | 758 | | |
745 | 759 | | |
746 | 760 | | |
| 761 | + | |
747 | 762 | | |
748 | 763 | | |
749 | 764 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
401 | 406 | | |
402 | 407 | | |
403 | 408 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
530 | 530 | | |
531 | 531 | | |
532 | 532 | | |
533 | | - | |
| 533 | + | |
534 | 534 | | |
535 | 535 | | |
536 | 536 | | |
| |||
0 commit comments