The IRIS-GPT project demonstrates how to use the GPT chat with Intersystems IRIS by configuring TXT prompt engines globally and defining GPT behavior. It empowers code changes and creations in the system through natural language processing.
There are two pre-programmed prompt engines in this project:
Rules Interoperability Engine: This engine assists in creating and maintaining rules for interoperability in Intersystems IRIS. It allows interaction with GPT to obtain suggestions and assistance in defining the rules.
Python ClassMethod Engine: This engine facilitates the creation and maintenance of Python ClassMethods in Intersystems IRIS. It utilizes GPT to provide coding assistance and suggestions to enhance the implementation of methods.
Clone/git pull the repo into any local directory
$ git clone https://github.com/Davi-Massaru/interoperability_GPT.git
Replace a tag to your openia api key on iris.script
Set ^GPT.openAI.APIKeys = "<OPENIA.key>"
You can change a GPT.model, change the iris.script. defined "gpt-3.5-turbo-0613"
Set ^GPT.model = "gpt-3.5-turbo-0613"
Open the terminal in this directory and run:
$ docker-compose build && docker-compose up -d
To create new prompt engines, you can create a new TXT file in the project root or inside the Docker container. These files will dictate the behavior of the GPT chat.
After producing the TXT file, configure the global in the following structure:
For example, use ^GPT.engine as follows:
Set ^GPT.engine("implementation") = "/home/irisowner/dev/prompt-implementation-engineer.txt"
Set ^GPT.engine.initial("implementation") = "Write pyhton code"
In this example, you created a new engine called "implementation." All instructions sent to the GPT chat will start with the instruction "Write Python code."
Once you've completed these steps, simply execute ##class(dc.GPT.Engine).generate(,"") where is the input provided by the user.
In this repository, you can find examples of various pre-programmed prompt engines:
Rule Interoperability Engine: This engine assists with creating and maintaining rules for interoperability in Intersystems IRIS.
Python ClassMethod Engine: This engine facilitates the creation and maintenance of Python ClassMethods in Intersystems IRIS.
Python ClassMethod Engine
##class(dc.Dict.GenerateMethod).Run(className, method, formalSpec, mensage): to generate or override a new ClassMethod in python in the informed class, using formalSpec as parameters.
##class(dc.Dict.GenerateMethod).FixBug(className, method, mensage): to update a ClassMethod in python in the informed class, taking into account the current implementation.
##class(dc.Dict.GenerateRule).Run(className, mensage): to generate or override a new RuleDefinition in the informed class.
##class(dc.Dict.GenerateMethod).Fix(className, mensage): to update a RuleDefinition in python in the informed class, taking into account the current implementation