Commit a6046cd
authored
refactor(component,ai,gemini): merge usage and usage-metadata fields into single usage field (#1126)
Because
- We have the unified `usage` field for `TASK_CHAT` in different AI
components
- The Gemini component had redundant `usage` and `usage-metadata` fields
that provided overlapping token usage information
- The `usage` field was a simple object while `usage-metadata` contained
detailed structured information
This commit
- Merges the `usage` and `usage-metadata` fields into a single
comprehensive `usage` field
- Updates the YAML schema to reference the detailed `usage-metadata`
definition for the `usage` field
- Removes the separate `usage-metadata` field from the output schema and
Go structs
- Updates all related code to populate and access usage information
through the unified `usage` field
- Maintains backward compatibility by preserving all detailed token
usage statistics (prompt tokens, cached tokens, candidates tokens, etc.)
with kebab-case naming1 parent 3117046 commit a6046cd
File tree
4 files changed
+22
-30
lines changed- pkg/component/ai/gemini/v0
- config
4 files changed
+22
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1649 | 1649 | | |
1650 | 1650 | | |
1651 | 1651 | | |
1652 | | - | |
| 1652 | + | |
1653 | 1653 | | |
1654 | 1654 | | |
1655 | 1655 | | |
| |||
1660 | 1660 | | |
1661 | 1661 | | |
1662 | 1662 | | |
1663 | | - | |
| 1663 | + | |
1664 | 1664 | | |
1665 | 1665 | | |
1666 | 1666 | | |
1667 | 1667 | | |
1668 | | - | |
| 1668 | + | |
1669 | 1669 | | |
1670 | 1670 | | |
1671 | 1671 | | |
1672 | 1672 | | |
1673 | 1673 | | |
1674 | 1674 | | |
1675 | | - | |
| 1675 | + | |
1676 | 1676 | | |
1677 | 1677 | | |
1678 | 1678 | | |
1679 | 1679 | | |
1680 | 1680 | | |
1681 | 1681 | | |
1682 | | - | |
| 1682 | + | |
1683 | 1683 | | |
1684 | 1684 | | |
1685 | | - | |
| 1685 | + | |
1686 | 1686 | | |
1687 | 1687 | | |
1688 | 1688 | | |
1689 | 1689 | | |
1690 | 1690 | | |
1691 | 1691 | | |
1692 | | - | |
| 1692 | + | |
1693 | 1693 | | |
1694 | 1694 | | |
1695 | 1695 | | |
1696 | 1696 | | |
1697 | | - | |
| 1697 | + | |
1698 | 1698 | | |
1699 | 1699 | | |
1700 | | - | |
| 1700 | + | |
1701 | 1701 | | |
1702 | 1702 | | |
1703 | 1703 | | |
| |||
1732 | 1732 | | |
1733 | 1733 | | |
1734 | 1734 | | |
1735 | | - | |
1736 | | - | |
1737 | | - | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
1738 | 1738 | | |
1739 | 1739 | | |
1740 | 1740 | | |
| |||
1745 | 1745 | | |
1746 | 1746 | | |
1747 | 1747 | | |
1748 | | - | |
1749 | | - | |
1750 | | - | |
1751 | 1748 | | |
1752 | | - | |
| 1749 | + | |
1753 | 1750 | | |
1754 | 1751 | | |
1755 | | - | |
| 1752 | + | |
1756 | 1753 | | |
1757 | 1754 | | |
1758 | 1755 | | |
1759 | 1756 | | |
1760 | | - | |
| 1757 | + | |
1761 | 1758 | | |
1762 | 1759 | | |
1763 | 1760 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | 68 | | |
70 | 69 | | |
71 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
268 | | - | |
269 | 268 | | |
270 | 269 | | |
271 | 270 | | |
272 | 271 | | |
273 | 272 | | |
274 | 273 | | |
275 | 274 | | |
276 | | - | |
277 | 275 | | |
278 | 276 | | |
279 | 277 | | |
| |||
392 | 390 | | |
393 | 391 | | |
394 | 392 | | |
395 | | - | |
396 | 393 | | |
397 | 394 | | |
398 | 395 | | |
399 | 396 | | |
400 | 397 | | |
401 | 398 | | |
402 | | - | |
403 | 399 | | |
404 | 400 | | |
405 | 401 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
780 | 780 | | |
781 | 781 | | |
782 | 782 | | |
783 | | - | |
| 783 | + | |
784 | 784 | | |
785 | 785 | | |
786 | 786 | | |
| |||
1007 | 1007 | | |
1008 | 1008 | | |
1009 | 1009 | | |
1010 | | - | |
1011 | | - | |
| 1010 | + | |
| 1011 | + | |
1012 | 1012 | | |
1013 | 1013 | | |
1014 | 1014 | | |
| |||
1082 | 1082 | | |
1083 | 1083 | | |
1084 | 1084 | | |
1085 | | - | |
| 1085 | + | |
1086 | 1086 | | |
1087 | 1087 | | |
1088 | 1088 | | |
| |||
1254 | 1254 | | |
1255 | 1255 | | |
1256 | 1256 | | |
1257 | | - | |
| 1257 | + | |
1258 | 1258 | | |
1259 | 1259 | | |
1260 | 1260 | | |
| |||
1757 | 1757 | | |
1758 | 1758 | | |
1759 | 1759 | | |
1760 | | - | |
1761 | | - | |
| 1760 | + | |
| 1761 | + | |
1762 | 1762 | | |
1763 | 1763 | | |
1764 | 1764 | | |
| |||
0 commit comments