Giter VIP home page Giter VIP logo

json-translator's Introduction

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...) in .env.local:

cp .env.template .env.local

Second, import the conf/db/nts.sql into your database.

At last, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev

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

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"
}'
  • /api/endpoint/[id]
curl -X 'POST' 'http://127.0.0.1:3000/api/endpoint/2dafcb4800ec144356799d5f4da07f32' \
  -H 'Content-Type: application/json' \
  -d '{"prompt": "it is very rainy outside"}'

json-translator's People

Contributors

weykon avatar yanxiyue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

json-translator's Issues

Input text field cursor position wrong

image

This image shows that his cursor is not properly aligned with the text

Recurrent
This problem may occur when the height of the entered text exceeds the existing height of the current view.

I'll try to fix it myself later and give you a PR

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.