-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
feat: AI #1035
Merged
Merged
feat: AI #1035
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
We can call it the "Three Eyed Raven" if we want it to be cringe.
This PR allows end users to create AI agents/assistants. It's based on OpenAI's Assistants in ChatGPT and supports function calling.
The idea is that we can create an AI assistant with some instructions - these instructions will have useful context like the current user's employee ID / company / department - embedded via Jinja tags. Custom apps can add additional variables that could be used in the instruction. Whenever the bot is called, these instructions are sent to it.
Adding instructions via Jinja:
Each Bot could also have a set of "functions" - where they can call any function in the system. Some standard functions like get_list, get_doc etc will be available, but you could create a "Raven AI Function" and define it's path (get that from commit) and it's function schema in the JSON Schema format.
Example (still WIP):
Function to get the retirement age for a given date of birth (pretty simple to begin with - will add more complex examples later)
When you send a DM to an AI bot, it automatically creates a thread with a response. Note here how it knew my name and department even though the end user did not send any instruction directly:
Finally, it can parse data that it gets from the user, and then call your custom functions (note how it converts the date from a long string to YYYY-MM-DD format). In this case, it just calls the custom function (hrms.overrides.employee_master.get_retirement_date) that we provided.
This PR needs #1017 to be complete first - threads is what allows the assistant to have conversations with context.
Checklist: