From 86eb3358b715682af82209ffa8d50e8b1b82a411 Mon Sep 17 00:00:00 2001 From: contrun Date: Wed, 29 Nov 2023 10:14:41 +0800 Subject: [PATCH] docs: fix a few typos; polish the language (#150) --- README.md | 12 ++++++------ docs/docs/introduction.mdx | 2 +- packages/rust-core/java/src/lib.rs | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 5f4b7c81..17680d03 100644 --- a/README.md +++ b/README.md @@ -37,20 +37,20 @@ Flappy is a production-ready Language Language Model (LLM) Application/Agent SDK ### Agent Features -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. +In Flappy's ecosystem, an agent operates as a versatile conduit for the LLM, performing a variety of tasks such as ETL data, invoking external APIs, or running LLM-generated Python code in a sandbox when needed. This design philosophy caters to the increasing demand for LLM-based AI applications across various sectors. -The agent features in Flappy are built on two foundational types: +The agent features in Flappy are built on three foundational types: -1. **InvokeFunction**: This feature allows agents to interact with the environment. It's defined by input and output parameters, facilitating efficient interaction with the LLM. -2. **SynthesizedFunction**: This feature is processed by the LLM and only requires the definition of its description and the structure of its inputs and outputs. +1. **InvokeFunction**: This feature allows agents to interact with the environment. Users should implement these functions with pre-defined input and output parameters, facilitating efficient interaction of LLM and real world data. +2. **SynthesizedFunction**: This feature is processed by the LLM and only requires the definition of its description and the data structure declaration of the input and output types. 3. **CodeInterpreter** This feature allows agents to eval python code produced by LLMs in a safe sandbox that reduces runtime errors and potential security vulnerabilities, making it suitable for deployment in a production environment. #### 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. +- **Unique JSON Schema Integration**: Users can define abstract classes in their preferred programming language, which is then transformed into JSON Schema schemas by Flappy. 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. ### LLM Abstraction Layer diff --git a/docs/docs/introduction.mdx b/docs/docs/introduction.mdx index 4dd9d6f3..42edb120 100644 --- a/docs/docs/introduction.mdx +++ b/docs/docs/introduction.mdx @@ -33,7 +33,7 @@ Choose Flappy to be part of this revolution, to harness the full potential of AI 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: +The agent functions in Flappy are built on three 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. diff --git a/packages/rust-core/java/src/lib.rs b/packages/rust-core/java/src/lib.rs index 4fd05daa..bf41973e 100644 --- a/packages/rust-core/java/src/lib.rs +++ b/packages/rust-core/java/src/lib.rs @@ -34,7 +34,7 @@ thread_local! { /// # Safety /// -/// This function could be only called by java vm when load this lib. +/// This function could be only called by java vm when loading this lib. #[no_mangle] pub unsafe extern "system" fn JNI_OnLoad(vm: JavaVM, _: *mut c_void) -> jint { RUNTIME @@ -58,7 +58,7 @@ pub unsafe extern "system" fn JNI_OnLoad(vm: JavaVM, _: *mut c_void) -> jint { /// # Safety /// -/// This function could be only called by java vm when unload this lib. +/// This function could be only called by java vm when unloading this lib. #[no_mangle] pub unsafe extern "system" fn JNI_OnUnload(_: JavaVM, _: *mut c_void) { if let Some(r) = RUNTIME.take() { @@ -68,7 +68,7 @@ pub unsafe extern "system" fn JNI_OnUnload(_: JavaVM, _: *mut c_void) { /// # Safety /// -/// This function could be only when the lib is loaded and within a RUNTIME-spawned thread. +/// This function could be only called when the lib is loaded and within a RUNTIME-spawned thread. unsafe fn get_current_env<'local>() -> JNIEnv<'local> { let env = ENV.with(|cell| *cell.borrow_mut()).unwrap(); JNIEnv::from_raw(env).unwrap() @@ -76,7 +76,7 @@ unsafe fn get_current_env<'local>() -> JNIEnv<'local> { /// # Safety /// -/// This function could be only when the lib is loaded. +/// This function could be only called when the lib is loaded. unsafe fn get_global_runtime<'local>() -> &'local Runtime { RUNTIME.get_unchecked() }