[chore] eslint fixes
| @@ -722,7 +722,7 @@ export function convertTextCompletionPrompt(messages) { | |||
| 722 | export function cachingAtDepthForClaude(messages, cachingAtDepth) { | 722 | export function cachingAtDepthForClaude(messages, cachingAtDepth) { |
| 723 | let passedThePrefill = false; | 723 | let passedThePrefill = false; |
| 724 | let depth = 0; | 724 | let depth = 0; |
| 725 | let previousRoleName = ""; | 725 | let previousRoleName = ''; |
| 726 | 726 | ||
| 727 | for (let i = messages.length - 1; i >= 0; i--) { | 727 | for (let i = messages.length - 1; i >= 0; i--) { |
| 728 | if (!passedThePrefill && messages[i].role === 'assistant') { | 728 | if (!passedThePrefill && messages[i].role === 'assistant') { |
| @@ -734,7 +734,7 @@ export function cachingAtDepthForClaude(messages, cachingAtDepth) { | |||
| 734 | if (messages[i].role !== previousRoleName) { | 734 | if (messages[i].role !== previousRoleName) { |
| 735 | if (depth === cachingAtDepth || depth === cachingAtDepth + 2) { | 735 | if (depth === cachingAtDepth || depth === cachingAtDepth + 2) { |
| 736 | const content = messages[i].content; | 736 | const content = messages[i].content; |
| 737 | content[content.length - 1].cache_control = {type: "ephemeral"}; | 737 | content[content.length - 1].cache_control = { type: 'ephemeral' }; |
| 738 | } | 738 | } |
| 739 | 739 | ||
| 740 | if (depth === cachingAtDepth + 2) { | 740 | if (depth === cachingAtDepth + 2) { |
| @@ -758,7 +758,7 @@ export function cachingAtDepthForOpenRouterClaude(messages, cachingAtDepth) { | |||
| 758 | let passedThePrefill = false; | 758 | let passedThePrefill = false; |
| 759 | //depth here is the number of message role switches | 759 | //depth here is the number of message role switches |
| 760 | let depth = 0; | 760 | let depth = 0; |
| 761 | let previousRoleName = ""; | 761 | let previousRoleName = ''; |
| 762 | for (let i = messages.length - 1; i >= 0; i--) { | 762 | for (let i = messages.length - 1; i >= 0; i--) { |
| 763 | if (!passedThePrefill && messages[i].role === 'assistant') { | 763 | if (!passedThePrefill && messages[i].role === 'assistant') { |
| 764 | continue; | 764 | continue; |
| @@ -773,18 +773,18 @@ export function cachingAtDepthForOpenRouterClaude(messages, cachingAtDepth) { | |||
| 773 | messages[i].content = [{ | 773 | messages[i].content = [{ |
| 774 | type: 'text', | 774 | type: 'text', |
| 775 | text: content, | 775 | text: content, |
| 776 | cache_control: {type: "ephemeral"}, | 776 | cache_control: { type: 'ephemeral' }, |
| 777 | }]; | 777 | }]; |
| 778 | } else { | 778 | } else { |
| 779 | const contentPartCount = content.length; | 779 | const contentPartCount = content.length; |
| 780 | content[contentPartCount - 1].cache_control = { | 780 | content[contentPartCount - 1].cache_control = { |
| 781 | type: "ephemeral" | 781 | type: 'ephemeral', |
| 782 | } | 782 | }; |
| 783 | } | 783 | } |
| 784 | } | 784 | } |
| 785 | 785 | ||
| 786 | if (depth === cachingAtDepth + 2) { | 786 | if (depth === cachingAtDepth + 2) { |
| 787 | break | 787 | break; |
| 788 | } | 788 | } |
| 789 | 789 | ||
| 790 | depth += 1; | 790 | depth += 1; |