mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-23 02:44:08 +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
|
|
@ -12,6 +12,7 @@ export const bedrockInputSchema = s.tConversationSchema
|
|||
spec: true,
|
||||
maxOutputTokens: true,
|
||||
maxContextTokens: true,
|
||||
artifacts: true,
|
||||
/* Bedrock params; optionType: 'model' */
|
||||
region: true,
|
||||
system: true,
|
||||
|
|
@ -38,6 +39,7 @@ export const bedrockInputParser = s.tConversationSchema
|
|||
iconURL: true,
|
||||
greeting: true,
|
||||
spec: true,
|
||||
artifacts: true,
|
||||
maxOutputTokens: true,
|
||||
maxContextTokens: true,
|
||||
/* Bedrock params; optionType: 'model' */
|
||||
|
|
@ -61,6 +63,7 @@ export const bedrockInputParser = s.tConversationSchema
|
|||
'greeting',
|
||||
'spec',
|
||||
'maxOutputTokens',
|
||||
'artifacts',
|
||||
'additionalModelRequestFields',
|
||||
'region',
|
||||
'model',
|
||||
|
|
|
|||
|
|
@ -617,8 +617,8 @@ export const bedrockModels = [
|
|||
'anthropic.claude-v2',
|
||||
'anthropic.claude-v2:1',
|
||||
'anthropic.claude-instant-v1',
|
||||
'cohere.command-text-v14',
|
||||
'cohere.command-light-text-v14',
|
||||
// 'cohere.command-text-v14', // no conversation history
|
||||
// 'cohere.command-light-text-v14', // no conversation history
|
||||
'cohere.command-r-v1:0',
|
||||
'cohere.command-r-plus-v1:0',
|
||||
'meta.llama2-13b-chat-v1',
|
||||
|
|
|
|||
|
|
@ -74,6 +74,15 @@ export function updateMessage(payload: t.TUpdateMessageRequest): Promise<unknown
|
|||
return request.put(endpoints.messages(conversationId, messageId), { text });
|
||||
}
|
||||
|
||||
export function updateMessageContent(payload: t.TUpdateMessageContent): Promise<unknown> {
|
||||
const { conversationId, messageId, index, text } = payload;
|
||||
if (!conversationId) {
|
||||
throw new Error('conversationId is required');
|
||||
}
|
||||
|
||||
return request.put(endpoints.messages(conversationId, messageId), { text, index });
|
||||
}
|
||||
|
||||
export function updateUserKey(payload: t.TUpdateUserKeyRequest) {
|
||||
const { value } = payload;
|
||||
if (!value) {
|
||||
|
|
|
|||
|
|
@ -124,6 +124,20 @@ export const useUpdateMessageMutation = (
|
|||
});
|
||||
};
|
||||
|
||||
export const useUpdateMessageContentMutation = (
|
||||
conversationId: string,
|
||||
): UseMutationResult<unknown, unknown, t.TUpdateMessageContent, unknown> => {
|
||||
const queryClient = useQueryClient();
|
||||
return useMutation(
|
||||
(payload: t.TUpdateMessageContent) => dataService.updateMessageContent(payload),
|
||||
{
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries([QueryKeys.messages, conversationId]);
|
||||
},
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
export const useUpdateUserKeysMutation = (): UseMutationResult<
|
||||
t.TUser,
|
||||
unknown,
|
||||
|
|
|
|||
|
|
@ -128,6 +128,13 @@ export type TUpdateMessageRequest = {
|
|||
text: string;
|
||||
};
|
||||
|
||||
export type TUpdateMessageContent = {
|
||||
conversationId: string;
|
||||
messageId: string;
|
||||
index: number;
|
||||
text: string;
|
||||
};
|
||||
|
||||
export type TUpdateUserKeyRequest = {
|
||||
name: string;
|
||||
value: string;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue