langscript

所属分类:自然语言处理
开发工具:Python
文件大小:33KB
下载次数:0
上传日期:2023-05-16 10:08:04
上 传 者sh-1993
说明:  用LLM和AutoGPT实现真正的自然语言编程
(The true Natural-language programming with LLM and AutoGPT)

文件列表:
CONTRIBUTING.md (3637, 2023-05-16)
Containerfile (85, 2023-05-16)
LICENSE (1211, 2023-05-16)
MANIFEST.in (86, 2023-05-16)
Makefile (4380, 2023-05-16)
docs (0, 2023-05-16)
docs\concept.md (21231, 2023-05-16)
docs\index.md (491, 2023-05-16)
examples (0, 2023-05-16)
examples\branch.ls (2768, 2023-05-16)
examples\codegen-zh.ls (1087, 2023-05-16)
examples\codegen.ls (1123, 2023-05-16)
examples\create-a-book-ch.ls (1349, 2023-05-16)
examples\hello-world.ls (53, 2023-05-16)
examples\import.ls (220, 2023-05-16)
langscript (0, 2023-05-16)
langscript\VERSION (6, 2023-05-16)
langscript\__init__.py (0, 2023-05-16)
langscript\__main__.py (136, 2023-05-16)
langscript\agent.py (1244, 2023-05-16)
langscript\cli.py (1342, 2023-05-16)
langscript\parser.py (240, 2023-05-16)
mkdocs.yml (41, 2023-05-16)
... ...

# langscript [![codecov](https://codecov.io/gh/yunwei37/langscript/branch/main/graph/badge.svg?token=langscript_token_here)](https://codecov.io/gh/yunwei37/langscript) [![CI](https://github.com/yunwei37/langscript/actions/workflows/main.yml/badge.svg)](https://github.com/yunwei37/langscript/actions/workflows/main.yml)


The true natural language programing script.

No grammar, no syntax, no rules, no limits, Just write what you want to do in complex instructions.

Take action with LLM, and have better control than AutoGPT.

## examples Hello World: ``` Say hello world to our friends to the outside world! ``` Loop: ``` Here is a sentence, "Hello World ". I want you to add a "hello " to the end of the sentence above, and print it out. I want the above instructions to be executed 10 times, and you give me the output. ``` if else: ``` It was Monday the day before yesterday, you went to the supermarket and bought an apple. You have it in your hands today. If it's Tuesday today, tell the output "yes", and ignore the following instructions. else, read the "Disclaimer of AutoGPT", summary it in Chinese, You can call the summary "Chinese Disclaimer of AutoGPT summary". ``` Create a function or task to do something, and call it: ``` Sure! Here are the revised instructions in English: I have a task for you called "Translate and Create Novel Chapters Based on an Outline." I will provide you with the chapter outline and background information. Your task is to: 1. Write the content of the chapter based on the outline and background information provided. 2. Translate the chapter content into English. The translation should be of high quality and exhibit excellent writing style. Now, translate and Create Novel Chapters Based on the Outline "Chapter 1: The Beginning of the End" ``` import a module or use the specify functionality, like file system and network: ``` I want you to access my file system and network. Now, search for the news for AI and MLtell me the one you think is the most interesting. translate it into Chinese and save it to "interesting.txt" in my file system. ``` A more complex example to write a Project code: ``` I have a task for you called "Write Project Code." In order to write a single module, we need to know the project's directory structure, the requirements for each module, and the overall project requirements. When writing a module, follow these steps: 1. Perform requirement analysis to help clarify the corresponding requirements. You can write a paragraph outlining the requirements. 2. Present the written requirements to me for confirmation. Once I approve them, we can proceed to the next step. 3. Divide the project into modules and units, and further design the corresponding technical approach. 4. Based on the technical approach, build a code framework and execute the necessary commands in the command line to create a project. 5. Next, perform the task "Write Code for a Single Module" for each module. 6. Finally, once all modules have been written, conduct integration testing to ensure the overall functionality of the project. Please note that during the process, it's important to write unit tests for each module and ensure they pass before moving on. Now, please write code to build a website for the langscript project. ``` ## Install it from PyPI ```bash pip install langscript ``` ## Usage Setup your OpenAI API key: ```bash export OPENAI_API_KEY="..." ``` Using it in your script: ```py from langscript import BaseClass from langscript import base_function BaseClass().base_method() base_function() ``` Run from bash: ```bash $ python -m langscript yourscript.ls #or $ langscript yourscript.ls ``` ## Development Read the [CONTRIBUTING.md](CONTRIBUTING.md) file.

近期下载者

相关文件


收藏者