pentium100 / json-translator

Make LLM as an API server

Home Page:https://nts.cooder.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Json Translator

Translate the input of natural language into a specified structure.

Online Demo

https://nts.cooder.org/

Getting Started

First, copy .env.template to .env.local, and set your environment variable(OpenAI API key、google sheets key...) in .env.local:

cp .env.template .env.local

Then, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev

Open http://localhost:3000 with your browser to see the result.

Deploy on Vercel

Deploy with Vercel

API ENDPOINT

  • /api/translate
curl -X 'POST' \
  'http://127.0.0.1:3000/api/translate' \
  -H 'accept: */*' \
  -H 'Content-Type: application/json' \
  -d '{
  "schema": "// The following is a schema definition for determining whether a user wants to share a post or not:\nexport interface ShareOrNot {\nisShare: boolean;\nurl: string;\ncomment: string;\n}",
  "typeName": "ShareOrNot",
  "prompt": "https://github.com/shengxia/RWKV_Role_Playing_API 一个基于Flask实现的RWKV角色扮演API"
}'

About

Make LLM as an API server

https://nts.cooder.org


Languages

Language:TypeScript 93.6%Language:JavaScript 3.5%Language:CSS 2.9%