From 07e0d5014b1b97dd8a58bd2835a5d9b673e3066a Mon Sep 17 00:00:00 2001 From: Riceball LEE Date: Wed, 25 Sep 2024 20:47:48 +0800 Subject: [PATCH] docs: udpate readme --- README.cn.md | 11 ++++++++ README.md | 78 ++++++++++++++++++++++++++++++++++------------------ 2 files changed, 62 insertions(+), 27 deletions(-) diff --git a/README.cn.md b/README.cn.md index 4792f42..4221116 100644 --- a/README.cn.md +++ b/README.cn.md @@ -44,6 +44,17 @@ AI Agent 脚本引擎特点: * [PPE 的 智能编程指南](./lib/guide/) * 在项目根目录下运行 `ai run guide --streamEcho line` 来启动指南 * [人工智能终端 shell](https://github.com/offline-ai/ai-shell) +* LLM 推理提供者: + * `llamacpp`: llama.cpp server 作为默认的本地 LLM 提供者. 如果没有提供`provider`,就是`llamacpp` + * `openai`: 也支持 OpenAI兼容 服务 API 提供者. + * `--provider openai://chatgpt-4o-latest --apiKey “sk-XXX”` + +注意: OpenAI兼容 服务 API 提供者的限制 + +1. OpenAI 必须是`gpt-4o` `2024-07-18`之后的大模型才支持(json-schema)。在此之前,仅能保证 `json` 支持,无法保证schema. +2. `siliconflow` 的所有模型只保证json,不保证schema. + * `--provider openai://Qwen/Qwen2.5-Coder-7B-Instruct -u https://api.siliconflow.cn/ --apiKey “sk-XXX” ...` +3. `[[Fruit:|Apple|Banana]]`: 让AI强制单选或多选语法,将失效 ### Install diff --git a/README.md b/README.md index 8f6b36d..585b68d 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,16 @@ Developing an intelligent application with AI Agent Script Engine involves just * [AI Guide App For PPE Guide](./lib/guide/) - WIP * `ai run guide --streamEcho line` in the project root folder to run the guide * [AI Terminal Shell](https://github.com/offline-ai/ai-shell) +* LLM Inference Providers: + * `llamacpp`: llama.cpp server as the default local LLM provider. If no `provider` is specified, `llamacpp` is used. + * `openai`: Also supports OpenAI-compatible service API providers. + * `--provider openai://chatgpt-4o-latest --apiKey “sk-XXX”` + +Note: Limitations of OpenAI-Compatible Service API Providers + +1. OpenAI must be a large model (`gpt-4o`) released after `2024-07-18` to support `json-schema`. Before this date, only `json` is guaranteed, not the `json-schema`. +2. All `siliconflow` models only guarantee `json` support, not `json-schema` support. +3. `[[Fruit:|Apple|Banana]]`: Syntax for forcing AI to choose either Apple or Banana will be invalid. ## [PPE CLI Command](./lib/guide/cli.md) @@ -171,7 +181,7 @@ $ npm install -g @offline-ai/cli $ ai COMMAND running command... $ ai (--version) -@offline-ai/cli/0.5.6 linux-x64 node-v20.17.0 +@offline-ai/cli/0.5.7 linux-x64 node-v20.17.0 $ ai --help [COMMAND] USAGE $ ai COMMAND @@ -349,31 +359,45 @@ Specific script instruction manual see: [Programmable Prompt Engine Specificatio # Commands -* [`ai agent`](#ai-agent) -* [`ai autocomplete [SHELL]`](#ai-autocomplete-shell) -* [`ai brain [NAME]`](#ai-brain-name) -* [`ai brain dn [NAME]`](#ai-brain-dn-name) -* [`ai brain down [NAME]`](#ai-brain-down-name) -* [`ai brain download [NAME]`](#ai-brain-download-name) -* [`ai brain list [NAME]`](#ai-brain-list-name) -* [`ai brain refresh`](#ai-brain-refresh) -* [`ai brain search [NAME]`](#ai-brain-search-name) -* [`ai config [ITEM_NAME]`](#ai-config-item_name) -* [`ai config save [DATA]`](#ai-config-save-data) -* [`ai help [COMMAND]`](#ai-help-command) -* [`ai plugins`](#ai-plugins) -* [`ai plugins add PLUGIN`](#ai-plugins-add-plugin) -* [`ai plugins:inspect PLUGIN...`](#ai-pluginsinspect-plugin) -* [`ai plugins install PLUGIN`](#ai-plugins-install-plugin) -* [`ai plugins link PATH`](#ai-plugins-link-path) -* [`ai plugins remove [PLUGIN]`](#ai-plugins-remove-plugin) -* [`ai plugins reset`](#ai-plugins-reset) -* [`ai plugins uninstall [PLUGIN]`](#ai-plugins-uninstall-plugin) -* [`ai plugins unlink [PLUGIN]`](#ai-plugins-unlink-plugin) -* [`ai plugins update`](#ai-plugins-update) -* [`ai run [FILE] [DATA]`](#ai-run-file-data) -* [`ai test`](#ai-test) -* [`ai version`](#ai-version) +- [Offline AI PPE CLI(WIP)](#offline-ai-ppe-cliwip) +- [Quick Start](#quick-start) + - [PPE CLI Command](#ppe-cli-command) + - [Programmable Prompt Engine Language](#programmable-prompt-engine-language) + - [I. Core Structure](#i-core-structure) + - [II. Reusability \& Configuration](#ii-reusability--configuration) + - [III. AI Capabilities](#iii-ai-capabilities) + - [IV. Message Text Formatting](#iv-message-text-formatting) + - [V. Script Capabilities](#v-script-capabilities) + - [Install](#install) + - [Run](#run) +- [Usage](#usage) +- [Commands](#commands) + - [`ai agent`](#ai-agent) + - [`ai autocomplete [SHELL]`](#ai-autocomplete-shell) + - [`ai brain [NAME]`](#ai-brain-name) + - [`ai brain dn [NAME]`](#ai-brain-dn-name) + - [`ai brain down [NAME]`](#ai-brain-down-name) + - [`ai brain download [NAME]`](#ai-brain-download-name) + - [`ai brain list [NAME]`](#ai-brain-list-name) + - [`ai brain refresh`](#ai-brain-refresh) + - [`ai brain search [NAME]`](#ai-brain-search-name) + - [`ai config [ITEM_NAME]`](#ai-config-item_name) + - [`ai config save [DATA]`](#ai-config-save-data) + - [`ai help [COMMAND]`](#ai-help-command) + - [`ai plugins`](#ai-plugins) + - [`ai plugins add PLUGIN`](#ai-plugins-add-plugin) + - [`ai plugins:inspect PLUGIN...`](#ai-pluginsinspect-plugin) + - [`ai plugins install PLUGIN`](#ai-plugins-install-plugin) + - [`ai plugins link PATH`](#ai-plugins-link-path) + - [`ai plugins remove [PLUGIN]`](#ai-plugins-remove-plugin) + - [`ai plugins reset`](#ai-plugins-reset) + - [`ai plugins uninstall [PLUGIN]`](#ai-plugins-uninstall-plugin) + - [`ai plugins unlink [PLUGIN]`](#ai-plugins-unlink-plugin) + - [`ai plugins update`](#ai-plugins-update) + - [`ai run [FILE] [DATA]`](#ai-run-file-data) + - [`ai test`](#ai-test) + - [`ai version`](#ai-version) +- [Credit](#credit) ## `ai agent` @@ -401,7 +425,7 @@ EXAMPLES $ ai agent publish ``` -_See code: [src/commands/agent/index.ts](https://github.com/offline-ai/cli/blob/v0.5.6/src/commands/agent/index.ts)_ +_See code: [src/commands/agent/index.ts](https://github.com/offline-ai/cli/blob/v0.5.7/src/commands/agent/index.ts)_ ## `ai autocomplete [SHELL]`