Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
okamoto-aws committed Aug 11, 2024
1 parent 50a07a9 commit 23e0960
Show file tree
Hide file tree
Showing 6 changed files with 140 additions and 131 deletions.
4 changes: 2 additions & 2 deletions browser-extension/src/app/features/chat/ChatMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const ChatMessage: React.FC<Props> = (props) => {
className={twMerge(
'border-t last:border-b p-2',
isUser ? 'bg-aws-squid-ink brightness-150' : '',
props.className
props.className,
)}
>
{message.title && (
Expand All @@ -39,7 +39,7 @@ const ChatMessage: React.FC<Props> = (props) => {
className={twMerge(
'transition-all ',
message.role === 'system' && isOpen && 'max-h-[300px] overflow-y-auto',
message.role === 'system' && !isOpen && 'max-h-0 overflow-hidden'
message.role === 'system' && !isOpen && 'max-h-0 overflow-hidden',
)}
>
{message.content.split('\n').map((c, idx) => (
Expand Down
8 changes: 4 additions & 4 deletions browser-extension/src/app/features/chat/chatSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const chatSlice = createSlice({
},
updateMessageContent: (
state,
action: PayloadAction<TabId & { index: number; content: string }>
action: PayloadAction<TabId & { index: number; content: string }>,
) => {
setInitialStateIfNeeded(state, action.payload.tabId);
state[action.payload.tabId].messages[action.payload.index].content = action.payload.content;
Expand All @@ -63,7 +63,7 @@ export const replaceMessages =
setMessages({
tabId,
messages,
})
}),
);
};

Expand All @@ -78,7 +78,7 @@ export const pushMessages =
messages: produce(currentMessages, (draft) => {
draft.push(...messages);
}),
})
}),
);
};

Expand All @@ -95,7 +95,7 @@ export const overwriteLatestMessage =
tabId,
index: currentMessages.length - 1,
content: content.replace(/<([^>]+)>([\s\S]*?)<\/\1>/, '$2'),
})
}),
);
};

Expand Down
2 changes: 1 addition & 1 deletion browser-extension/src/app/features/chat/useChat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const useChat = () => {
role: 'assistant',
content: '▍',
},
])
]),
);

// Assistant の発言を更新
Expand Down
2 changes: 1 addition & 1 deletion packages/cdk/lambda/utils/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ const createBodyImageTitanImage = (params: GenerateImageParams) => {
} else {
body = {
imageGenerationConfig: imageGenerationConfig,
}
};
}
return JSON.stringify(body);
};
Expand Down
20 changes: 10 additions & 10 deletions packages/types/src/image.d.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
export type ControlMode = 'CANNY_EDGE' | 'SEGMENTATION'
export type ControlMode = 'CANNY_EDGE' | 'SEGMENTATION';
export type BaseGenerationMode =
| 'TEXT_IMAGE'
| 'IMAGE_VARIATION'
| 'INPAINTING'
| 'OUTPAINTING'
| 'OUTPAINTING';
export type TitanImageV2GenerationMode =
| 'IMAGE_CONDITIONING'
| 'COLOR_GUIDED_GENERATION'
| 'BACKGROUND_REMOVAL';
export type GenerationMode = BaseGenerationMode | TitanImageV2GenerationMode
export type GenerationMode = BaseGenerationMode | TitanImageV2GenerationMode;
// 標準化したパラメータ
export type GenerateImageParams = {
taskType?:
| 'TEXT_IMAGE'
| 'IMAGE_VARIATION'
| 'INPAINTING'
| 'OUTPAINTING'
| 'IMAGE_CONDITIONING'
| 'COLOR_GUIDED_GENERATION'
| 'BACKGROUND_REMOVAL';
| 'TEXT_IMAGE'
| 'IMAGE_VARIATION'
| 'INPAINTING'
| 'OUTPAINTING'
| 'IMAGE_CONDITIONING'
| 'COLOR_GUIDED_GENERATION'
| 'BACKGROUND_REMOVAL';
textPrompt: {
text: string;
weight: number;
Expand Down
Loading

0 comments on commit 23e0960

Please sign in to comment.