-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix: The issue of prologue in the conversation log #3880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,9 +5,11 @@ | |
| <template v-for="(item, index) in md_view_list" :key="index"> | ||
| <div | ||
| v-if="item.type === 'question'" | ||
| @click="sendMessage ? sendMessage(item.content, 'new') : (content: string) => {}" | ||
| @click=" | ||
| sendMessage && type !== 'log' ? sendMessage(item.content, 'new') : (content: string) => {} | ||
| " | ||
| class="problem-button mt-4 mb-4 flex" | ||
| :class="sendMessage ? 'cursor' : 'disabled'" | ||
| :class="sendMessage && type !== 'log' ? 'cursor' : 'disabled'" | ||
| > | ||
| <el-icon class="mr-8" style="margin-top: 2px"> | ||
| <EditPen /> | ||
|
|
@@ -76,6 +78,7 @@ const props = withDefaults( | |
| chat_record_id?: string | ||
| runtime_node_id?: string | ||
| disabled?: boolean | ||
| type?: 'log' | 'ai-chat' | 'debug-ai-chat' | ||
| }>(), | ||
| { | ||
| source: '', | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No significant issues identified in the provided code snippet. However, there's a minor issue with how you're handling the const props = withDefaults({
// ...
disabled?: boolean
+ type?: 'log' | 'ai-chat' | 'debug-ai-chat',
});This line is missing an opening brace before the colon. It should be updated to: const props = withDefaults({
// ...
disabled?: boolean,
+ type?: 'log' | 'ai-chat' | 'debug-ai-chat',
});Otherwise, the rest of the template, computed properties, methods, and script sections look correct according to the changes made. |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The provided code snippet includes an
el-cardthat wraps an instance of theMdRenderercomponent. The Markdown renderer is likely using props likesource,sendMessage, andreasoning_content. There's no direct issue with these props in terms of correctness or logic for rendering Markdown content.However, if there are additional props intended to be utilized within the
MdRenderercomponent (e.g.,type), ensure they are correctly passed down from the parent component so it can be properly set on the child component.Potential optimizations could involve ensuring that the Vue components used do not have unnecessary dependencies, maintaining optimal performance through efficient handling of reactive data, and possibly leveraging native browser features where applicable to reduce JavaScript overhead.
To further optimize, consider implementing lazy loading techniques for images or multimedia elements present in the rendered Markdown text, which would enhance page load times without compromising visual quality. Additionally, optimizing inline styles might improve layout responsiveness across different browsers and devices.
Lastly, keep an eye out for deprecated patterns or outdated libraries, as they may lead to decreased performance and security vulnerabilities over time. Regularly update packages and follow best practices to maintain robust applications.