Skip to content

Commit

Permalink
Merge pull request #25 from IdeaLeap/dev
Browse files Browse the repository at this point in the history
docs: 完善文档
  • Loading branch information
MarleneJiang authored Sep 30, 2023
2 parents 57c154c + 07e9737 commit fca02e2
Show file tree
Hide file tree
Showing 66 changed files with 969 additions and 84 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,15 @@ npm install llm-ops

## 特点

- `工厂模式设计`: 选择LLM-OPS意味着选择了简便与专业!您无需深究复杂的内部结构,只需简单几步,如同开箱即用的神器。
- `低代码开发`: 真正实现了一键式开发。只需简单地编写一段JSON代码,即可轻松实现您所想要的完整业务流程,大大减少了开发难度和学习成本。
- `全面支持TypeScript`: LLM-OPS框架不仅基于TypeScript开发,更为开发者提供了完整的TsDoc注释。这让您在开发过程中更加流畅,无需反复查询文档,一切都变得清晰明了。
- `AI制作的Workflow引擎`: 无论是构建复杂的企业应用还是快速打造创新项目,LLM-OPS都能为您提供稳定而高效的工作流引擎,真正做到快速开发,快速上线!
- `工厂模式设计`: 选择LLM-OPS意味着选择了简便与专业!您无需深究复杂的内部结构,只需简单几步,如同开箱即用的神器。
- `低代码开发`: 真正实现了一键式开发。只需简单地编写一段JSON代码,即可轻松实现您所想要的完整业务流程,大大减少了开发难度和学习成本。
- `全面支持TypeScript`: LLM-OPS框架不仅基于TypeScript开发,更为开发者提供了完整的TsDoc注释。这让您在开发过程中更加流畅,无需反复查询文档,一切都变得清晰明了。
- `AI制作的Workflow引擎`: 无论是构建复杂的企业应用还是快速打造创新项目,LLM-OPS都能为您提供稳定而高效的工作流引擎,真正做到快速开发,快速上线!

## 低代码workflow示意图

![pipeline示意图](https://github.com/IdeaLeap/llm-ops/assets/49270362/489d25cd-bc71-44b1-8a89-027075e3fec2)


## 使用例程

```ts
Expand Down Expand Up @@ -87,6 +86,7 @@ const res = (await pipeline.execute(
)) as Record<string, any>;
console.log(JSON.stringify(res["subsection"]));
```

## 框架设计结构

![框架设计结构](https://github.com/IdeaLeap/llm-ops/assets/49270362/8834cba4-b055-41a0-a73d-f2c3346b23c5)
Expand Down
63 changes: 62 additions & 1 deletion docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,69 @@ export default defineConfig({
lang: "zh-CN",
lastUpdated: true,
markdown: { attrs: { disable: true } },
head: [
[
"script",
{
async: "async",
src: "https://umami.marlene.top/umami.js",
"data-website-id": "8082e8f8-4d08-46ac-b089-bd883ab4c637",
"data-domains": "ops.idealeap.cn,preview.idealeap.cn",
},
],
["link", { rel: "icon", href: "/favicon.ico" }],
["meta", { name: "description", content: "LLM-OPS" }],
["meta", { property: "og:url", content: "https://ops.idealeap.cn/" }],
["meta", { property: "og:type", content: "website" }],
["meta", { property: "og:title", content: "LLM-OPS | IdeaLeap" }],
["meta", { property: "og:description", content: "LLM-OPS" }],
["meta", { property: "og:image", content: "/og.jpg" }],
["meta", { name: "twitter:card", content: "summary_large_image" }],
[
"meta",
{
property: "twitter:domain",
content: "助力AIGC落地应用、高效开发llm workflow的低代码TS框架",
},
],
["meta", { property: "twitter:url", content: "https://ops.idealeap.cn/" }],
["meta", { name: "twitter:title", content: "HDU-CS-WIKI | HDU-CS-WIKI" }],
["meta", { name: "twitter:description", content: "LLM-OPS" }],
["meta", { name: "twitter:image", content: "/og.jpg" }],
[
"link",
{
rel: "apple-touch-icon",
sizes: "180x180",
href: "/apple-touch-icon.png",
},
],
[
"link",
{
rel: "icon",
type: "image/png",
sizes: "32x32",
href: "/favicon-32x32.png",
},
],
[
"link",
{
rel: "icon",
type: "image/png",
sizes: "16x16",
href: "/favicon-16x16.png",
},
],
["link", { rel: "manifest", href: "/site.webmanifest" }],
[
"link",
{ rel: "mask-icon", href: "/safari-pinned-tab.svg", color: "#5bbad5" },
],
["meta", { name: "msapplication-TileColor", content: "#2b5797" }],
],
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: "Home", link: "/" },
{ text: "Guide", link: "/guide/" },
Expand Down
4 changes: 2 additions & 2 deletions docs/api/llm-ops.chain._constructor_.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## Chain.(constructor)

Constructs a new instance of the `Chain` class
创建一个新的 `Chain` 实例。

**Signature:**

Expand All @@ -16,5 +16,5 @@ constructor(params: chainSchema);

| Parameter | Type | Description |
| --- | --- | --- |
| params | [chainSchema](./llm-ops.chainschema.md) | |
| params | [chainSchema](./llm-ops.chainschema.md) | 构造函数的参数对象。 |

6 changes: 5 additions & 1 deletion docs/api/llm-ops.chain.call.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## Chain.call() method

调用Chain

**Signature:**

```typescript
Expand All @@ -14,9 +16,11 @@ call(params: chainCallSchema): Promise<import("llm-ops/utils").Result<any>>;

| Parameter | Type | Description |
| --- | --- | --- |
| params | [chainCallSchema](./llm-ops.chaincallschema.md) | |
| params | [chainCallSchema](./llm-ops.chaincallschema.md) | 调用方法的参数对象。 |

**Returns:**

Promise&lt;import("llm-ops/utils").[Result](./llm-ops.result.md)<!-- -->&lt;any&gt;&gt;

{<!-- -->Promise<any>} 返回异步处理的链调用结果。

4 changes: 4 additions & 0 deletions docs/api/llm-ops.chain.exporthistory.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## Chain.exportHistory() method

导出链的历史记录。

**Signature:**

```typescript
Expand All @@ -13,3 +15,5 @@ exportHistory(): import("llm-ops/llm/index").messagesType;

import("llm-ops/llm/index").[messagesType](./llm-ops.messagestype.md)

{<!-- -->any<!-- -->} 返回链的历史记录。

8 changes: 5 additions & 3 deletions docs/api/llm-ops.chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## Chain class

`Chain` 类用于`llm`<!-- -->类的格式化输出。

**Signature:**

```typescript
Expand All @@ -14,7 +16,7 @@ export declare class Chain

| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(params)](./llm-ops.chain._constructor_.md) | | Constructs a new instance of the <code>Chain</code> class |
| [(constructor)(params)](./llm-ops.chain._constructor_.md) | | 创建一个新的 <code>Chain</code> 实例。 |

## Properties

Expand All @@ -28,6 +30,6 @@ export declare class Chain

| Method | Modifiers | Description |
| --- | --- | --- |
| [call(params)](./llm-ops.chain.call.md) | | |
| [exportHistory()](./llm-ops.chain.exporthistory.md) | | |
| [call(params)](./llm-ops.chain.call.md) | | 调用Chain |
| [exportHistory()](./llm-ops.chain.exporthistory.md) | | 导出链的历史记录。 |

4 changes: 4 additions & 0 deletions docs/api/llm-ops.chaincallschema.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

## chainCallSchema interface

`Chain`<!-- -->类的`call`<!-- -->方法的参数数据结构。

{<!-- -->messageType \| string<!-- -->} request - 请求消息或字符串。 {<!-- -->messageType\[\]<!-- -->} \[prompt\] - 一个可选的消息提示数组。 {<!-- -->structSchema<!-- -->} \[struct\] - 一个可选的结构模式。 {<!-- -->boolean<!-- -->} \[verbose\] - 一个可选的详细模式标志。

**Signature:**

```typescript
Expand Down
4 changes: 4 additions & 0 deletions docs/api/llm-ops.chainschema.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

## chainSchema interface

`Chain` 构造函数的参数数据结构。

{<!-- -->LLM<!-- -->} \[llm\] - 一个可选的LLM实例。 {<!-- -->createLLMSchema<!-- -->} \[llmSchema\] - 一个可选的LLM模式对象。 {<!-- -->string<!-- -->} \[chainName\] - 一个可选的链名称。

**Signature:**

```typescript
Expand Down
2 changes: 2 additions & 0 deletions docs/api/llm-ops.chatcompletiontype.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## chatCompletionType type

OpenAI聊天完成类型

**Signature:**

```typescript
Expand Down
2 changes: 2 additions & 0 deletions docs/api/llm-ops.chatparamstype.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## chatParamsType type

OpenAI聊天参数类型

**Signature:**

```typescript
Expand Down
4 changes: 3 additions & 1 deletion docs/api/llm-ops.chatschema.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## ChatSchema interface

聊天参数接口

**Signature:**

```typescript
Expand All @@ -16,5 +18,5 @@ export interface ChatSchema
| --- | --- | --- | --- |
| [function\_call?](./llm-ops.chatschema.function_call.md) | | [function\_callType](./llm-ops.function_calltype.md) | _(Optional)_ |
| [functions?](./llm-ops.chatschema.functions.md) | | [functionsType](./llm-ops.functionstype.md) | _(Optional)_ |
| [messages](./llm-ops.chatschema.messages.md) | | [messagesType](./llm-ops.messagestype.md) | |
| [messages](./llm-ops.chatschema.messages.md) | | [messagesType](./llm-ops.messagestype.md) | 消息数组 |

2 changes: 2 additions & 0 deletions docs/api/llm-ops.chatschema.messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## ChatSchema.messages property

消息数组

**Signature:**

```typescript
Expand Down
2 changes: 2 additions & 0 deletions docs/api/llm-ops.createllmschema.helicone_auth_api_key.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## createLLMSchema.HELICONE\_AUTH\_API\_KEY property

Helicone授权API密钥

**Signature:**

```typescript
Expand Down
8 changes: 5 additions & 3 deletions docs/api/llm-ops.createllmschema.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## createLLMSchema interface

创建LLM的参数接口

**Signature:**

```typescript
Expand All @@ -16,10 +18,10 @@ export interface createLLMSchema
| --- | --- | --- | --- |
| [cache?](./llm-ops.createllmschema.cache.md) | | boolean | _(Optional)_ |
| [choice\_num?](./llm-ops.createllmschema.choice_num.md) | | number \| 1 | _(Optional)_ |
| [HELICONE\_AUTH\_API\_KEY?](./llm-ops.createllmschema.helicone_auth_api_key.md) | | string | _(Optional)_ |
| [HELICONE\_AUTH\_API\_KEY?](./llm-ops.createllmschema.helicone_auth_api_key.md) | | string | _(Optional)_ Helicone授权API密钥 |
| [history?](./llm-ops.createllmschema.history.md) | | [messagesType](./llm-ops.messagestype.md) | _(Optional)_ |
| [modelName?](./llm-ops.createllmschema.modelname.md) | | (string &amp; object) \| "gpt-4" \| "gpt-4-0314" \| "gpt-4-0613" \| "gpt-4-32k" \| "gpt-4-32k-0314" \| "gpt-4-32k-0613" \| "gpt-3.5-turbo" \| "gpt-3.5-turbo-16k" \| "gpt-3.5-turbo-0301" \| "gpt-3.5-turbo-0613" \| "gpt-3.5-turbo-16k-0613" | _(Optional)_ |
| [OPENAI\_API\_KEY?](./llm-ops.createllmschema.openai_api_key.md) | | string | _(Optional)_ |
| [modelName?](./llm-ops.createllmschema.modelname.md) | | (string &amp; object) \| "gpt-4" \| "gpt-4-0314" \| "gpt-4-0613" \| "gpt-4-32k" \| "gpt-4-32k-0314" \| "gpt-4-32k-0613" \| "gpt-3.5-turbo" \| "gpt-3.5-turbo-16k" \| "gpt-3.5-turbo-0301" \| "gpt-3.5-turbo-0613" \| "gpt-3.5-turbo-16k-0613" | _(Optional)_ 模型名称选项 |
| [OPENAI\_API\_KEY?](./llm-ops.createllmschema.openai_api_key.md) | | string | _(Optional)_ OpenAI API密钥 |
| [stop?](./llm-ops.createllmschema.stop.md) | | string \| null \| string\[\] | _(Optional)_ |
| [temperature?](./llm-ops.createllmschema.temperature.md) | | number | _(Optional)_ |
| [tokens?](./llm-ops.createllmschema.tokens.md) | | number | _(Optional)_ |
Expand Down
2 changes: 2 additions & 0 deletions docs/api/llm-ops.createllmschema.modelname.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## createLLMSchema.modelName property

模型名称选项

**Signature:**

```typescript
Expand Down
2 changes: 2 additions & 0 deletions docs/api/llm-ops.createllmschema.openai_api_key.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## createLLMSchema.OPENAI\_API\_KEY property

OpenAI API密钥

**Signature:**

```typescript
Expand Down
16 changes: 16 additions & 0 deletions docs/api/llm-ops.formatprompttemplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,24 @@

## formatPromptTemplate variable

格式化提示模板函数。

此函数的主要目的是为了从提供的`prompts`<!-- -->对象中提取出一个格式化的提示模板。 这可以是一个单一的模板,也可以是一个模板数组。

**Signature:**

```typescript
formatPromptTemplate: (prompts: PromptsSchema) => Promise<(import("openai/resources/chat").ChatCompletionMessageParam | MultiPromptSchema | undefined)[]>
```

## Example


```typescript
const promptsData = {
name: "agentPromptTemplate",
schema: { role: "user" },
};
const formattedPrompts = await formatPromptTemplate(promptsData);
```

2 changes: 2 additions & 0 deletions docs/api/llm-ops.function_calltype.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## function\_callType type

function\_call类型

**Signature:**

```typescript
Expand Down
2 changes: 2 additions & 0 deletions docs/api/llm-ops.functioncalloption.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## FunctionCallOption interface

FunctionCall的接口

**Signature:**

```typescript
Expand Down
2 changes: 2 additions & 0 deletions docs/api/llm-ops.functionstype.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## functionsType type

FunctionInterface类型数组

**Signature:**

```typescript
Expand Down
4 changes: 2 additions & 2 deletions docs/api/llm-ops.llm._constructor_.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## LLM.(constructor)

Constructs a new instance of the `LLM` class
构造一个LLM客户端实例。

**Signature:**

Expand All @@ -16,5 +16,5 @@ constructor(params: createLLMSchema);

| Parameter | Type | Description |
| --- | --- | --- |
| params | [createLLMSchema](./llm-ops.createllmschema.md) | |
| params | [createLLMSchema](./llm-ops.createllmschema.md) | 包含创建LLM客户端所需的参数。 |

6 changes: 5 additions & 1 deletion docs/api/llm-ops.llm.chat.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## LLM.chat() method

使用LLM进行聊天。

**Signature:**

```typescript
Expand All @@ -14,9 +16,11 @@ chat(params: ChatSchema): Promise<chatCompletionType>;

| Parameter | Type | Description |
| --- | --- | --- |
| params | [ChatSchema](./llm-ops.chatschema.md) | |
| params | [ChatSchema](./llm-ops.chatschema.md) | 包含聊天所需的参数。 |

**Returns:**

Promise&lt;[chatCompletionType](./llm-ops.chatcompletiontype.md)<!-- -->&gt;

返回聊天的完成信息。

Loading

0 comments on commit fca02e2

Please sign in to comment.