@red-hat-developer-hub/backstage-plugin-lightspeed 1.2.3 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/README.md +4 -4
- package/dist/alpha.d.ts +3 -3
- package/dist/components/LightSpeedChat.esm.js +3 -1
- package/dist/components/LightSpeedChat.esm.js.map +1 -1
- package/dist/components/LightspeedChatBox.esm.js.map +1 -1
- package/dist/dev.d.ts +2 -0
- package/dist/dev.esm.js +48 -0
- package/dist/dev.esm.js.map +1 -0
- package/dist/hooks/useAllModels.esm.js.map +1 -1
- package/dist/hooks/useCaptureFeedback.esm.js.map +1 -1
- package/dist/hooks/useConversationMessages.esm.js.map +1 -1
- package/dist/hooks/useConversations.esm.js.map +1 -1
- package/dist/hooks/useCreateCoversationMessage.esm.js.map +1 -1
- package/dist/hooks/useDeleteConversation.esm.js.map +1 -1
- package/dist/hooks/useFeedbackStatus.esm.js.map +1 -1
- package/dist/hooks/useQuestionValidation.esm.js.map +1 -1
- package/dist/hooks/useRenameConversation.esm.js.map +1 -1
- package/dist/translations/de.esm.js +67 -109
- package/dist/translations/de.esm.js.map +1 -1
- package/dist/translations/es.esm.js +65 -107
- package/dist/translations/es.esm.js.map +1 -1
- package/package.json +20 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConversationMessages.esm.js","sources":["../../src/hooks/useConversationMessages.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\n\nimport { useApi } from '@backstage/core-plugin-api';\n\nimport { MessageProps } from '@patternfly/chatbot';\nimport { useQuery } from '@tanstack/react-query';\n\nimport { lightspeedApiRef } from '../api/api';\nimport { ScrollContainerHandle } from '../components/LightspeedChatBox';\nimport { TEMP_CONVERSATION_ID } from '../const';\nimport botAvatar from '../images/bot-avatar.svg';\nimport userAvatar from '../images/user-avatar.svg';\nimport {\n Attachment,\n LCSConversation,\n ReferencedDocument,\n ToolCall,\n} from '../types';\nimport {\n createBotMessage,\n createUserMessage,\n getConversationsData,\n getTimestamp,\n transformDocumentsToSources,\n} from '../utils/lightspeed-chatbox-utils';\nimport { useCreateConversationMessage } from './useCreateCoversationMessage';\n\n// Fetch all conversation messages\nexport const useFetchConversationMessages = (currentConversation: string) => {\n const lightspeedApi = useApi(lightspeedApiRef);\n return useQuery({\n queryKey: ['conversationMessages', currentConversation],\n queryFn: currentConversation\n ? async () => {\n const response =\n await lightspeedApi.getConversationMessages(currentConversation);\n\n return response;\n }\n : undefined,\n retry: false,\n });\n};\n\n// Extended message type to include tool calls\ninterface ExtendedMessageProps extends MessageProps {\n toolCalls?: ToolCall[];\n}\n\ntype Conversations = { [_key: string]: ExtendedMessageProps[] };\n\n/**\n * Fetches all the messages for given conversation_id\n * @param conversationId\n * @param userName\n * @param selectedModel\n * @param selectedProvider\n * @param avatar\n *\n */\nexport const useConversationMessages = (\n conversationId: string,\n userName: string | undefined,\n selectedModel: string,\n selectedProvider: string,\n avatar: string = userAvatar,\n onComplete?: (message: string) => void,\n onStart?: (conversation_id: string) => void,\n) => {\n const { mutateAsync: createMessage } = useCreateConversationMessage();\n const scrollToBottomRef = React.useRef<ScrollContainerHandle>(null);\n\n const [currentConversation, setCurrentConversation] =\n React.useState(conversationId);\n const [conversations, setConversations] = React.useState<Conversations>({\n [currentConversation]: [],\n });\n const streamingConversations = React.useRef<Conversations>({\n [currentConversation]: [],\n });\n\n // Track pending tool calls during streaming\n const pendingToolCalls = React.useRef<{ [id: number]: ToolCall }>({});\n\n // Cache tool calls by conversation ID and message index to persist across refetches\n // Key format: `${conversationId}-${messageIndex}`\n const toolCallsCache = React.useRef<{ [key: string]: ToolCall[] }>({});\n\n React.useEffect(() => {\n if (currentConversation !== conversationId) {\n setCurrentConversation(conversationId);\n setConversations(prev => {\n if (prev[conversationId]) return prev;\n\n return {\n ...prev,\n [conversationId]: [],\n };\n });\n }\n }, [currentConversation, conversationId]);\n\n const { data: conversationsData = [], ...queryProps } =\n useFetchConversationMessages(currentConversation);\n\n React.useEffect(() => {\n if (\n !Array.isArray(conversationsData) ||\n (conversationsData.length === 0 &&\n conversationId !== TEMP_CONVERSATION_ID)\n )\n return;\n\n const newConvoIndex: number[] = [];\n\n if (conversations) {\n const _conversations: { [key: string]: any[] } = {\n [currentConversation]: [],\n };\n\n let index = 0;\n for (let i = 0; i < conversationsData.length; i++) {\n const [userMessage, aiMessage] = getConversationsData(\n conversationsData[i] as unknown as LCSConversation,\n );\n\n // Create user message\n const userMsg = createUserMessage({\n avatar,\n name: userName,\n content: userMessage.content,\n timestamp: userMessage.timestamp,\n });\n\n // Create bot message\n const botMsg = createBotMessage({\n avatar: botAvatar,\n isLoading: false,\n name: conversationsData[i].model ?? selectedModel,\n content: aiMessage.content,\n timestamp: aiMessage.timestamp,\n sources: transformDocumentsToSources(\n aiMessage?.referenced_documents ?? [],\n ),\n });\n\n // Merge cached tool calls if available\n const cacheKey = `${currentConversation}-${i}`;\n const cachedToolCalls = toolCallsCache.current[cacheKey];\n if (cachedToolCalls && cachedToolCalls.length > 0) {\n botMsg.toolCalls = cachedToolCalls;\n }\n\n _conversations[currentConversation].push(userMsg, botMsg);\n\n newConvoIndex.push(index);\n index++;\n }\n\n if (streamingConversations.current[currentConversation]) {\n _conversations[currentConversation].push(\n ...streamingConversations.current[currentConversation],\n );\n }\n\n setConversations(_conversations);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n conversationsData,\n userName,\n avatar,\n currentConversation,\n selectedModel,\n streamingConversations,\n ]);\n\n const handleInputPrompt = React.useCallback(\n async (prompt: string, attachments: Attachment[] = []) => {\n let newConversationId = '';\n\n const conversationTuple = [\n createUserMessage({\n avatar,\n name: userName,\n content: prompt,\n timestamp: getTimestamp(Date.now()) ?? '',\n }),\n createBotMessage({\n avatar: botAvatar,\n isLoading: true,\n name: selectedModel,\n content: '',\n timestamp: '',\n }),\n ];\n\n streamingConversations.current = {\n ...streamingConversations.current,\n [currentConversation]: conversationTuple,\n };\n\n setConversations((prevConv: Conversations) => {\n return {\n ...prevConv,\n [currentConversation]: [\n ...(prevConv?.[currentConversation] ?? []),\n ...conversationTuple,\n ],\n };\n });\n\n setTimeout(() => {\n scrollToBottomRef.current?.scrollToBottom();\n }, 0);\n const finalMessages: string[] = [];\n let buffer = '';\n\n try {\n const reader = await createMessage({\n prompt,\n selectedModel,\n selectedProvider,\n currentConversation,\n attachments,\n });\n\n const decoder = new TextDecoder('utf-8');\n const keepGoing = true;\n\n while (keepGoing) {\n const { value, done } = await reader.read();\n if (done) break;\n\n buffer += decoder.decode(value, { stream: true });\n\n // Process all complete messages separated by double newlines\n const parts = buffer.split('\\n\\n');\n buffer = parts.pop()!;\n\n for (const part of parts) {\n const lines = part\n .split('\\n')\n .filter(line => line.startsWith('data:'));\n\n const jsonString = lines\n .map(line => line.trim().slice(5).trim())\n .join('');\n try {\n const { event, data } = JSON.parse(jsonString);\n if (event === 'start') {\n if (currentConversation === TEMP_CONVERSATION_ID) {\n // If the conversation is temp, we need to set the new conversation id\n newConversationId = data?.conversation_id;\n }\n }\n\n // Handle tool_call event\n if (event === 'tool_call') {\n const toolCallData = data?.token;\n if (\n typeof toolCallData === 'object' &&\n toolCallData?.tool_name\n ) {\n // Full tool call with arguments - track start time\n const toolCall: ToolCall = {\n id: data.id,\n toolName: toolCallData.tool_name,\n arguments: toolCallData.arguments || {},\n startTime: Date.now(),\n isLoading: true,\n };\n pendingToolCalls.current[data.id] = toolCall;\n\n // Update the bot message with the pending tool call\n setConversations(prevConversations => {\n const conversation =\n prevConversations[currentConversation] ?? [];\n const lastMessageIndex = conversation.length - 1;\n\n if (lastMessageIndex < 0) return prevConversations;\n\n const lastMessage = { ...conversation[lastMessageIndex] };\n const existingToolCalls = lastMessage.toolCalls || [];\n lastMessage.toolCalls = [...existingToolCalls, toolCall];\n\n // Cache tool calls for this message (message pair index)\n const messageIndex = Math.floor(lastMessageIndex / 2);\n const cacheKey = `${currentConversation}-${messageIndex}`;\n toolCallsCache.current[cacheKey] = lastMessage.toolCalls;\n\n const updatedConversation = [\n ...conversation.slice(0, lastMessageIndex),\n lastMessage,\n ];\n\n return {\n ...prevConversations,\n [currentConversation]: updatedConversation,\n };\n });\n\n // Also update streaming ref\n const [humanMessage, aiMessage] =\n streamingConversations.current[currentConversation] || [];\n if (aiMessage) {\n const existingToolCalls = aiMessage.toolCalls || [];\n streamingConversations.current[currentConversation] = [\n humanMessage,\n {\n ...aiMessage,\n toolCalls: [...existingToolCalls, toolCall],\n },\n ];\n }\n }\n }\n\n // Handle tool_result event\n if (event === 'tool_result') {\n const resultData = data?.token;\n if (resultData?.tool_name) {\n const toolId = data.id;\n const pendingCall = pendingToolCalls.current[toolId];\n const endTime = Date.now();\n const executionTime = pendingCall\n ? (endTime - pendingCall.startTime) / 1000\n : 0;\n\n // Update the tool call with result\n setConversations(prevConversations => {\n const conversation =\n prevConversations[currentConversation] ?? [];\n const lastMessageIndex = conversation.length - 1;\n\n if (lastMessageIndex < 0) return prevConversations;\n\n const lastMessage = { ...conversation[lastMessageIndex] };\n const toolCalls = lastMessage.toolCalls || [];\n\n // Find and update the matching tool call\n const updatedToolCalls = toolCalls.map(tc => {\n if (\n tc.id === toolId ||\n tc.toolName === resultData.tool_name\n ) {\n return {\n ...tc,\n response: resultData.response,\n endTime,\n executionTime,\n isLoading: false,\n };\n }\n return tc;\n });\n\n lastMessage.toolCalls = updatedToolCalls;\n\n // Update cache with completed tool call\n const messageIndex = Math.floor(lastMessageIndex / 2);\n const cacheKey = `${currentConversation}-${messageIndex}`;\n toolCallsCache.current[cacheKey] = updatedToolCalls;\n\n const updatedConversation = [\n ...conversation.slice(0, lastMessageIndex),\n lastMessage,\n ];\n\n return {\n ...prevConversations,\n [currentConversation]: updatedConversation,\n };\n });\n\n // Also update streaming ref\n const [humanMessage, aiMessage] =\n streamingConversations.current[currentConversation] || [];\n if (aiMessage) {\n const toolCalls = aiMessage.toolCalls || [];\n const updatedToolCalls = toolCalls.map(tc => {\n if (\n tc.id === toolId ||\n tc.toolName === resultData.tool_name\n ) {\n return {\n ...tc,\n response: resultData.response,\n endTime,\n executionTime,\n isLoading: false,\n };\n }\n return tc;\n });\n streamingConversations.current[currentConversation] = [\n humanMessage,\n { ...aiMessage, toolCalls: updatedToolCalls },\n ];\n }\n\n // Clean up pending tool call\n delete pendingToolCalls.current[toolId];\n }\n }\n\n if (event === 'token') {\n const content = data?.token || '';\n\n finalMessages.push(content);\n\n // Store streaming message\n const [humanMessage, aiMessage] =\n streamingConversations.current[currentConversation];\n streamingConversations.current[currentConversation] = [\n humanMessage,\n { ...aiMessage, content: aiMessage.content + content },\n ];\n\n setConversations(prevConversations => {\n const conversation =\n prevConversations[currentConversation] ?? [];\n\n const lastMessageIndex = conversation.length - 1;\n const lastMessage =\n conversation.length === 0\n ? createBotMessage({\n content: '',\n timestamp: getTimestamp(Date.now()),\n })\n : { ...conversation[lastMessageIndex] };\n\n if ((lastMessage?.content ?? '').trim().length > 0) {\n lastMessage.isLoading = false;\n }\n lastMessage.content += content;\n lastMessage.name =\n data?.response_metadata?.model || selectedModel;\n lastMessage.timestamp = getTimestamp(\n // TODO: To be fixed in the query response\n data?.response_metadata?.created_at || Date.now(),\n );\n\n const updatedConversation = [\n ...conversation.slice(0, lastMessageIndex),\n lastMessage,\n ];\n\n return {\n ...prevConversations,\n [currentConversation]: updatedConversation,\n };\n });\n }\n\n if (event === 'end') {\n const documents = data?.referenced_documents || [];\n\n setConversations(prevConversations => {\n const conversation =\n prevConversations[currentConversation] ?? [];\n\n const lastMessageIndex = conversation.length - 1;\n const lastMessage =\n conversation.length === 0\n ? createBotMessage({\n content: '',\n isLoading: false,\n timestamp: getTimestamp(Date.now()),\n })\n : { ...conversation[lastMessageIndex], isLoading: false };\n\n if (documents.length) {\n lastMessage.sources = {\n sources: documents.map((doc: ReferencedDocument) => ({\n title: doc.doc_title,\n link: doc.doc_url,\n body: doc.doc_description,\n })),\n };\n }\n\n const updatedConversation = [\n ...conversation.slice(0, lastMessageIndex),\n lastMessage,\n ];\n\n return {\n ...prevConversations,\n [currentConversation]: updatedConversation,\n };\n });\n }\n } catch (error) {\n // eslint-disable-next-line no-console\n console.warn('Error parsing JSON:', error);\n if (typeof onComplete === 'function') {\n onComplete('Invalid JSON received');\n }\n }\n }\n }\n } catch (e) {\n setConversations(prevConversations => {\n const conversation = prevConversations[currentConversation] ?? [];\n\n const lastMessageIndex = conversation.length - 1;\n const lastMessage =\n conversation.length === 0\n ? createBotMessage({\n content: '',\n timestamp: getTimestamp(Date.now()),\n })\n : { ...conversation[lastMessageIndex] };\n\n lastMessage.isLoading = false;\n lastMessage.content += e;\n lastMessage.error = {\n title: e.message,\n };\n lastMessage.timestamp = getTimestamp(Date.now());\n\n const updatedConversation = [\n ...conversation.slice(0, lastMessageIndex),\n lastMessage,\n ];\n\n finalMessages.push(`${e}`);\n\n return {\n ...prevConversations,\n [newConversationId.length > 0\n ? newConversationId\n : currentConversation]: updatedConversation,\n };\n });\n }\n // reset current streaming\n streamingConversations.current[currentConversation] = [];\n if (typeof onComplete === 'function') {\n onComplete(finalMessages.join(''));\n }\n // Swap temp conversation messages with new conversation\n\n if (currentConversation === TEMP_CONVERSATION_ID && newConversationId) {\n // Migrate tool calls cache from temp to new conversation ID\n Object.keys(toolCallsCache.current).forEach(key => {\n if (key.startsWith(`${TEMP_CONVERSATION_ID}-`)) {\n const messageIndex = key.replace(`${TEMP_CONVERSATION_ID}-`, '');\n const newKey = `${newConversationId}-${messageIndex}`;\n toolCallsCache.current[newKey] = toolCallsCache.current[key];\n delete toolCallsCache.current[key];\n }\n });\n\n setConversations(prevConversations => {\n return {\n ...prevConversations,\n [newConversationId]: prevConversations[TEMP_CONVERSATION_ID],\n };\n });\n\n onStart?.(newConversationId);\n\n setConversations(prev => {\n const { temp, ...rest } = prev;\n return rest;\n });\n }\n },\n\n [\n avatar,\n userName,\n onComplete,\n onStart,\n selectedModel,\n selectedProvider,\n createMessage,\n currentConversation,\n ],\n );\n\n return {\n conversationMessages: conversations[currentConversation] ?? [],\n handleInputPrompt,\n conversations,\n scrollToBottomRef,\n ...queryProps,\n };\n};\n"],"names":[],"mappings":";;;;;;;;;;AA4Ca,MAAA,4BAAA,GAA+B,CAAC,mBAAgC,KAAA;AAC3E,EAAM,MAAA,aAAA,GAAgB,OAAO,gBAAgB,CAAA;AAC7C,EAAA,OAAO,QAAS,CAAA;AAAA,IACd,QAAA,EAAU,CAAC,sBAAA,EAAwB,mBAAmB,CAAA;AAAA,IACtD,OAAA,EAAS,sBACL,YAAY;AACV,MAAA,MAAM,QACJ,GAAA,MAAM,aAAc,CAAA,uBAAA,CAAwB,mBAAmB,CAAA;AAEjE,MAAO,OAAA,QAAA;AAAA,KAET,GAAA,SAAA;AAAA,IACJ,KAAO,EAAA;AAAA,GACR,CAAA;AACH;AAkBa,MAAA,uBAAA,GAA0B,CACrC,cACA,EAAA,QAAA,EACA,eACA,gBACA,EAAA,MAAA,GAAiB,UACjB,EAAA,UAAA,EACA,OACG,KAAA;AACH,EAAA,MAAM,EAAE,WAAA,EAAa,aAAc,EAAA,GAAI,4BAA6B,EAAA;AACpE,EAAM,MAAA,iBAAA,GAAoB,KAAM,CAAA,MAAA,CAA8B,IAAI,CAAA;AAElE,EAAA,MAAM,CAAC,mBAAqB,EAAA,sBAAsB,CAChD,GAAA,KAAA,CAAM,SAAS,cAAc,CAAA;AAC/B,EAAA,MAAM,CAAC,aAAA,EAAe,gBAAgB,CAAA,GAAI,MAAM,QAAwB,CAAA;AAAA,IACtE,CAAC,mBAAmB,GAA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G,iBAAA,CAAkB,oBAAoB;AAAA,WAC7D;AAAA,SACD,CAAA;AAED,QAAA,OAAA,GAAU,iBAAiB,CAAA;AAE3B,QAAA,gBAAA,CAAiB,CAAQ,IAAA,KAAA;AACvB,UAAA,MAAM,EAAE,IAAA,EAAM,GAAG,IAAA,EAAS,GAAA,IAAA;AAC1B,UAAO,OAAA,IAAA;AAAA,SACR,CAAA;AAAA;AACH,KACF;AAAA,IAEA;AAAA,MACE,MAAA;AAAA,MACA,QAAA;AAAA,MACA,UAAA;AAAA,MACA,OAAA;AAAA,MACA,aAAA;AAAA,MACA,gBAAA;AAAA,MACA,aAAA;AAAA,MACA;AAAA;AACF,GACF;AAEA,EAAO,OAAA;AAAA,IACL,oBAAsB,EAAA,aAAA,CAAc,mBAAmB,CAAA,IAAK,EAAC;AAAA,IAC7D,iBAAA;AAAA,IACA,aAAA;AAAA,IACA,iBAAA;AAAA,IACA,GAAG;AAAA,GACL;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"useConversationMessages.esm.js","sources":["../../src/hooks/useConversationMessages.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\n\nimport { useApi } from '@backstage/core-plugin-api';\n\nimport { MessageProps } from '@patternfly/chatbot';\nimport { useQuery, type UseQueryResult } from '@tanstack/react-query';\n\nimport { lightspeedApiRef } from '../api/api';\nimport { ScrollContainerHandle } from '../components/LightspeedChatBox';\nimport { TEMP_CONVERSATION_ID } from '../const';\nimport botAvatar from '../images/bot-avatar.svg';\nimport userAvatar from '../images/user-avatar.svg';\nimport {\n Attachment,\n BaseMessage,\n LCSConversation,\n ReferencedDocument,\n ToolCall,\n} from '../types';\nimport {\n createBotMessage,\n createUserMessage,\n getConversationsData,\n getTimestamp,\n transformDocumentsToSources,\n} from '../utils/lightspeed-chatbox-utils';\nimport { useCreateConversationMessage } from './useCreateCoversationMessage';\n\n// Fetch all conversation messages\nexport const useFetchConversationMessages = (\n currentConversation: string,\n): UseQueryResult<BaseMessage[] | undefined, Error> => {\n const lightspeedApi = useApi(lightspeedApiRef);\n return useQuery({\n queryKey: ['conversationMessages', currentConversation],\n queryFn: currentConversation\n ? async () => {\n const response =\n await lightspeedApi.getConversationMessages(currentConversation);\n\n return response;\n }\n : undefined,\n retry: false,\n });\n};\n\n// Extended message type to include tool calls\ninterface ExtendedMessageProps extends MessageProps {\n toolCalls?: ToolCall[];\n}\n\ntype Conversations = { [_key: string]: ExtendedMessageProps[] };\n\nexport type UseConversationMessagesReturn = {\n conversationMessages: ExtendedMessageProps[];\n handleInputPrompt: (\n prompt: string,\n attachments?: Attachment[],\n ) => Promise<void>;\n conversations: Conversations;\n scrollToBottomRef: React.RefObject<ScrollContainerHandle | null>;\n data?: BaseMessage[] | undefined;\n error: Error | null;\n isPending: boolean;\n isFetching: boolean;\n isSuccess: boolean;\n isError: boolean;\n status: 'pending' | 'error' | 'success';\n refetch: () => void;\n};\n\n/**\n * Fetches all the messages for given conversation_id\n * @param conversationId\n * @param userName\n * @param selectedModel\n * @param selectedProvider\n * @param avatar\n *\n */\nexport const useConversationMessages = (\n conversationId: string,\n userName: string | undefined,\n selectedModel: string,\n selectedProvider: string,\n avatar: string = userAvatar,\n onComplete?: (message: string) => void,\n onStart?: (conversation_id: string) => void,\n): UseConversationMessagesReturn => {\n const { mutateAsync: createMessage } = useCreateConversationMessage();\n const scrollToBottomRef = React.useRef<ScrollContainerHandle>(null);\n\n const [currentConversation, setCurrentConversation] =\n React.useState(conversationId);\n const [conversations, setConversations] = React.useState<Conversations>({\n [currentConversation]: [],\n });\n const streamingConversations = React.useRef<Conversations>({\n [currentConversation]: [],\n });\n\n // Track pending tool calls during streaming\n const pendingToolCalls = React.useRef<{ [id: number]: ToolCall }>({});\n\n // Cache tool calls by conversation ID and message index to persist across refetches\n // Key format: `${conversationId}-${messageIndex}`\n const toolCallsCache = React.useRef<{ [key: string]: ToolCall[] }>({});\n\n React.useEffect(() => {\n if (currentConversation !== conversationId) {\n setCurrentConversation(conversationId);\n setConversations(prev => {\n if (prev[conversationId]) return prev;\n\n return {\n ...prev,\n [conversationId]: [],\n };\n });\n }\n }, [currentConversation, conversationId]);\n\n const { data: conversationsData = [], ...queryProps } =\n useFetchConversationMessages(currentConversation);\n\n React.useEffect(() => {\n if (\n !Array.isArray(conversationsData) ||\n (conversationsData.length === 0 &&\n conversationId !== TEMP_CONVERSATION_ID)\n )\n return;\n\n const newConvoIndex: number[] = [];\n\n if (conversations) {\n const _conversations: { [key: string]: any[] } = {\n [currentConversation]: [],\n };\n\n let index = 0;\n for (let i = 0; i < conversationsData.length; i++) {\n const [userMessage, aiMessage] = getConversationsData(\n conversationsData[i] as unknown as LCSConversation,\n );\n\n // Create user message\n const userMsg = createUserMessage({\n avatar,\n name: userName,\n content: userMessage.content,\n timestamp: userMessage.timestamp,\n });\n\n // Create bot message\n const botMsg = createBotMessage({\n avatar: botAvatar,\n isLoading: false,\n name: conversationsData[i].model ?? selectedModel,\n content: aiMessage.content,\n timestamp: aiMessage.timestamp,\n sources: transformDocumentsToSources(\n aiMessage?.referenced_documents ?? [],\n ),\n });\n\n // Merge cached tool calls if available\n const cacheKey = `${currentConversation}-${i}`;\n const cachedToolCalls = toolCallsCache.current[cacheKey];\n if (cachedToolCalls && cachedToolCalls.length > 0) {\n botMsg.toolCalls = cachedToolCalls;\n }\n\n _conversations[currentConversation].push(userMsg, botMsg);\n\n newConvoIndex.push(index);\n index++;\n }\n\n if (streamingConversations.current[currentConversation]) {\n _conversations[currentConversation].push(\n ...streamingConversations.current[currentConversation],\n );\n }\n\n setConversations(_conversations);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n conversationsData,\n userName,\n avatar,\n currentConversation,\n selectedModel,\n streamingConversations,\n ]);\n\n const handleInputPrompt = React.useCallback(\n async (prompt: string, attachments: Attachment[] = []) => {\n let newConversationId = '';\n\n const conversationTuple = [\n createUserMessage({\n avatar,\n name: userName,\n content: prompt,\n timestamp: getTimestamp(Date.now()) ?? '',\n }),\n createBotMessage({\n avatar: botAvatar,\n isLoading: true,\n name: selectedModel,\n content: '',\n timestamp: '',\n }),\n ];\n\n streamingConversations.current = {\n ...streamingConversations.current,\n [currentConversation]: conversationTuple,\n };\n\n setConversations((prevConv: Conversations) => {\n return {\n ...prevConv,\n [currentConversation]: [\n ...(prevConv?.[currentConversation] ?? []),\n ...conversationTuple,\n ],\n };\n });\n\n setTimeout(() => {\n scrollToBottomRef.current?.scrollToBottom();\n }, 0);\n const finalMessages: string[] = [];\n let buffer = '';\n\n try {\n const reader = await createMessage({\n prompt,\n selectedModel,\n selectedProvider,\n currentConversation,\n attachments,\n });\n\n const decoder = new TextDecoder('utf-8');\n const keepGoing = true;\n\n while (keepGoing) {\n const { value, done } = await reader.read();\n if (done) break;\n\n buffer += decoder.decode(value, { stream: true });\n\n // Process all complete messages separated by double newlines\n const parts = buffer.split('\\n\\n');\n buffer = parts.pop()!;\n\n for (const part of parts) {\n const lines = part\n .split('\\n')\n .filter(line => line.startsWith('data:'));\n\n const jsonString = lines\n .map(line => line.trim().slice(5).trim())\n .join('');\n try {\n const { event, data } = JSON.parse(jsonString);\n if (event === 'start') {\n if (currentConversation === TEMP_CONVERSATION_ID) {\n // If the conversation is temp, we need to set the new conversation id\n newConversationId = data?.conversation_id;\n }\n }\n\n // Handle tool_call event\n if (event === 'tool_call') {\n const toolCallData = data?.token;\n if (\n typeof toolCallData === 'object' &&\n toolCallData?.tool_name\n ) {\n // Full tool call with arguments - track start time\n const toolCall: ToolCall = {\n id: data.id,\n toolName: toolCallData.tool_name,\n arguments: toolCallData.arguments || {},\n startTime: Date.now(),\n isLoading: true,\n };\n pendingToolCalls.current[data.id] = toolCall;\n\n // Update the bot message with the pending tool call\n setConversations(prevConversations => {\n const conversation =\n prevConversations[currentConversation] ?? [];\n const lastMessageIndex = conversation.length - 1;\n\n if (lastMessageIndex < 0) return prevConversations;\n\n const lastMessage = { ...conversation[lastMessageIndex] };\n const existingToolCalls = lastMessage.toolCalls || [];\n lastMessage.toolCalls = [...existingToolCalls, toolCall];\n\n // Cache tool calls for this message (message pair index)\n const messageIndex = Math.floor(lastMessageIndex / 2);\n const cacheKey = `${currentConversation}-${messageIndex}`;\n toolCallsCache.current[cacheKey] = lastMessage.toolCalls;\n\n const updatedConversation = [\n ...conversation.slice(0, lastMessageIndex),\n lastMessage,\n ];\n\n return {\n ...prevConversations,\n [currentConversation]: updatedConversation,\n };\n });\n\n // Also update streaming ref\n const [humanMessage, aiMessage] =\n streamingConversations.current[currentConversation] || [];\n if (aiMessage) {\n const existingToolCalls = aiMessage.toolCalls || [];\n streamingConversations.current[currentConversation] = [\n humanMessage,\n {\n ...aiMessage,\n toolCalls: [...existingToolCalls, toolCall],\n },\n ];\n }\n }\n }\n\n // Handle tool_result event\n if (event === 'tool_result') {\n const resultData = data?.token;\n if (resultData?.tool_name) {\n const toolId = data.id;\n const pendingCall = pendingToolCalls.current[toolId];\n const endTime = Date.now();\n const executionTime = pendingCall\n ? (endTime - pendingCall.startTime) / 1000\n : 0;\n\n // Update the tool call with result\n setConversations(prevConversations => {\n const conversation =\n prevConversations[currentConversation] ?? [];\n const lastMessageIndex = conversation.length - 1;\n\n if (lastMessageIndex < 0) return prevConversations;\n\n const lastMessage = { ...conversation[lastMessageIndex] };\n const toolCalls = lastMessage.toolCalls || [];\n\n // Find and update the matching tool call\n const updatedToolCalls = toolCalls.map(tc => {\n if (\n tc.id === toolId ||\n tc.toolName === resultData.tool_name\n ) {\n return {\n ...tc,\n response: resultData.response,\n endTime,\n executionTime,\n isLoading: false,\n };\n }\n return tc;\n });\n\n lastMessage.toolCalls = updatedToolCalls;\n\n // Update cache with completed tool call\n const messageIndex = Math.floor(lastMessageIndex / 2);\n const cacheKey = `${currentConversation}-${messageIndex}`;\n toolCallsCache.current[cacheKey] = updatedToolCalls;\n\n const updatedConversation = [\n ...conversation.slice(0, lastMessageIndex),\n lastMessage,\n ];\n\n return {\n ...prevConversations,\n [currentConversation]: updatedConversation,\n };\n });\n\n // Also update streaming ref\n const [humanMessage, aiMessage] =\n streamingConversations.current[currentConversation] || [];\n if (aiMessage) {\n const toolCalls = aiMessage.toolCalls || [];\n const updatedToolCalls = toolCalls.map(tc => {\n if (\n tc.id === toolId ||\n tc.toolName === resultData.tool_name\n ) {\n return {\n ...tc,\n response: resultData.response,\n endTime,\n executionTime,\n isLoading: false,\n };\n }\n return tc;\n });\n streamingConversations.current[currentConversation] = [\n humanMessage,\n { ...aiMessage, toolCalls: updatedToolCalls },\n ];\n }\n\n // Clean up pending tool call\n delete pendingToolCalls.current[toolId];\n }\n }\n\n if (event === 'token') {\n const content = data?.token || '';\n\n finalMessages.push(content);\n\n // Store streaming message\n const [humanMessage, aiMessage] =\n streamingConversations.current[currentConversation];\n streamingConversations.current[currentConversation] = [\n humanMessage,\n { ...aiMessage, content: aiMessage.content + content },\n ];\n\n setConversations(prevConversations => {\n const conversation =\n prevConversations[currentConversation] ?? [];\n\n const lastMessageIndex = conversation.length - 1;\n const lastMessage =\n conversation.length === 0\n ? createBotMessage({\n content: '',\n timestamp: getTimestamp(Date.now()),\n })\n : { ...conversation[lastMessageIndex] };\n\n if ((lastMessage?.content ?? '').trim().length > 0) {\n lastMessage.isLoading = false;\n }\n lastMessage.content += content;\n lastMessage.name =\n data?.response_metadata?.model || selectedModel;\n lastMessage.timestamp = getTimestamp(\n // TODO: To be fixed in the query response\n data?.response_metadata?.created_at || Date.now(),\n );\n\n const updatedConversation = [\n ...conversation.slice(0, lastMessageIndex),\n lastMessage,\n ];\n\n return {\n ...prevConversations,\n [currentConversation]: updatedConversation,\n };\n });\n }\n\n if (event === 'end') {\n const documents = data?.referenced_documents || [];\n\n setConversations(prevConversations => {\n const conversation =\n prevConversations[currentConversation] ?? [];\n\n const lastMessageIndex = conversation.length - 1;\n const lastMessage =\n conversation.length === 0\n ? createBotMessage({\n content: '',\n isLoading: false,\n timestamp: getTimestamp(Date.now()),\n })\n : { ...conversation[lastMessageIndex], isLoading: false };\n\n if (documents.length) {\n lastMessage.sources = {\n sources: documents.map((doc: ReferencedDocument) => ({\n title: doc.doc_title,\n link: doc.doc_url,\n body: doc.doc_description,\n })),\n };\n }\n\n const updatedConversation = [\n ...conversation.slice(0, lastMessageIndex),\n lastMessage,\n ];\n\n return {\n ...prevConversations,\n [currentConversation]: updatedConversation,\n };\n });\n }\n } catch (error) {\n // eslint-disable-next-line no-console\n console.warn('Error parsing JSON:', error);\n if (typeof onComplete === 'function') {\n onComplete('Invalid JSON received');\n }\n }\n }\n }\n } catch (e) {\n setConversations(prevConversations => {\n const conversation = prevConversations[currentConversation] ?? [];\n\n const lastMessageIndex = conversation.length - 1;\n const lastMessage =\n conversation.length === 0\n ? createBotMessage({\n content: '',\n timestamp: getTimestamp(Date.now()),\n })\n : { ...conversation[lastMessageIndex] };\n\n lastMessage.isLoading = false;\n lastMessage.content += e;\n lastMessage.error = {\n title: e.message,\n };\n lastMessage.timestamp = getTimestamp(Date.now());\n\n const updatedConversation = [\n ...conversation.slice(0, lastMessageIndex),\n lastMessage,\n ];\n\n finalMessages.push(`${e}`);\n\n return {\n ...prevConversations,\n [newConversationId.length > 0\n ? newConversationId\n : currentConversation]: updatedConversation,\n };\n });\n }\n // reset current streaming\n streamingConversations.current[currentConversation] = [];\n if (typeof onComplete === 'function') {\n onComplete(finalMessages.join(''));\n }\n // Swap temp conversation messages with new conversation\n\n if (currentConversation === TEMP_CONVERSATION_ID && newConversationId) {\n // Migrate tool calls cache from temp to new conversation ID\n Object.keys(toolCallsCache.current).forEach(key => {\n if (key.startsWith(`${TEMP_CONVERSATION_ID}-`)) {\n const messageIndex = key.replace(`${TEMP_CONVERSATION_ID}-`, '');\n const newKey = `${newConversationId}-${messageIndex}`;\n toolCallsCache.current[newKey] = toolCallsCache.current[key];\n delete toolCallsCache.current[key];\n }\n });\n\n setConversations(prevConversations => {\n return {\n ...prevConversations,\n [newConversationId]: prevConversations[TEMP_CONVERSATION_ID],\n };\n });\n\n onStart?.(newConversationId);\n\n setConversations(prev => {\n const { temp, ...rest } = prev;\n return rest;\n });\n }\n },\n\n [\n avatar,\n userName,\n onComplete,\n onStart,\n selectedModel,\n selectedProvider,\n createMessage,\n currentConversation,\n ],\n );\n\n return {\n conversationMessages: conversations[currentConversation] ?? [],\n handleInputPrompt,\n conversations,\n scrollToBottomRef,\n ...queryProps,\n };\n};\n"],"names":[],"mappings":";;;;;;;;;;AA6Ca,MAAA,4BAAA,GAA+B,CAC1C,mBACqD,KAAA;AACrD,EAAM,MAAA,aAAA,GAAgB,OAAO,gBAAgB,CAAA;AAC7C,EAAA,OAAO,QAAS,CAAA;AAAA,IACd,QAAA,EAAU,CAAC,sBAAA,EAAwB,mBAAmB,CAAA;AAAA,IACtD,OAAA,EAAS,sBACL,YAAY;AACV,MAAA,MAAM,QACJ,GAAA,MAAM,aAAc,CAAA,uBAAA,CAAwB,mBAAmB,CAAA;AAEjE,MAAO,OAAA,QAAA;AAAA,KAET,GAAA,SAAA;AAAA,IACJ,KAAO,EAAA;AAAA,GACR,CAAA;AACH;AAoCa,MAAA,uBAAA,GAA0B,CACrC,cACA,EAAA,QAAA,EACA,eACA,gBACA,EAAA,MAAA,GAAiB,UACjB,EAAA,UAAA,EACA,OACkC,KAAA;AAClC,EAAA,MAAM,EAAE,WAAA,EAAa,aAAc,EAAA,GAAI,4BAA6B,EAAA;AACpE,EAAM,MAAA,iBAAA,GAAoB,KAAM,CAAA,MAAA,CAA8B,IAAI,CAAA;AAElE,EAAA,MAAM,CAAC,mBAAqB,EAAA,sBAAsB,CAChD,GAAA,KAAA,CAAM,SAAS,cAAc,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,QAAA,gBAAA,CAAiB,CAAqB,iBAAA,KAAA;AACpC,UAAO,OAAA;AAAA,YACL,GAAG,iBAAA;AAAA,YACH,CAAC,iBAAiB,GAAG,iBAAA,CAAkB,oBAAoB;AAAA,WAC7D;AAAA,SACD,CAAA;AAED,QAAA,OAAA,GAAU,iBAAiB,CAAA;AAE3B,QAAA,gBAAA,CAAiB,CAAQ,IAAA,KAAA;AACvB,UAAA,MAAM,EAAE,IAAA,EAAM,GAAG,IAAA,EAAS,GAAA,IAAA;AAC1B,UAAO,OAAA,IAAA;AAAA,SACR,CAAA;AAAA;AACH,KACF;AAAA,IAEA;AAAA,MACE,MAAA;AAAA,MACA,QAAA;AAAA,MACA,UAAA;AAAA,MACA,OAAA;AAAA,MACA,aAAA;AAAA,MACA,gBAAA;AAAA,MACA,aAAA;AAAA,MACA;AAAA;AACF,GACF;AAEA,EAAO,OAAA;AAAA,IACL,oBAAsB,EAAA,aAAA,CAAc,mBAAmB,CAAA,IAAK,EAAC;AAAA,IAC7D,iBAAA;AAAA,IACA,aAAA;AAAA,IACA,iBAAA;AAAA,IACA,GAAG;AAAA,GACL;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConversations.esm.js","sources":["../../src/hooks/useConversations.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useApi } from '@backstage/core-plugin-api';\n\nimport { useQuery } from '@tanstack/react-query';\n\nimport { lightspeedApiRef } from '../api/api';\n\n// Fetch all conversations\nexport const useConversations = () => {\n const lightspeedApi = useApi(lightspeedApiRef);\n return useQuery({\n queryKey: ['conversations'],\n queryFn: async () => {\n const response = await lightspeedApi.getConversations();\n return response;\n },\n staleTime: 1000 * 60 * 5, // 5 minutes\n });\n};\n"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"useConversations.esm.js","sources":["../../src/hooks/useConversations.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useApi } from '@backstage/core-plugin-api';\n\nimport { useQuery, type UseQueryResult } from '@tanstack/react-query';\n\nimport { lightspeedApiRef } from '../api/api';\nimport { ConversationList } from '../types';\n\n// Fetch all conversations\nexport const useConversations = (): UseQueryResult<ConversationList, Error> => {\n const lightspeedApi = useApi(lightspeedApiRef);\n return useQuery({\n queryKey: ['conversations'],\n queryFn: async () => {\n const response = await lightspeedApi.getConversations();\n return response;\n },\n staleTime: 1000 * 60 * 5, // 5 minutes\n });\n};\n"],"names":[],"mappings":";;;;AAwBO,MAAM,mBAAmB,MAA+C;AAC7E,EAAM,MAAA,aAAA,GAAgB,OAAO,gBAAgB,CAAA;AAC7C,EAAA,OAAO,QAAS,CAAA;AAAA,IACd,QAAA,EAAU,CAAC,eAAe,CAAA;AAAA,IAC1B,SAAS,YAAY;AACnB,MAAM,MAAA,QAAA,GAAW,MAAM,aAAA,CAAc,gBAAiB,EAAA;AACtD,MAAO,OAAA,QAAA;AAAA,KACT;AAAA,IACA,SAAA,EAAW,MAAO,EAAK,GAAA;AAAA;AAAA,GACxB,CAAA;AACH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCreateCoversationMessage.esm.js","sources":["../../src/hooks/useCreateCoversationMessage.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useApi } from '@backstage/core-plugin-api';\n\nimport { useMutation } from '@tanstack/react-query';\n\nimport { lightspeedApiRef } from '../api/api';\nimport { Attachment } from '../types';\n\nexport const useCreateConversationMessage = () => {\n const lightspeedApi = useApi(lightspeedApiRef);\n\n return useMutation({\n mutationFn: async ({\n prompt,\n selectedModel,\n selectedProvider,\n currentConversation,\n attachments,\n }: {\n prompt: string;\n selectedModel: string;\n selectedProvider: string;\n currentConversation: string;\n attachments: Attachment[];\n }) => {\n if (!currentConversation) {\n throw new Error('Failed to generate AI response');\n }\n\n return await lightspeedApi.createMessage(\n `${prompt}`,\n selectedModel,\n selectedProvider,\n currentConversation,\n attachments,\n );\n },\n onError: error => {\n // eslint-disable-next-line\n console.warn(error);\n },\n });\n};\n"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"useCreateCoversationMessage.esm.js","sources":["../../src/hooks/useCreateCoversationMessage.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useApi } from '@backstage/core-plugin-api';\n\nimport { useMutation, type UseMutationResult } from '@tanstack/react-query';\n\nimport { lightspeedApiRef } from '../api/api';\nimport { Attachment } from '../types';\n\ntype CreateMessageVariables = {\n prompt: string;\n selectedModel: string;\n selectedProvider: string;\n currentConversation: string;\n attachments: Attachment[];\n};\n\nexport const useCreateConversationMessage = (): UseMutationResult<\n ReadableStreamDefaultReader<Uint8Array>,\n Error,\n CreateMessageVariables\n> => {\n const lightspeedApi = useApi(lightspeedApiRef);\n\n return useMutation({\n mutationFn: async ({\n prompt,\n selectedModel,\n selectedProvider,\n currentConversation,\n attachments,\n }: {\n prompt: string;\n selectedModel: string;\n selectedProvider: string;\n currentConversation: string;\n attachments: Attachment[];\n }) => {\n if (!currentConversation) {\n throw new Error('Failed to generate AI response');\n }\n\n return await lightspeedApi.createMessage(\n `${prompt}`,\n selectedModel,\n selectedProvider,\n currentConversation,\n attachments,\n );\n },\n onError: error => {\n // eslint-disable-next-line\n console.warn(error);\n },\n });\n};\n"],"names":[],"mappings":";;;;AA+BO,MAAM,+BAA+B,MAIvC;AACH,EAAM,MAAA,aAAA,GAAgB,OAAO,gBAAgB,CAAA;AAE7C,EAAA,OAAO,WAAY,CAAA;AAAA,IACjB,YAAY,OAAO;AAAA,MACjB,MAAA;AAAA,MACA,aAAA;AAAA,MACA,gBAAA;AAAA,MACA,mBAAA;AAAA,MACA;AAAA,KAOI,KAAA;AACJ,MAAA,IAAI,CAAC,mBAAqB,EAAA;AACxB,QAAM,MAAA,IAAI,MAAM,gCAAgC,CAAA;AAAA;AAGlD,MAAA,OAAO,MAAM,aAAc,CAAA,aAAA;AAAA,QACzB,GAAG,MAAM,CAAA,CAAA;AAAA,QACT,aAAA;AAAA,QACA,gBAAA;AAAA,QACA,mBAAA;AAAA,QACA;AAAA,OACF;AAAA,KACF;AAAA,IACA,SAAS,CAAS,KAAA,KAAA;AAEhB,MAAA,OAAA,CAAQ,KAAK,KAAK,CAAA;AAAA;AACpB,GACD,CAAA;AACH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDeleteConversation.esm.js","sources":["../../src/hooks/useDeleteConversation.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useApi } from '@backstage/core-plugin-api';\n\nimport {
|
|
1
|
+
{"version":3,"file":"useDeleteConversation.esm.js","sources":["../../src/hooks/useDeleteConversation.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useApi } from '@backstage/core-plugin-api';\n\nimport {\n useMutation,\n useQueryClient,\n type UseMutationResult,\n} from '@tanstack/react-query';\n\nimport { lightspeedApiRef } from '../api/api';\nimport { ConversationList } from '../types';\n\ntype DeleteVariables = {\n conversation_id: string;\n invalidateCache?: boolean;\n};\n\ntype DeleteContext = {\n previousConversations?: ConversationList;\n};\n\nexport const useDeleteConversation = (): UseMutationResult<\n void,\n Error,\n DeleteVariables,\n DeleteContext\n> => {\n const lightspeedApi = useApi(lightspeedApiRef);\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationFn: async (props: {\n conversation_id: string;\n invalidateCache?: boolean;\n }) => {\n await lightspeedApi.deleteConversation(props.conversation_id);\n },\n onMutate: async props => {\n await queryClient.cancelQueries({ queryKey: ['conversations'] });\n\n const previousConversations: ConversationList | undefined =\n queryClient.getQueryData(['conversations']);\n\n queryClient.setQueryData(['conversations'], (old: ConversationList) =>\n old.filter(c => c.conversation_id !== props.conversation_id),\n );\n\n return { previousConversations };\n },\n onSuccess: (_, props) => {\n if (props.invalidateCache) {\n queryClient.invalidateQueries({ queryKey: ['conversations'] });\n }\n },\n onError: (_, __, context) => {\n queryClient.setQueryData(\n ['conversations'],\n context?.previousConversations,\n );\n return { success: false };\n },\n });\n};\n"],"names":[],"mappings":";;;;AAoCO,MAAM,wBAAwB,MAKhC;AACH,EAAM,MAAA,aAAA,GAAgB,OAAO,gBAAgB,CAAA;AAC7C,EAAA,MAAM,cAAc,cAAe,EAAA;AAEnC,EAAA,OAAO,WAAY,CAAA;AAAA,IACjB,UAAA,EAAY,OAAO,KAGb,KAAA;AACJ,MAAM,MAAA,aAAA,CAAc,kBAAmB,CAAA,KAAA,CAAM,eAAe,CAAA;AAAA,KAC9D;AAAA,IACA,QAAA,EAAU,OAAM,KAAS,KAAA;AACvB,MAAA,MAAM,YAAY,aAAc,CAAA,EAAE,UAAU,CAAC,eAAe,GAAG,CAAA;AAE/D,MAAA,MAAM,qBACJ,GAAA,WAAA,CAAY,YAAa,CAAA,CAAC,eAAe,CAAC,CAAA;AAE5C,MAAY,WAAA,CAAA,YAAA;AAAA,QAAa,CAAC,eAAe,CAAA;AAAA,QAAG,CAAC,QAC3C,GAAI,CAAA,MAAA,CAAO,OAAK,CAAE,CAAA,eAAA,KAAoB,MAAM,eAAe;AAAA,OAC7D;AAEA,MAAA,OAAO,EAAE,qBAAsB,EAAA;AAAA,KACjC;AAAA,IACA,SAAA,EAAW,CAAC,CAAA,EAAG,KAAU,KAAA;AACvB,MAAA,IAAI,MAAM,eAAiB,EAAA;AACzB,QAAA,WAAA,CAAY,kBAAkB,EAAE,QAAA,EAAU,CAAC,eAAe,GAAG,CAAA;AAAA;AAC/D,KACF;AAAA,IACA,OAAS,EAAA,CAAC,CAAG,EAAA,EAAA,EAAI,OAAY,KAAA;AAC3B,MAAY,WAAA,CAAA,YAAA;AAAA,QACV,CAAC,eAAe,CAAA;AAAA,QAChB,OAAS,EAAA;AAAA,OACX;AACA,MAAO,OAAA,EAAE,SAAS,KAAM,EAAA;AAAA;AAC1B,GACD,CAAA;AACH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFeedbackStatus.esm.js","sources":["../../src/hooks/useFeedbackStatus.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useApi } from '@backstage/core-plugin-api';\n\nimport { useQuery } from '@tanstack/react-query';\n\nimport { lightspeedApiRef } from '../api/api';\n\n// Fetch feedback status\nexport const useFeedbackStatus = () => {\n const lightspeedApi = useApi(lightspeedApiRef);\n return useQuery({\n queryKey: ['feedbackStatus'],\n queryFn: async () => await lightspeedApi.getFeedbackStatus(),\n });\n};\n"],"names":[],"mappings":";;;;AAsBO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"useFeedbackStatus.esm.js","sources":["../../src/hooks/useFeedbackStatus.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useApi } from '@backstage/core-plugin-api';\n\nimport { useQuery, type UseQueryResult } from '@tanstack/react-query';\n\nimport { lightspeedApiRef } from '../api/api';\n\n// Fetch feedback status\nexport const useFeedbackStatus = (): UseQueryResult<boolean, Error> => {\n const lightspeedApi = useApi(lightspeedApiRef);\n return useQuery({\n queryKey: ['feedbackStatus'],\n queryFn: async () => await lightspeedApi.getFeedbackStatus(),\n });\n};\n"],"names":[],"mappings":";;;;AAsBO,MAAM,oBAAoB,MAAsC;AACrE,EAAM,MAAA,aAAA,GAAgB,OAAO,gBAAgB,CAAA;AAC7C,EAAA,OAAO,QAAS,CAAA;AAAA,IACd,QAAA,EAAU,CAAC,gBAAgB,CAAA;AAAA,IAC3B,OAAS,EAAA,YAAY,MAAM,aAAA,CAAc,iBAAkB;AAAA,GAC5D,CAAA;AACH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useQuestionValidation.esm.js","sources":["../../src/hooks/useQuestionValidation.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useApi } from '@backstage/core-plugin-api';\n\nimport { useQuery } from '@tanstack/react-query';\n\nimport { lightspeedApiRef } from '../api/api';\n\nexport const useTopicRestrictionStatus = () => {\n const lightspeedApi = useApi(lightspeedApiRef);\n return useQuery({\n queryKey: ['topicRestrictionStatus'],\n queryFn: async () => {\n return await lightspeedApi.isTopicRestrictionEnabled();\n },\n });\n};\n"],"names":[],"mappings":";;;;AAsBO,MAAM,4BAA4B,
|
|
1
|
+
{"version":3,"file":"useQuestionValidation.esm.js","sources":["../../src/hooks/useQuestionValidation.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useApi } from '@backstage/core-plugin-api';\n\nimport { useQuery, type UseQueryResult } from '@tanstack/react-query';\n\nimport { lightspeedApiRef } from '../api/api';\n\nexport const useTopicRestrictionStatus = (): UseQueryResult<boolean, Error> => {\n const lightspeedApi = useApi(lightspeedApiRef);\n return useQuery({\n queryKey: ['topicRestrictionStatus'],\n queryFn: async () => {\n return await lightspeedApi.isTopicRestrictionEnabled();\n },\n });\n};\n"],"names":[],"mappings":";;;;AAsBO,MAAM,4BAA4B,MAAsC;AAC7E,EAAM,MAAA,aAAA,GAAgB,OAAO,gBAAgB,CAAA;AAC7C,EAAA,OAAO,QAAS,CAAA;AAAA,IACd,QAAA,EAAU,CAAC,wBAAwB,CAAA;AAAA,IACnC,SAAS,YAAY;AACnB,MAAO,OAAA,MAAM,cAAc,yBAA0B,EAAA;AAAA;AACvD,GACD,CAAA;AACH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRenameConversation.esm.js","sources":["../../src/hooks/useRenameConversation.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useApi } from '@backstage/core-plugin-api';\n\nimport {
|
|
1
|
+
{"version":3,"file":"useRenameConversation.esm.js","sources":["../../src/hooks/useRenameConversation.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useApi } from '@backstage/core-plugin-api';\n\nimport {\n useMutation,\n useQueryClient,\n type UseMutationResult,\n} from '@tanstack/react-query';\n\nimport { lightspeedApiRef } from '../api/api';\nimport { ConversationList } from '../types';\n\ntype RenameVariables = {\n conversation_id: string;\n newName: string;\n invalidateCache?: boolean;\n};\n\ntype RenameContext = {\n previousConversations?: ConversationList;\n};\n\nexport const useRenameConversation = (): UseMutationResult<\n void,\n Error,\n RenameVariables,\n RenameContext\n> => {\n const lightspeedApi = useApi(lightspeedApiRef);\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationFn: async (props: {\n conversation_id: string;\n newName: string;\n invalidateCache?: boolean;\n }) => {\n await lightspeedApi.renameConversation(\n props.conversation_id,\n props.newName,\n );\n },\n onMutate: async props => {\n await queryClient.cancelQueries({ queryKey: ['conversations'] });\n\n const previousConversations = queryClient.getQueryData<ConversationList>([\n 'conversations',\n ]);\n\n queryClient.setQueryData(['conversations'], (old: ConversationList) =>\n old.map(c =>\n c.conversation_id === props.conversation_id\n ? { ...c, topic_summary: props.newName }\n : c,\n ),\n );\n\n return { previousConversations };\n },\n onSuccess: (_, props) => {\n if (props.invalidateCache) {\n queryClient.invalidateQueries({ queryKey: ['conversations'] });\n }\n },\n onError: (_, __, context) => {\n queryClient.setQueryData(\n ['conversations'],\n context?.previousConversations,\n );\n return { success: false };\n },\n });\n};\n"],"names":[],"mappings":";;;;AAqCO,MAAM,wBAAwB,MAKhC;AACH,EAAM,MAAA,aAAA,GAAgB,OAAO,gBAAgB,CAAA;AAC7C,EAAA,MAAM,cAAc,cAAe,EAAA;AAEnC,EAAA,OAAO,WAAY,CAAA;AAAA,IACjB,UAAA,EAAY,OAAO,KAIb,KAAA;AACJ,MAAA,MAAM,aAAc,CAAA,kBAAA;AAAA,QAClB,KAAM,CAAA,eAAA;AAAA,QACN,KAAM,CAAA;AAAA,OACR;AAAA,KACF;AAAA,IACA,QAAA,EAAU,OAAM,KAAS,KAAA;AACvB,MAAA,MAAM,YAAY,aAAc,CAAA,EAAE,UAAU,CAAC,eAAe,GAAG,CAAA;AAE/D,MAAM,MAAA,qBAAA,GAAwB,YAAY,YAA+B,CAAA;AAAA,QACvE;AAAA,OACD,CAAA;AAED,MAAY,WAAA,CAAA,YAAA;AAAA,QAAa,CAAC,eAAe,CAAA;AAAA,QAAG,CAAC,QAC3C,GAAI,CAAA,GAAA;AAAA,UAAI,CAAA,CAAA,KACN,CAAE,CAAA,eAAA,KAAoB,KAAM,CAAA,eAAA,GACxB,EAAE,GAAG,CAAG,EAAA,aAAA,EAAe,KAAM,CAAA,OAAA,EAC7B,GAAA;AAAA;AACN,OACF;AAEA,MAAA,OAAO,EAAE,qBAAsB,EAAA;AAAA,KACjC;AAAA,IACA,SAAA,EAAW,CAAC,CAAA,EAAG,KAAU,KAAA;AACvB,MAAA,IAAI,MAAM,eAAiB,EAAA;AACzB,QAAA,WAAA,CAAY,kBAAkB,EAAE,QAAA,EAAU,CAAC,eAAe,GAAG,CAAA;AAAA;AAC/D,KACF;AAAA,IACA,OAAS,EAAA,CAAC,CAAG,EAAA,EAAA,EAAI,OAAY,KAAA;AAC3B,MAAY,WAAA,CAAA,YAAA;AAAA,QACV,CAAC,eAAe,CAAA;AAAA,QAChB,OAAS,EAAA;AAAA,OACX;AACA,MAAO,OAAA,EAAE,SAAS,KAAM,EAAA;AAAA;AAC1B,GACD,CAAA;AACH;;;;"}
|
|
@@ -4,176 +4,134 @@ import { lightspeedTranslationRef } from './ref.esm.js';
|
|
|
4
4
|
const lightspeedTranslationDe = createTranslationMessages({
|
|
5
5
|
ref: lightspeedTranslationRef,
|
|
6
6
|
messages: {
|
|
7
|
-
// Page titles and headers
|
|
8
7
|
"page.title": "Lightspeed",
|
|
9
8
|
"page.subtitle": "KI-gest\xFCtzter Entwicklungsassistent",
|
|
10
|
-
|
|
11
|
-
"prompts.codeReadability.
|
|
12
|
-
"prompts.
|
|
13
|
-
"prompts.debugging.
|
|
14
|
-
"prompts.
|
|
15
|
-
"prompts.developmentConcept.
|
|
16
|
-
"prompts.
|
|
17
|
-
"prompts.codeOptimization.
|
|
18
|
-
"prompts.
|
|
19
|
-
"prompts.documentation.
|
|
20
|
-
"prompts.
|
|
21
|
-
"prompts.gitWorkflows.
|
|
22
|
-
"prompts.gitWorkflows.message": "Ich m\xF6chte \xC4nderungen am Code in einem anderen Branch vornehmen, ohne meine bestehende Arbeit zu verlieren. Was ist das Verfahren, um dies mit Git zu tun?",
|
|
9
|
+
"prompts.codeReadability.title": "Hilfe zur Code-Lesbarkeit erhalten",
|
|
10
|
+
"prompts.codeReadability.message": "K\xF6nnen Sie mir Techniken vorschlagen, mit denen ich meinen Code lesbarer und wartungsfreundlicher gestalten kann?",
|
|
11
|
+
"prompts.debugging.title": "Hilfe beim Debuggen erhalten",
|
|
12
|
+
"prompts.debugging.message": "Meine Anwendung gibt beim Versuch einer Verbindung zur Datenbank einen Fehler aus. K\xF6nnen Sie mir helfen, das Problem zu identifizieren?",
|
|
13
|
+
"prompts.developmentConcept.title": "Ein Entwicklungskonzept erl\xE4utern",
|
|
14
|
+
"prompts.developmentConcept.message": "K\xF6nnen Sie erkl\xE4ren, wie eine Microservices-Architektur funktioniert und welche Vorteile sie gegen\xFCber einem monolithischen Design bietet?",
|
|
15
|
+
"prompts.codeOptimization.title": "Vorschl\xE4ge zur Codeoptimierung unterbreiten",
|
|
16
|
+
"prompts.codeOptimization.message": "K\xF6nnen Sie g\xE4ngige Methoden zur Codeoptimierung vorschlagen, um eine bessere Performance zu erzielen?",
|
|
17
|
+
"prompts.documentation.title": "Zusammenfassung von Dokumentation",
|
|
18
|
+
"prompts.documentation.message": "K\xF6nnen Sie die Dokumentation zur Implementierung der OAuth 2.0-Authentifizierung in einer Webanwendung zusammenfassen?",
|
|
19
|
+
"prompts.gitWorkflows.title": "Workflows mit Git",
|
|
20
|
+
"prompts.gitWorkflows.message": "Ich m\xF6chte \xC4nderungen am Code in einem anderen Branch vornehmen, ohne meine bestehende Arbeit zu verlieren. Wie geht man dabei mit Git vor?",
|
|
23
21
|
"prompts.testingStrategies.title": "Teststrategien vorschlagen",
|
|
24
|
-
"prompts.testingStrategies.message": "K\xF6nnen Sie g\xE4ngige Teststrategien empfehlen, die meine Anwendung robust und fehlerfrei machen?",
|
|
25
|
-
"prompts.sortingAlgorithms.title": "Sortieralgorithmen
|
|
26
|
-
"prompts.sortingAlgorithms.message": "K\xF6nnen Sie den Unterschied zwischen
|
|
27
|
-
"prompts.eventDriven.
|
|
28
|
-
"prompts.
|
|
29
|
-
|
|
30
|
-
"prompts.
|
|
31
|
-
"prompts.
|
|
32
|
-
"prompts.
|
|
33
|
-
"prompts.
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
"conversation.delete.confirm.title": "Chat l\xF6schen?",
|
|
38
|
-
"conversation.delete.confirm.message": "Sie werden diesen Chat hier nicht mehr sehen. Dies l\xF6scht auch verwandte Aktivit\xE4ten wie Prompts, Antworten und Feedback aus Ihrer Lightspeed-Aktivit\xE4t.",
|
|
39
|
-
"conversation.delete.confirm.action": "L\xF6schen",
|
|
40
|
-
"conversation.rename.confirm.title": "Chat umbenennen?",
|
|
41
|
-
"conversation.rename.confirm.action": "Umbenennen",
|
|
42
|
-
"conversation.rename.placeholder": "Chat-Name",
|
|
43
|
-
// Permissions
|
|
44
|
-
"permission.required.title": "Fehlende Berechtigungen",
|
|
45
|
-
"permission.required.description": "Um das Lightspeed-Plugin zu sehen, wenden Sie sich an Ihren Administrator, um die Berechtigungen <b>lightspeed.chat.read</b> und <b>lightspeed.chat.create</b> zu erhalten.",
|
|
46
|
-
// Disclaimers
|
|
47
|
-
"disclaimer.withValidation": "Diese Funktion verwendet KI-Technologie. Geben Sie keine pers\xF6nlichen Informationen oder andere sensible Informationen in Ihre Eingabe ein. Interaktionen k\xF6nnen zur Verbesserung der Produkte oder Dienstleistungen von Red Hat verwendet werden.",
|
|
48
|
-
"disclaimer.withoutValidation": "Diese Funktion verwendet KI-Technologie. Geben Sie keine pers\xF6nlichen Informationen oder andere sensible Informationen in Ihre Eingabe ein. Interaktionen k\xF6nnen zur Verbesserung der Produkte oder Dienstleistungen von Red Hat verwendet werden.",
|
|
49
|
-
// Footer and feedback
|
|
50
|
-
"footer.accuracy.label": "\xDCberpr\xFCfen Sie KI-generierte Inhalte immer vor der Verwendung.",
|
|
51
|
-
// Common actions
|
|
22
|
+
"prompts.testingStrategies.message": "K\xF6nnen Sie mir einige g\xE4ngige Teststrategien empfehlen, die meine Anwendung robust und fehlerfrei machen?",
|
|
23
|
+
"prompts.sortingAlgorithms.title": "Sortieralgorithmen verst\xE4ndlich erkl\xE4ren",
|
|
24
|
+
"prompts.sortingAlgorithms.message": "K\xF6nnen Sie den Unterschied zwischen Quicksort und Mergesort erkl\xE4ren und wann man welchen Algorithmus verwendet?",
|
|
25
|
+
"prompts.eventDriven.message": "K\xF6nnen Sie erkl\xE4ren, was ereignisgesteuerte Architektur bedeutet und wann ihre Verwendung in der Softwareentwicklung von Vorteil ist?",
|
|
26
|
+
"prompts.tekton.title": "Mit Tekton deployen",
|
|
27
|
+
"prompts.tekton.message": "K\xF6nnen Sie mir helfen, das Deployment meiner Anwendung mithilfe von Tekton-Pipelines zu automatisieren?",
|
|
28
|
+
"prompts.openshift.title": "OpenShift-Deployment erstellen",
|
|
29
|
+
"prompts.openshift.message": "K\xF6nnen Sie mich bei der Erstellung eines neuen Deployments in OpenShift f\xFCr eine containerisierte Anwendung unterst\xFCtzen?",
|
|
30
|
+
"prompts.rhdh.title": "Erste Schritte mit dem Red Hat Developer Hub",
|
|
31
|
+
"prompts.rhdh.message": "K\xF6nnen Sie mich bei den ersten Schritten zur Nutzung des Developer Hub als Entwickler unterst\xFCtzen, z.\xA0B. beim Erkunden des Softwarekatalogs und beim Hinzuf\xFCgen meines Dienstes?",
|
|
32
|
+
"conversation.delete.confirm.message": "Dieser Chat wird hier nicht mehr angezeigt. Dadurch werden auch zugeh\xF6rige Aktivit\xE4ten wie Prompts, Antworten und Feedback aus Ihrer Lightspeed-Aktivit\xE4t gel\xF6scht.",
|
|
33
|
+
"disclaimer.withoutValidation": "Diese Funktion nutzt KI-Technologie. Geben Sie bei Ihrer Eingabe keine pers\xF6nlichen oder sonstigen sensiblen Informationen an. Interaktionen k\xF6nnen dazu genutzt werden, die Produkte oder Dienstleistungen von Red Hat zu verbessern.",
|
|
34
|
+
"footer.accuracy.label": "KI-generierte Inhalte sollten vor der Verwendung stets \xFCberpr\xFCft werden.",
|
|
52
35
|
"common.cancel": "Abbrechen",
|
|
53
36
|
"common.close": "Schlie\xDFen",
|
|
54
|
-
"common.readMore": "Mehr
|
|
55
|
-
"common.noSearchResults": "
|
|
56
|
-
// Menu items
|
|
37
|
+
"common.readMore": "Mehr lesen",
|
|
38
|
+
"common.noSearchResults": "Keine Ergebnisse, die der Suche entsprechen",
|
|
57
39
|
"menu.newConversation": "Neuer Chat",
|
|
58
|
-
// Chat-specific UI elements
|
|
59
40
|
"chatbox.header.title": "Developer Lightspeed",
|
|
60
41
|
"chatbox.search.placeholder": "Suchen",
|
|
61
42
|
"chatbox.provider.other": "Andere",
|
|
62
43
|
"chatbox.emptyState.noPinnedChats": "Keine angehefteten Chats",
|
|
63
|
-
"chatbox.emptyState.noRecentChats": "Keine
|
|
44
|
+
"chatbox.emptyState.noRecentChats": "Keine letzten Chats",
|
|
64
45
|
"chatbox.emptyState.noResults.title": "Keine Ergebnisse gefunden",
|
|
65
|
-
"chatbox.emptyState.noResults.body": "Passen Sie Ihre Suchanfrage an und versuchen Sie es erneut. \xDCberpr\xFCfen Sie Ihre Rechtschreibung oder versuchen Sie
|
|
66
|
-
"chatbox.welcome.greeting": "Hallo
|
|
67
|
-
"chatbox.
|
|
68
|
-
"chatbox.message.placeholder": "Geben Sie eine Eingabeaufforderung f\xFCr Lightspeed ein",
|
|
46
|
+
"chatbox.emptyState.noResults.body": "Passen Sie Ihre Suchanfrage an, und versuchen Sie es erneut. \xDCberpr\xFCfen Sie Ihre Rechtschreibung, oder versuchen Sie es mit einem allgemeineren Begriff.",
|
|
47
|
+
"chatbox.welcome.greeting": "Hallo {{userName}}",
|
|
48
|
+
"chatbox.message.placeholder": "Senden Sie eine Nachricht, und laden Sie optional eine JSON-, YAML- oder TXT-Datei hoch\xA0...",
|
|
69
49
|
"chatbox.fileUpload.failed": "Datei-Upload fehlgeschlagen",
|
|
70
|
-
"chatbox.fileUpload.infoText": "Unterst\xFCtzte Dateitypen
|
|
71
|
-
// Accessibility and ARIA labels
|
|
72
|
-
"aria.chatbotSelector": "Chatbot-Auswahl",
|
|
50
|
+
"chatbox.fileUpload.infoText": "Unterst\xFCtzte Dateitypen: .txt, .yaml und .json. Die maximale Dateigr\xF6\xDFe betr\xE4gt 25 MB.",
|
|
73
51
|
"aria.important": "Wichtig",
|
|
74
|
-
"aria.chatHistoryMenu": "
|
|
75
|
-
"aria.closeDrawerPanel": "
|
|
52
|
+
"aria.chatHistoryMenu": "Chatverlauf-Men\xFC",
|
|
53
|
+
"aria.closeDrawerPanel": "Drawer-Fenster schlie\xDFen",
|
|
76
54
|
"aria.search.placeholder": "Suchen",
|
|
77
|
-
"aria.searchPreviousConversations": "
|
|
55
|
+
"aria.searchPreviousConversations": "Vorherige Unterhaltungen durchsuchen",
|
|
78
56
|
"aria.resize": "Gr\xF6\xDFe \xE4ndern",
|
|
79
57
|
"aria.options.label": "Optionen",
|
|
80
|
-
"aria.scroll.down": "
|
|
81
|
-
"aria.scroll.up": "
|
|
58
|
+
"aria.scroll.down": "Zur\xFCck zum Ende",
|
|
59
|
+
"aria.scroll.up": "Zur\xFCck zum Anfang",
|
|
82
60
|
"aria.settings.label": "Chatbot-Optionen",
|
|
83
61
|
"aria.close": "Chatbot schlie\xDFen",
|
|
84
|
-
// Modal actions
|
|
85
62
|
"modal.edit": "Bearbeiten",
|
|
86
63
|
"modal.save": "Speichern",
|
|
87
64
|
"modal.close": "Schlie\xDFen",
|
|
88
65
|
"modal.cancel": "Abbrechen",
|
|
89
|
-
// Conversation actions
|
|
90
66
|
"conversation.delete": "L\xF6schen",
|
|
91
67
|
"conversation.rename": "Umbenennen",
|
|
92
68
|
"conversation.addToPinnedChats": "Anheften",
|
|
93
|
-
"conversation.removeFromPinnedChats": "
|
|
69
|
+
"conversation.removeFromPinnedChats": "L\xF6sen",
|
|
94
70
|
"conversation.announcement.userMessage": "Nachricht vom Benutzer: {{prompt}}. Nachricht vom Bot wird geladen.",
|
|
95
|
-
// User states
|
|
96
|
-
"user.guest": "Gast",
|
|
97
71
|
"user.loading": "...",
|
|
98
|
-
// Button tooltips and labels
|
|
99
72
|
"tooltip.attach": "Anh\xE4ngen",
|
|
100
73
|
"tooltip.send": "Senden",
|
|
101
|
-
"tooltip.microphone.active": "
|
|
74
|
+
"tooltip.microphone.active": "\xDCberwachen beenden",
|
|
102
75
|
"tooltip.microphone.inactive": "Mikrofon verwenden",
|
|
103
76
|
"button.newChat": "Neuer Chat",
|
|
104
|
-
"tooltip.chatHistoryMenu": "
|
|
77
|
+
"tooltip.chatHistoryMenu": "Chatverlauf-Men\xFC",
|
|
105
78
|
"tooltip.responseRecorded": "Antwort aufgezeichnet",
|
|
106
|
-
"tooltip.backToTop": "
|
|
107
|
-
"tooltip.backToBottom": "
|
|
79
|
+
"tooltip.backToTop": "Zur\xFCck zum Anfang",
|
|
80
|
+
"tooltip.backToBottom": "Zur\xFCck zum Ende",
|
|
108
81
|
"tooltip.settings": "Chatbot-Optionen",
|
|
109
82
|
"tooltip.close": "Schlie\xDFen",
|
|
110
|
-
|
|
111
|
-
"modal.title.preview": "Anhang-Vorschau",
|
|
83
|
+
"modal.title.preview": "Anhang in der Vorschau anzeigen",
|
|
112
84
|
"modal.title.edit": "Anhang bearbeiten",
|
|
113
|
-
|
|
114
|
-
"icon.
|
|
115
|
-
"icon.permissionRequired.alt": "Berechtigung erforderlich Icon",
|
|
116
|
-
// Message utilities
|
|
85
|
+
"icon.lightspeed.alt": "Lightspeed-Symbol",
|
|
86
|
+
"icon.permissionRequired.alt": "Symbol f\xFCr 'Berechtigung erforderlich'",
|
|
117
87
|
"message.options.label": "Optionen",
|
|
118
|
-
|
|
119
|
-
"file.upload.error.
|
|
120
|
-
"file.upload.error.
|
|
121
|
-
"file.upload.error.
|
|
122
|
-
"file.upload.error.fileTooLarge": "Ihre Dateigr\xF6\xDFe ist zu gro\xDF. Bitte stellen Sie sicher, dass Ihre Datei kleiner als 25 MB ist.",
|
|
123
|
-
"file.upload.error.readFailed": "Fehler beim Lesen der Datei: {{errorMessage}}",
|
|
124
|
-
// Developer error messages
|
|
125
|
-
"error.context.fileAttachment": "useFileAttachmentContext muss innerhalb eines FileAttachmentContextProvider sein",
|
|
126
|
-
// Feedback actions
|
|
88
|
+
"file.upload.error.alreadyExists": "Datei existiert bereits.",
|
|
89
|
+
"file.upload.error.multipleFiles": "Es wurden mehr als eine Datei hochgeladen.",
|
|
90
|
+
"file.upload.error.unsupportedType": "Nicht unterst\xFCtzter Dateityp. Unterst\xFCtzte Typen: .txt, .yaml und .json.",
|
|
91
|
+
"file.upload.error.readFailed": "Datei konnte nicht gelesen werden: {{errorMessage}}",
|
|
127
92
|
"feedback.form.title": "Warum haben Sie diese Bewertung gew\xE4hlt?",
|
|
128
|
-
"feedback.form.textAreaPlaceholder": "Geben Sie
|
|
93
|
+
"feedback.form.textAreaPlaceholder": "Geben Sie optional zus\xE4tzliches Feedback an",
|
|
129
94
|
"feedback.form.submitWord": "Absenden",
|
|
130
95
|
"feedback.tooltips.goodResponse": "Gute Antwort",
|
|
131
96
|
"feedback.tooltips.badResponse": "Schlechte Antwort",
|
|
132
97
|
"feedback.tooltips.copied": "Kopiert",
|
|
133
98
|
"feedback.tooltips.copy": "Kopieren",
|
|
134
|
-
"feedback.tooltips.listening": "
|
|
135
|
-
"feedback.tooltips.listen": "
|
|
99
|
+
"feedback.tooltips.listening": "\xDCberwachung",
|
|
100
|
+
"feedback.tooltips.listen": "\xDCberwachen",
|
|
136
101
|
"feedback.quickResponses.positive.helpful": "Hilfreiche Informationen",
|
|
137
|
-
"feedback.quickResponses.positive.easyToUnderstand": "
|
|
138
|
-
"feedback.quickResponses.positive.resolvedIssue": "
|
|
139
|
-
"feedback.quickResponses.negative.didntAnswer": "
|
|
102
|
+
"feedback.quickResponses.positive.easyToUnderstand": "Leicht verst\xE4ndlich",
|
|
103
|
+
"feedback.quickResponses.positive.resolvedIssue": "Mein Problem wurde gel\xF6st",
|
|
104
|
+
"feedback.quickResponses.negative.didntAnswer": "Meine Frage wurde nicht beantwortet",
|
|
140
105
|
"feedback.quickResponses.negative.hardToUnderstand": "Schwer zu verstehen",
|
|
141
106
|
"feedback.quickResponses.negative.notHelpful": "Nicht hilfreich",
|
|
142
107
|
"feedback.completion.title": "Feedback \xFCbermittelt",
|
|
143
108
|
"feedback.completion.body": "Wir haben Ihre Antwort erhalten. Vielen Dank f\xFCr Ihr Feedback!",
|
|
144
|
-
// Conversation categorization
|
|
145
109
|
"conversation.category.pinnedChats": "Angeheftet",
|
|
146
|
-
"conversation.category.recent": "
|
|
147
|
-
// lightspeed settings
|
|
110
|
+
"conversation.category.recent": "Neueste",
|
|
148
111
|
"settings.pinned.enable": "Angeheftete Chats aktivieren",
|
|
149
112
|
"settings.pinned.disable": "Angeheftete Chats deaktivieren",
|
|
150
113
|
"settings.pinned.enabled.description": "Angeheftete Chats sind derzeit aktiviert",
|
|
151
|
-
"settings.pinned.disabled.description": "Angeheftete Chats sind derzeit deaktiviert",
|
|
152
|
-
|
|
153
|
-
"toolCall.header": "Werkzeugantwort: {{toolName}}",
|
|
154
|
-
"toolCall.thinking": "{{seconds}} Sekunden nachgedacht",
|
|
114
|
+
"settings.pinned.disabled.description": "Angeheftete Chats sind derzeit deaktiviert.",
|
|
115
|
+
"toolCall.header": "Antwort des Tools: {{toolName}}",
|
|
155
116
|
"toolCall.executionTime": "Ausf\xFChrungszeit: ",
|
|
156
117
|
"toolCall.parameters": "Parameter",
|
|
157
118
|
"toolCall.response": "Antwort",
|
|
158
|
-
"toolCall.showMore": "
|
|
159
|
-
"toolCall.showLess": "
|
|
160
|
-
"toolCall.loading": "
|
|
161
|
-
"toolCall.executing": "
|
|
119
|
+
"toolCall.showMore": "Mehr anzeigen",
|
|
120
|
+
"toolCall.showLess": "Weniger anzeigen",
|
|
121
|
+
"toolCall.loading": "Tool wird ausgef\xFChrt...",
|
|
122
|
+
"toolCall.executing": "Tool wird ausgef\xFChrt...",
|
|
162
123
|
"toolCall.copyResponse": "Antwort kopieren",
|
|
163
|
-
"toolCall.summary": "Hier ist eine Zusammenfassung Ihrer Antwort",
|
|
124
|
+
"toolCall.summary": "Hier ist eine Zusammenfassung Ihrer Antwort.",
|
|
164
125
|
"toolCall.mcpServer": "MCP-Server",
|
|
165
|
-
// Display modes
|
|
166
126
|
"settings.displayMode.label": "Anzeigemodus",
|
|
167
|
-
"settings.displayMode.overlay": "
|
|
127
|
+
"settings.displayMode.overlay": "Overlay",
|
|
168
128
|
"settings.displayMode.docked": "An Fenster andocken",
|
|
169
129
|
"settings.displayMode.fullscreen": "Vollbild",
|
|
170
|
-
|
|
171
|
-
"sort.
|
|
172
|
-
"sort.
|
|
173
|
-
"sort.oldest": "Datum (\xE4lteste zuerst)",
|
|
130
|
+
"sort.label": "Unterhaltungen sortieren",
|
|
131
|
+
"sort.newest": "Datum (neuestes zuerst)",
|
|
132
|
+
"sort.oldest": "Datum (\xE4ltestes zuerst)",
|
|
174
133
|
"sort.alphabeticalAsc": "Name (A-Z)",
|
|
175
134
|
"sort.alphabeticalDesc": "Name (Z-A)",
|
|
176
|
-
// Deep thinking
|
|
177
135
|
"reasoning.thinking": "Denkvorgang anzeigen"
|
|
178
136
|
}
|
|
179
137
|
});
|