-
Notifications
You must be signed in to change notification settings - Fork 691
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
Chat: improve flight mode reliability #1291
Merged
peterbarker
merged 6 commits into
ArduPilot:master
from
rmackay9:chat-flight-mode-reliability
Dec 27, 2023
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9f002bf
chat: assistant set_wakeup_timer function definition
rmackay9 578bc55
chat: add wakeup timer support
rmackay9 3313e63
chat: move lock on sending to openai file
rmackay9 ed41e84
chat: assistant get_mode_mapping function def and instructions
rmackay9 e985c79
chat: support get_mode_mapping function
rmackay9 1cb9e08
chat: assistant instruction improvement for takeoff
rmackay9 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
MAVProxy/modules/mavproxy_chat/assistant_setup/delete_wakeup_timers.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"type": "function", | ||
"function": { | ||
"name": "delete_wakeup_timers", | ||
"description": "Delete all active wakeup timers. You can optionally provide a message parameter to filter which timers will be deleted based on their message. When specifying the message parameter, you can use regular expressions (regex) to match patterns within the timer messages. This is useful when you want to delete timers with specific keywords or patterns in their message. For example, to delete all timers containing the word 'hello', you can use the regex '.*hello.*', where the dot-star (.*) pattern matches any character sequence.", | ||
"parameters": { | ||
"type": "object", | ||
"properties": { | ||
"message": {"type": "string", "description": "wakeup message of timers to be deleted. regex values are accepted."} | ||
}, | ||
"required": [] | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
MAVProxy/modules/mavproxy_chat/assistant_setup/get_mode_mapping.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"type": "function", | ||
"function": { | ||
"name": "get_mode_mapping", | ||
"description": "Get a list of mode names to mode numbers available for this vehicle. If the name or number parameter is provided only that mode's name and number will be returned. If neither name nor number is provided the full list of available modes will be returned", | ||
"parameters": { | ||
"type": "object", | ||
"properties": { | ||
"name": {"type": "string", "description": "flight mode name (e.g. Guided, Loiter, RTL)"}, | ||
"number": {"type": "number", "description": "flight mode number"} | ||
}, | ||
"required": [] | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
MAVProxy/modules/mavproxy_chat/assistant_setup/get_wakeup_timers.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"type": "function", | ||
"function": { | ||
"name": "get_wakeup_timers", | ||
"description": "Retrieves a list of all active wakeup timers. You can optionally provide a message parameter to filter timers by their associated messages. When specifying the message parameter, you can use regular expressions (regex) to match patterns within the timer messages. This is useful when you want to find timers with specific keywords or patterns in their messages. For example, to retrieve all timers containing the word 'hello', you can use the regex '.*hello.*', where the dot-star (.*) pattern matches any character sequence.", | ||
"parameters": { | ||
"type": "object", | ||
"properties": { | ||
"message": {"type": "string", "description": "wakeup message of timers to be retrieved. regex values are accepted."} | ||
}, | ||
"required": [] | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
MAVProxy/modules/mavproxy_chat/assistant_setup/set_wakeup_timer.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"type": "function", | ||
"function": { | ||
"name": "set_wakeup_timer", | ||
"description": "Set a timer to wake you up in a specified number of seconds in the future. This allows taking actions in the future. The wakeup message will appear with the user role but will look something like WAKEUP:<message>. Multiple wakeup messages are supported", | ||
"parameters": { | ||
"type": "object", | ||
"properties": { | ||
"seconds": {"type": "number", "description": "number of seconds in the future that the timer will wake you up"}, | ||
"message": {"type": "string", "description": "wakeup message that will be sent to you"} | ||
}, | ||
"required": ["seconds", "message"] | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I can't help but wonder if it would be nicer to generate all of this from comments in the Python code rather than explicit documentation like this.
Advantages to human programmers in that. Especially when your editor is smart enough to use those comments to prompt in the user interface. Additional advantage that this documentation won't get out-of-date with the code, then.
Still, carry on :-)
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.
OK, that would be cool. The json files are slightly difficult to get right the first time you make them but after that it gets easier. What's odd about them is that you only need to include the list of arguments that the assistant must fill in. The return values can be whatever you want.. somehow the assistant just deals with whatever it gets.