[chore] eslint fixes

3b03f07ebfb66f5a61597f5f022cea055e37d31b

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +7 -7Showing whitespace changes
src/prompt-converters.js+7 -7
@@ -722,7 +722,7 @@ export function convertTextCompletionPrompt(messages) {
722722export function cachingAtDepthForClaude(messages, cachingAtDepth) {
723723 let passedThePrefill = false;
724724 let depth = 0;
725725 let previousRoleName = ""'';
726726
727727 for (let i = messages.length - 1; i >= 0; i--) {
728728 if (!passedThePrefill && messages[i].role === 'assistant') {
@@ -734,7 +734,7 @@ export function cachingAtDepthForClaude(messages, cachingAtDepth) {
734734 if (messages[i].role !== previousRoleName) {
735735 if (depth === cachingAtDepth || depth === cachingAtDepth + 2) {
736736 const content = messages[i].content;
737737 content[content.length - 1].cache_control = { type: "'ephemeral"' };
738738 }
739739
740740 if (depth === cachingAtDepth + 2) {
@@ -758,7 +758,7 @@ export function cachingAtDepthForOpenRouterClaude(messages, cachingAtDepth) {
758758 let passedThePrefill = false;
759759 //depth here is the number of message role switches
760760 let depth = 0;
761761 let previousRoleName = ""'';
762762 for (let i = messages.length - 1; i >= 0; i--) {
763763 if (!passedThePrefill && messages[i].role === 'assistant') {
764764 continue;
@@ -773,18 +773,18 @@ export function cachingAtDepthForOpenRouterClaude(messages, cachingAtDepth) {
773773 messages[i].content = [{
774774 type: 'text',
775775 text: content,
776776 cache_control: { type: "'ephemeral"' },
777777 }];
778778 } else {
779779 const contentPartCount = content.length;
780780 content[contentPartCount - 1].cache_control = {
781781 type: "'ephemeral"',
782782 };
783783 }
784784 }
785785
786786 if (depth === cachingAtDepth + 2) {
787787 break;
788788 }
789789
790790 depth += 1;