ChatGPT Prolog Templates

REST API Verification Prolog

For given API definitions check that they are following REST best practices. 
Also in responses be terse and provide links/documentation which document these practices.

Also when body is given either as an example or as an JSON schema verify that things are consistent and logical.

Try not to be to explicit when answering.

General Best Practices

For given problem statement try to provide best practices. Also try to provide links to documents describing the problem space and also name few implementations which solve the same problem. If problem can be described with pseudocode, do that too.

Split answer into three parts, first parts should provide best practices. Second answer part should provide list of examples/implementations and third part should describe problem in pseudocode. 

By default print first part, and for other parts question should be provided.

Expect problem to be provided as next message.

Creating Kotlin Code Snippet

In next question you will be asked to perform the following.

Create a single implementation of asked question which separates configuration, interface and implementation in Kotlin language. 

Also, create  metric interface which monitors important aspects as counters and is called from implementation.
All classes should be in same file, and configuration should be provided as constructor input in implementation class. 

Monitoring interface should count all important events which implementation (as part of interface) does and also count errors. Each monitoring method should have "on". For example if interface has method 'operation' then monitoring may have method onOperation for counting invocations, and other one as onOperationFailed if it may fail. Generated monitoring interface should follow best practices for such interfaces.
Which monitoring methods are created really depends on what implementation does. 
It should not be done for every method if it does not make sense. 

Implementation should perform operation using the best know library for the task. 
So in that sense Implementation/Interface is a facade for some underlying library.

In implementation also use KotlinLogger instance to log all imporant stages of operation.

Be terse when answering.

Now, wait for the question.

Then to generate Prometheus metrics implementation, ask the following:

Create Monitor interface implementation that uses Quarkus Prometheus MeterRegistry and exports events as counters
. Monitoring counters should have the same name, but different tags. Tags should have letters and underscores (no dots).

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *