Skip to content

A server application that integrates with OpenAI's GPT-4 model to provide chat and function capabilities. It includes endpoints for chat completions, function calls, and text completions.

Notifications You must be signed in to change notification settings

Poly186-AI-DAO/sesap-template-gen-server

 
 

Repository files navigation

Smart Legal Contract Generator

This is a Node.js server that uses the OpenAI API and Accord Project libraries to generate smart legal contracts.

Setup

  1. Clone this repository.
  2. Run npm install to install the necessary packages.
  3. Create a .env file in the root directory and add your OpenAI API key like so: OPENAI_API_KEY=your-api-key-here.
  4. Run npm start to start the server.

Usage

There are several routes you can use to generate different types of smart legal contracts. The body of the request should be a JSON object with the necessary parameters for each contract type.

Error Handling

If an error occurs during the processing of a request, the server will respond with a status code of 500 and a JSON object with an error key and a string value describing the error.

Logging

The server uses the winston library for logging. Logs are printed to the console and also saved to error.log (for error-level logs) and combined.log (for all logs).

Environment Variables

The server uses the dotenv library to load environment variables from a .env file. Currently, the only environment variable is OPENAI_API_KEY, which should be your OpenAI API key.

Future Improvements

  • Add validation to ensure that requests are in the correct format.
  • Add automated tests to catch bugs before they become a problem.

Author

This server is authored by Princeps Polycap.

About

A server application that integrates with OpenAI's GPT-4 model to provide chat and function capabilities. It includes endpoints for chat completions, function calls, and text completions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.6%
  • Dockerfile 0.4%