mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-22 11:20:15 +01:00
🪨 fix: Minor AWS Bedrock/Misc. Improvements (#3974)
* refactor(EditMessage): avoid manipulation of native paste handling, leverage react-hook-form for textarea changes * style: apply better theming for MinimalIcon * fix(useVoicesQuery/useCustomConfigSpeechQuery): make sure to only try request once per render * feat: edit message content parts * fix(useCopyToClipboard): handle both assistants and agents content blocks * refactor: remove save & submit and update text content correctly * chore(.env.example/config): exclude unsupported bedrock models * feat: artifacts for aws bedrock * fix: export options for bedrock conversations
This commit is contained in:
parent
341e086d70
commit
1a1e6850a3
23 changed files with 441 additions and 203 deletions
|
|
@ -11,7 +11,7 @@ export const getLengthAndLastTenChars = (str?: string): string => {
|
|||
return `${length}${lastTenChars}`;
|
||||
};
|
||||
|
||||
export const getLatestText = (message?: TMessage | null, includeIndex?: boolean) => {
|
||||
export const getLatestText = (message?: TMessage | null, includeIndex?: boolean): string => {
|
||||
if (!message) {
|
||||
return '';
|
||||
}
|
||||
|
|
@ -21,11 +21,12 @@ export const getLatestText = (message?: TMessage | null, includeIndex?: boolean)
|
|||
if (message.content && message.content.length > 0) {
|
||||
for (let i = message.content.length - 1; i >= 0; i--) {
|
||||
const part = message.content[i];
|
||||
if (
|
||||
part.type === ContentTypes.TEXT &&
|
||||
((part[ContentTypes.TEXT].value as string | undefined)?.length ?? 0) > 0
|
||||
) {
|
||||
const text = part[ContentTypes.TEXT].value;
|
||||
if (part.type !== ContentTypes.TEXT) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const text = (typeof part.text === 'string' ? part.text : part.text.value) || '';
|
||||
if (text.length > 0) {
|
||||
if (includeIndex === true) {
|
||||
return `${text}-${i}`;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue