This repository has been archived by the owner on Jun 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* docs: add docs site * ci(docs): add docs ci * style(docs): remove .docusaurus folder * ci(docs): update ci watching files --------- Co-authored-by: Yuhang Shi <[email protected]> Co-authored-by: darmody <[email protected]>
- Loading branch information
1 parent
1075342
commit 3183280
Showing
44 changed files
with
14,322 additions
and
2,950 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Docs Deployment | ||
|
||
defaults: | ||
run: | ||
working-directory: ./docs | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'docs/**/*' | ||
- '.github/workflows/doc-*' | ||
# Review gh actions docs if you want to further define triggers, paths, etc | ||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
deploy: | ||
name: Deploy to GitHub Pages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: yarn | ||
|
||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
- name: Build website | ||
run: yarn build | ||
|
||
# Popular action to deploy to GitHub Pages: | ||
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus | ||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
# Build output to publish to the `gh-pages` branch: | ||
publish_dir: ./build | ||
# The following lines assign commit authorship to the official | ||
# GH-Actions bot for deploys to `gh-pages` branch: | ||
# https://github.com/actions/checkout/issues/13#issuecomment-724415212 | ||
# The GH actions bot is used by default if you didn't specify the two fields. | ||
# You can swap them out with your own user credentials. | ||
user_name: github-actions[bot] | ||
user_email: 41898282+github-actions[bot]@users.noreply.github.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Docs Build | ||
|
||
defaults: | ||
run: | ||
working-directory: ./docs | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- 'docs/**/*' | ||
- '.github/workflows/doc-*' | ||
# Review gh actions docs if you want to further define triggers, paths, etc | ||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on | ||
|
||
jobs: | ||
test-deploy: | ||
name: Building Docs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: yarn | ||
|
||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
- name: Test build website | ||
run: yarn build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,5 +16,5 @@ CHANGELOG.* | |
dist/ | ||
storybook-static/ | ||
target/ | ||
|
||
docs/**/*.mdx | ||
/tools/helm-charts/**/*.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
root: true | ||
|
||
extends: | ||
- plugin:@pleisto/eslint-plugin/react |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# build | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Flappy Document Site | ||
|
||
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator. | ||
|
||
### Installation | ||
|
||
```bash | ||
yarn | ||
``` | ||
|
||
### Local Development | ||
|
||
```bash | ||
yarn start | ||
``` | ||
|
||
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. | ||
|
||
### Build | ||
|
||
```bash | ||
yarn build | ||
``` | ||
|
||
This command generates static content into the `build` directory and can be served using any static contents hosting service. | ||
|
||
### Deployment | ||
|
||
Using SSH: | ||
|
||
```bash | ||
USE_SSH=true yarn deploy | ||
``` | ||
|
||
Not using SSH: | ||
|
||
```bash | ||
GIT_USER=<Your GitHub username> yarn deploy | ||
``` | ||
|
||
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import Tabs from '@theme/Tabs' | ||
import TabItem from '@theme/TabItem' | ||
|
||
# Code Interpreter | ||
|
||
The Code Interpreter in Flappy serves as an equivalent replacement for [ChatGPT Code Interpreter](https://openai.com/blog/chatgpt-plugins#code-interpreter), enabling the language model to fulfill complex user requirements through Python code. What sets Flappy's Code Interpreter apart from other open-source implementations in the market is its sandboxed safety feature. This ensures that it meets the stringent security needs necessary for deployment in a production environment. | ||
|
||
## How it works | ||
|
||
Flappy's Code Interpreter is built with Rust, featuring a WebAssembly runtime environment that complies with the [WASIX specifications](https://wasix.org/docs/api-reference). Unlike standard WebAssembly runtimes, this environment hosts a Python interpreter and supports nearly all POSIX interfaces, including socket, net, and filesystem IO operations. This means that even though the Python interpreter operates within a wasm sandbox, all functionalities remain fully intact. | ||
|
||
The current version of the Python interpreter used in this environment is `Python 3.12`. All standard libraries (stdlib) work as expected. We are also in the process of adding support for the pip package manager, which will allow for further extension of capabilities. | ||
|
||
## Security-First Design | ||
|
||
Our core design principle is "safety first". By default, access to the external network is off to ensure a secure environment. Similarly, environment variables are sandbox-isolated. However, if required, these settings can be overridden using custom configurations. | ||
|
||
## Usage | ||
|
||
<Tabs> | ||
<TabItem value="nodejs" label="NodeJS (TypeScript)" default> | ||
|
||
```ts | ||
import { env } from 'node:process' | ||
import { createFlappyAgent, ChatGPT } from '@pleisto/node-flappy' | ||
import OpenAI from 'openai' | ||
const gpt35 = new ChatGPT( | ||
new OpenAI({ | ||
apiKey: process.env.OPENAI_API_KEY!, | ||
baseURL: process.env.OPENAI_API_BASE! | ||
}), | ||
'gpt-3.5-turbo' | ||
) | ||
const agent = createFlappyAgent({ | ||
llm: gpt35, | ||
functions: [], | ||
codeInterpreter: { | ||
enableNetwork: true, | ||
env: env as Record<string, string> | ||
} | ||
}) | ||
void agent.callCodeInterpreter( | ||
'There are some rabbits and chickens in a barn. What is the number of chickens if there are 396 legs and 150 heads in the barn?' | ||
) | ||
``` | ||
|
||
</TabItem> | ||
<TabItem value="java" label="Java" default> | ||
Coming soon | ||
</TabItem> | ||
<TabItem value="csharp" label="C#" default> | ||
Coming soon | ||
</TabItem> | ||
</Tabs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Examples | ||
|
||
Our examples are in the GitHub repository, please look for your programming language from the list of links below: | ||
|
||
* [Node.js - TypeScript](https://github.com/pleisto/flappy/tree/main/examples/nodejs) | ||
* [Java](https://github.com/pleisto/flappy/tree/main/examples/java) | ||
* [Kotlin](https://github.com/pleisto/flappy/tree/main/examples/kotlin) | ||
* [C#](https://github.com/pleisto/flappy/tree/main/examples/csharp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
--- | ||
sidebar_position: 1 | ||
slug: / | ||
--- | ||
|
||
# Introduction | ||
|
||
Flappy is a production-ready Language Learning Model (LLM) Application/Agent SDK designed to simplify AI integration in your projects. It is an easy-to-use, universally compatible, and production-ready solution that brings the power of AI to developers regardless of their preferred programming language. | ||
|
||
## Key Features | ||
|
||
- **Ease of Use**: Flappy is designed to be as user-friendly as CRUD application development, minimizing the learning curve for developers new to AI. | ||
- **Production-Ready**: Beyond research, Flappy is a robust SDK that balances cost-efficiency and sandbox security to provide a stable platform for commercial environments. | ||
- **Language-Agnostic**: Flappy integrates seamlessly with any programming language, eliminating the need for Python unless explicitly required by your application. | ||
|
||
## Why Flappy? | ||
|
||
Flappy is your key to unlocking the potential of large language learning models (LLMs) in everyday applications. It's not just about creating new data, but about transforming and synthesizing the existing data for meaningful insights. | ||
|
||
Commercial value of LLMs lies in their application within industry-specific use cases. However, integrating these models into existing business systems is a significant challenge. This is where Flappy shines - acting as a production-ready LLM Agent SDK for every developer. It facilitates the interaction between LLMs and other software systems, ensuring high accuracy and specific output formatting that's crucial for efficient data exchange. | ||
|
||
Flappy is not just about translation. It's about empowerment. It breaks down the high technical barriers, turning extensive and complicated work into streamlined processes. With Flappy, developers without an AI background can integrate AI applications into their software, contributing to the industry-specific application of large models. | ||
|
||
Flappy surpasses alternatives like AutoGPT, TypeChat, and LangChain in delivering production-ready solutions. Designed with real-world applications in mind, Flappy prioritizes safety, cost-effectiveness, robustness, and maintainability. | ||
|
||
In essence, Flappy is more than a tool. It's a revolution in the field of AI, bridging the gap between potential and practical application. It brings the power of AI into the hands of every developer, driving forward AI-driven innovation in a variety of applications. | ||
|
||
Choose Flappy to be part of this revolution, to harness the full potential of AI, and to shape the future of AI together. | ||
|
||
## Core Components | ||
|
||
### Agent Functions | ||
|
||
In Flappy's ecosystem, an agent operates as a versatile conduit for the LLM, performing a variety of tasks such as structuring data, invoking external APIs, or sandboxing LLM-generated Python code as needed. This design philosophy caters to the increasing demand for LLM-based AI applications across various sectors. | ||
|
||
The agent functions in Flappy are built on two foundational types: | ||
|
||
1. **InvokeFunction**: This function allows agents to interact with the environment. It's defined by input and output parameters, facilitating efficient interaction with the LLM. | ||
2. **SynthesizedFunction**: This function is processed by the LLM and only requires the definition of its description and the structure of its inputs and outputs. | ||
|
||
#### Function Implementation Details | ||
|
||
Flappy introduces unique implementation mechanisms to enhance these functions: | ||
|
||
- **Unique JSON Schema Integration**: Users can define abstract classes in their preferred programming language, which Flappy then transforms into JSON Schema schemas. This feature enhances machine readability and interoperability and manages the inputs and outputs of LLMs, providing controlled, consistent, and machine-readable data. | ||
- **AST Parsing**: Flappy performs Abstract Syntax Tree (AST) parsing on the LLM outputs to ensure that the generated JSON data strictly adheres to the defined JSON Schema schema. | ||
|
||
### Code Interpreter | ||
|
||
Flappy's Code Interpreter serves as a secure environment to execute Python or TypeScript code produced by LLMs. It provides a sandboxed safety feature that reduces runtime errors and potential security vulnerabilities, making it suitable for deployment in a production environment. | ||
|
||
### LLM Abstraction Layer | ||
|
||
To enhance the flexibility of application development, Flappy provides an abstraction layer for different LLMs. This feature allows users to easily switch between different LLMs and designate fallback LLMs, ensuring application stability. | ||
|
||
Flappy empowers developers to build LLM-based applications in a language-agnostic way. Start your journey with Flappy today and harness the immense potential of AI in your preferred programming language. | ||
|
||
## Supported LLMs | ||
|
||
- OpenAI ChatGPT & GPT-4 | ||
- HuggingFace Transformers (Llama, mistral, etc.) `Coming Soon` | ||
- Google PaLM2 `Coming Soon` | ||
- Baidu ERNIE `Coming Soon` | ||
- Baichuan-53B `Coming Soon` | ||
- iFly XingHuo `Coming Soon` | ||
- MiniMax `Coming Soon` | ||
|
||
|
||
## Supported Programming Languages | ||
|
||
- Node.js (JavaScript/TypeScript) | ||
- Kotlin & Java | ||
- C# (.NET Core) | ||
- Go `Coming Soon` | ||
- PHP `Coming Soon` | ||
- Ruby `Coming Soon` | ||
- Python `Coming Soon` |
Oops, something went wrong.