-
Notifications
You must be signed in to change notification settings - Fork 54
HardwareReport: Add OpenAI Assistant to Hardware Report Tool (Chat + Action Support) #261
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
base: main
Are you sure you want to change the base?
Conversation
…ading new files to assistant
…nd creating a vectore store
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.
Pull Request Overview
This PR integrates an OpenAI-based AI assistant into the Hardware Report Tool, providing chat capabilities, log-file analysis, and action functions.
- Adds schema and usage notes for log parsing (logs_schema_and_notes.txt)
- Defines system instructions for the assistant (instructions.txt)
- Embeds a chat UI and client logic (index.html, Chat.js)
- Declares assistant tool definitions (assistantTools.json)
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
logs_schema_and_notes.txt | Adds full JSON schema and processing notes for log segments |
instructions.txt | Introduces assistant instructions and file‐presence guard logic |
index.html | Inserts AI chat widget markup, styles, and script reference |
assistantTools.json | Lists available assistant tools and function signatures |
Chat.js | Implements assistant connection, file upload, threading, and UI |
Comments suppressed due to low confidence (1)
HardwareReport/index.html:43
- The chat bubble container lacks an aria-label or role attribute; add
aria-label="Open AI assistant chat"
androle="button"
to improve screen reader support.
#ai-chat-bubble {
be3eb80
to
24c649a
Compare
I've addressed all comments. Regarding the API key: it's now stored in memory instead of localStorage, it will no longer persist and the user will have to re-enter it when page is refreshed, this is slightly better for security but still carries XSS risks. |
Hi @AnasChebili, Thanks very much for the updates. Feel free to mark the comments as resolved. I know there's sometimes a question, "is it ok for the dev to mark them as resolved or should the reporter check and then mark them him/herself" but in general we let the dev do it. Thanks! |
@rmackay9 Done! Thanks!! |
Hey, thanks for the feedback! |
This PR adds an AI assistant chat interface to the Hardware Report Tool as part of the broader effort to enhance ArduPilot's web tools with intelligent assistant capabilities.
The assistant is capable of answering general questions about the webtool, answering questions about specific user-uploaded logs files, and performing predefined actions.
Currently, this requires using an OpenAI API key to use.
Below is a video showcasing a typical interaction:
assistant-showcase.mp4
Assistant Capabilities:
Answers general questions about the tool from its instruction set.
Analyzes uploaded log files using file search + code interpreter.
Can call 3 functions:
save_all_parameters
,save_changed_parameters
,save_minimal_parameters
.Fully manages assistant lifecycle:
Reuses or creates assistant based on API key.
Upgrade button replaces old assistant with latest version.
Auto-updates assistant context after the user changes the updated logs file.
Code interpreter filters and processes large datasets efficiently. Big potential for improvement here.
Known Issues:
Sometimes the assistant wrongly thinks a log file was (or wasn’t) uploaded. Happens rarely and usually goes away after a page reload and context reset.
Not tested on large or complex real-world log files, might struggle there.
Occasionally fails to retrieve data due to schema mismatch, causing errors in code interpreter. Asking it to try again usually fixes it.
Needs more testing to surface other edge cases.