= ({ tools }) => {
+ return (
+
+ {tools.map((tool, index) => {
+ const config = TOOL_CONFIGS[tool] || { icon: 'default-icon', description: tool };
+ return (
+
+
+ {config.description}
+
+ );
+ })}
+
+ );
+};
+```
+
+### 💡 Best Practices
+
+1. **Gradual Customization**: Start with configuration changes, then move to styling and advanced features
+2. **Theme Consistency**: Maintain consistent styling across all components
+3. **Accessibility**: Ensure customizations don't break accessibility features
+4. **Performance**: Test that customizations don't impact performance
+5. **Maintainability**: Document custom changes for future team members
+6. **User Testing**: Validate customizations with real users
+7. **Responsive Design**: Test customizations across different screen sizes
+8. **Error Handling**: Implement robust error handling for custom features
+
+This comprehensive customization guide provides you with all the tools needed to tailor the Lightspeed Chatbot to your specific requirements while maintaining code quality and user experience standards.
\ No newline at end of file
diff --git a/src/app/LightspeedChatbot/hooks/useChatbot.ts b/src/app/LightspeedChatbot/hooks/useChatbot.ts
index 2148936..11b4a8c 100644
--- a/src/app/LightspeedChatbot/hooks/useChatbot.ts
+++ b/src/app/LightspeedChatbot/hooks/useChatbot.ts
@@ -257,6 +257,8 @@ export const useChatbot = () => {
setFileError(undefined);
};
+
+
const handleSend = async (message: string | number) => {
setIsSendButtonDisabled(true);
const messageContent = String(message);
@@ -393,6 +395,12 @@ export const useChatbot = () => {
share: { onClick: () => {} },
listen: { onClick: () => {} },
},
+ sources: endData.referenced_documents && endData.referenced_documents.length > 0 ? {
+ sources: endData.referenced_documents.map(doc => ({
+ title: doc.doc_title,
+ link: doc.doc_url,
+ })),
+ } : undefined,
};
}
return updatedMessages;
diff --git a/src/app/LightspeedChatbot/types.ts b/src/app/LightspeedChatbot/types.ts
index 813566c..c1537cf 100644
--- a/src/app/LightspeedChatbot/types.ts
+++ b/src/app/LightspeedChatbot/types.ts
@@ -57,7 +57,10 @@ export interface StreamTokenData {
}
export interface StreamEndData {
- referenced_documents: any[];
+ referenced_documents: Array<{
+ doc_url: string;
+ doc_title: string;
+ }>;
truncated: any;
input_tokens: number;
output_tokens: number;