promptlang

所属分类:自然语言处理
开发工具:JavaScript
文件大小:127KB
下载次数:0
上传日期:2023-04-10 01:21:24
上 传 者sh-1993
说明:  一种用于提示LLM的迷你编程语言
(A mini programming language for prompting LLMs)

文件列表:
.env.example (23, 2023-04-10)
examples (0, 2023-04-10)
examples\helloworld (0, 2023-04-10)
examples\helloworld\helloworld.prompt (153, 2023-04-10)
examples\helloworld\use_prompt.js (850, 2023-04-10)
examples\helloworld\use_prompt.py (723, 2023-04-10)
examples\latex (0, 2023-04-10)
examples\latex\latex.prompt (666, 2023-04-10)
header.png (141695, 2023-04-10)
package.json (302, 2023-04-10)
parser.js (2958, 2023-04-10)

# Prompt Lang ![PromptLang Header](https://github.com/generative-magic/promptlang/blob/master/header.png) What if there was a programming language for writing prompts? This is an experiment see what a prompt language could feel like. Workflow: 1. Write a prompt file and specify the prompt and prompt configurations. ```helloworld.prompt temperature = 0 max_token = 1000 HelloWorld. Write a website using HTML and CSS that says hello world. ``` 2. Run parser.js to parse the `helloworld.prompt` file and generate helper functions to use in Javascript and Python. ``` node parser.js ``` 3. Set your .env file with your openai API key and run the generated prompt helpers ``` node examples/helloworld/use_prompt.js python examples/helloworld/use_prompt.py ``` Imagine if we could extend this simple example and fully extract all the logic from working with LLMs into just one prompt file that could look like something below. Imagine if the parser could just generate langchain code or even more fully formed projects. That way, LLMs would just need to learn how to write prompts and then use a parser like this to execute it. ```latex.prompt # Converts a user input into latex code ## LATEXIFIER temperature = 0 max_token = 1000 PROMPT=string // Initial instructions You convert English into LaTeX. // Examples Here are some examples: English: Create a document LaTeX: \documentclass{article} \begin{document} First document. This is a simple example, with no extra parameters or packages included. \end{document} English: {PROMPT} LaTeX: You convert English into LaTeX. For example: LOOP($:EXAMPLES) English: $:PROMPT LaTeX: output:string ```

近期下载者

相关文件


收藏者