Skip to content

Commit

Permalink
copy ref docs
Browse files Browse the repository at this point in the history
  • Loading branch information
justjais committed Jan 6, 2025
1 parent 4608df7 commit 9b55447
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions ansible_ai_connect_chatbot/src/useChatbot/useChatbot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,17 @@ export const useChatbot = () => {
onClick: () => {
if (message.actions) {
message.actions.copy.className = "action-button-clicked";
navigator.clipboard.writeText(
typeof response === "object" ? response.response : response,
);
const ref_docs = typeof response === "object" ? response.referenced_documents?.slice(0, 30):response

Check failure on line 215 in ansible_ai_connect_chatbot/src/useChatbot/useChatbot.ts

View workflow job for this annotation

GitHub Actions / lint

Replace `·typeof·response·===·"object"·?·response.referenced_documents?.slice(0,·30):response` with `⏎··············typeof·response·===·"object"⏎················?·response.referenced_documents?.slice(0,·30)⏎················:·response;`
if (ref_docs){

Check failure on line 216 in ansible_ai_connect_chatbot/src/useChatbot/useChatbot.ts

View workflow job for this annotation

GitHub Actions / lint

Insert `·`
let llmResponse = [

Check failure on line 217 in ansible_ai_connect_chatbot/src/useChatbot/useChatbot.ts

View workflow job for this annotation

GitHub Actions / lint

'llmResponse' is never reassigned. Use 'const' instead
typeof response === "object" ? response.response: response,

Check failure on line 218 in ansible_ai_connect_chatbot/src/useChatbot/useChatbot.ts

View workflow job for this annotation

GitHub Actions / lint

Insert `·`
",\n",
typeof response === "object" ? response.referenced_documents?.slice(0, 30)

Check failure on line 220 in ansible_ai_connect_chatbot/src/useChatbot/useChatbot.ts

View workflow job for this annotation

GitHub Actions / lint

Replace `·?·response.referenced_documents` with `⏎··················?·response.referenced_documents⏎······················`
.map((doc) => doc.docs_url)

Check failure on line 221 in ansible_ai_connect_chatbot/src/useChatbot/useChatbot.ts

View workflow job for this annotation

GitHub Actions / lint

Insert `······`
.join(",\n") : response

Check failure on line 222 in ansible_ai_connect_chatbot/src/useChatbot/useChatbot.ts

View workflow job for this annotation

GitHub Actions / lint

Replace `················.join(",\n")·:·response` with `······················.join(",\n")⏎··················:·response,`
]

Check failure on line 223 in ansible_ai_connect_chatbot/src/useChatbot/useChatbot.ts

View workflow job for this annotation

GitHub Actions / lint

Insert `;`
navigator.clipboard.writeText(llmResponse?.map((llmResponse) => llmResponse).join(""));

Check failure on line 224 in ansible_ai_connect_chatbot/src/useChatbot/useChatbot.ts

View workflow job for this annotation

GitHub Actions / lint

Replace `llmResponse?.map((llmResponse)·=>·llmResponse).join("")` with `⏎················llmResponse?.map((llmResponse)·=>·llmResponse).join(""),⏎··············`
}
}
},
},
Expand Down

0 comments on commit 9b55447

Please sign in to comment.