mirror of
https://github.com/velocitatem/raccoon.git
synced 2026-05-31 08:43:36 +00:00
First stuff
This commit is contained in:
25
server.js
Normal file
25
server.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const { OpenAILLM, SuppresServer, DataGenerator } = require('ai.suppress.js');
|
||||
const config = require('./config.json');
|
||||
const server = new SuppresServer();
|
||||
const llm = new OpenAILLM(config.key);
|
||||
|
||||
const prompt = "{introduction}\nBased on the above introduction, list the following information: Name, Age and Location:";
|
||||
|
||||
|
||||
server.createEndpoint(
|
||||
"/new/person/:introduction",
|
||||
"GET",
|
||||
new DataGenerator(prompt, null, llm).set({doFormat: false}));
|
||||
|
||||
let prompt1 =
|
||||
`Predict the capital of a country.
|
||||
|
||||
Country: {country}
|
||||
Capital:`
|
||||
|
||||
server.createEndpoint(
|
||||
"/capital/:country",
|
||||
"GET",
|
||||
new DataGenerator(prompt1, null, llm).set({doFormat: false}));
|
||||
|
||||
server.start(3042);
|
||||
Reference in New Issue
Block a user