Skip to content

Commit

Permalink
Merge pull request #17 from IdeaLeap/dev
Browse files Browse the repository at this point in the history
feat: 工厂模式
  • Loading branch information
MarleneJiang authored Sep 23, 2023
2 parents c8ba3da + 8cfb12b commit a5caadc
Show file tree
Hide file tree
Showing 290 changed files with 4,813 additions and 464 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = {
"plugin:@typescript-eslint",
],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
plugins: ["@typescript-eslint", "eslint-plugin-tsdoc"],
overrides: [
{
files: ["*.js"],
Expand Down Expand Up @@ -46,5 +46,6 @@ module.exports = {
"no-debugger": 0,
"@typescript-eslint/no-unsafe-member-access": 0,
"@typescript-eslint/no-unsafe-return": 0,
"tsdoc/syntax": "warn",
},
};
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.json linguist-language=JSON-with-Comments
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,7 @@ docs/.vitepress/cache
.pnp.*
package-lock.json
.DS_Store

temp/
etc/
package/tsdoc-metadata.json
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"source.fixAll": true
},
"eslint.enable": true,
"jest.autoRun": "off"
"jest.autoRun": "off",
"files.associations": { "*.json": "jsonc" }
}
399 changes: 399 additions & 0 deletions api-extractor.json

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion build
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,9 @@ npm exec prettier -- --loglevel=warn --write .
# make sure that nothing crashes when we require the output CJS or
# import the output ESM
(cd dist && node -e 'require("llm-ops")')
(cd dist && node -e 'import("llm-ops")' --input-type=module)
(cd dist && node -e 'import("llm-ops")' --input-type=module)

# Path: build-docs
api-extractor run --local --verbose
rm -rf docs/api;mkdir -p docs/api
npx api-documenter markdown --input-folder './temp' --output-folder './docs/api'
35 changes: 24 additions & 11 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,38 @@ import { defineConfig } from "vitepress";
export default defineConfig({
title: "LLM Ops",
description: "高效制作llm workflow的低代码框架",
lang: "en-US",
lastUpdated: true,
markdown: { attrs: { disable: true } },
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: "Home", link: "/" },
{ text: "Examples", link: "/markdown-examples" },
{ text: "Guide", link: "/guide/model" },
{ text: "API", link: "/api/" },
],

sidebar: [
{
text: "Examples",
items: [
{ text: "Markdown Examples", link: "/markdown-examples" },
{ text: "Runtime API Examples", link: "/api-examples" },
],
},
],
sidebar: {
"/guide": [
{
text: "LLM Ops",
items: [{ text: "model", link: "/guide/model" }],
},
],
},
editLink: {
pattern: "https://github.com/idealeap/llm-ops/edit/main/docs/:path",
text: "Edit this page on GitHub",
},

lastUpdatedText: "Last Updated",

socialLinks: [
{ icon: "github", link: "https://github.com/vuejs/vitepress" },
{ icon: "github", link: "https://github.com/IdeaLeap/llm-ops" },
],
footer: {
message: "Released under the MIT License.",
copyright: "Copyright © 2023-present Marlene & IdeaLeap",
},
},
});
55 changes: 0 additions & 55 deletions docs/api-examples.md

This file was deleted.

12 changes: 12 additions & 0 deletions docs/api/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md)

## API Reference

## Packages

| Package | Description |
| --- | --- |
| [llm-ops](./llm-ops.md) | |

20 changes: 20 additions & 0 deletions docs/api/llm-ops.agentprompttemplate._constructor_.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [llm-ops](./llm-ops.md) &gt; [AgentPromptTemplate](./llm-ops.agentprompttemplate.md) &gt; [(constructor)](./llm-ops.agentprompttemplate._constructor_.md)

## AgentPromptTemplate.(constructor)

Constructs a new instance of the `AgentPromptTemplate` class

**Signature:**

```typescript
constructor({ role, desc, toneStyle, communicationStyle, level, field, keyRole, reasoning, rules, reflection, memory, humanSituation, language, other, evaluate, }: AgentPromptTemplateSchema);
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| { role, desc, toneStyle, communicationStyle, level, field, keyRole, reasoning, rules, reflection, memory, humanSituation, language, other, evaluate, } | [AgentPromptTemplateSchema](./llm-ops.agentprompttemplateschema.md) | |

11 changes: 11 additions & 0 deletions docs/api/llm-ops.agentprompttemplate.communicationstyle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [llm-ops](./llm-ops.md) &gt; [AgentPromptTemplate](./llm-ops.agentprompttemplate.md) &gt; [communicationStyle](./llm-ops.agentprompttemplate.communicationstyle.md)

## AgentPromptTemplate.communicationStyle property

**Signature:**

```typescript
communicationStyle?: communicationStyleType;
```
11 changes: 11 additions & 0 deletions docs/api/llm-ops.agentprompttemplate.desc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [llm-ops](./llm-ops.md) &gt; [AgentPromptTemplate](./llm-ops.agentprompttemplate.md) &gt; [desc](./llm-ops.agentprompttemplate.desc.md)

## AgentPromptTemplate.desc property

**Signature:**

```typescript
desc?: string;
```
11 changes: 11 additions & 0 deletions docs/api/llm-ops.agentprompttemplate.evaluate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [llm-ops](./llm-ops.md) &gt; [AgentPromptTemplate](./llm-ops.agentprompttemplate.md) &gt; [evaluate](./llm-ops.agentprompttemplate.evaluate.md)

## AgentPromptTemplate.evaluate property

**Signature:**

```typescript
evaluate?: TeacherEvaluateSchema;
```
11 changes: 11 additions & 0 deletions docs/api/llm-ops.agentprompttemplate.field.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [llm-ops](./llm-ops.md) &gt; [AgentPromptTemplate](./llm-ops.agentprompttemplate.md) &gt; [field](./llm-ops.agentprompttemplate.field.md)

## AgentPromptTemplate.field property

**Signature:**

```typescript
field?: string;
```
15 changes: 15 additions & 0 deletions docs/api/llm-ops.agentprompttemplate.format.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [llm-ops](./llm-ops.md) &gt; [AgentPromptTemplate](./llm-ops.agentprompttemplate.md) &gt; [format](./llm-ops.agentprompttemplate.format.md)

## AgentPromptTemplate.format() method

**Signature:**

```typescript
format(): messagesType;
```
**Returns:**

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

22 changes: 22 additions & 0 deletions docs/api/llm-ops.agentprompttemplate.formatevaluateitem.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [llm-ops](./llm-ops.md) &gt; [AgentPromptTemplate](./llm-ops.agentprompttemplate.md) &gt; [formatEvaluateItem](./llm-ops.agentprompttemplate.formatevaluateitem.md)

## AgentPromptTemplate.formatEvaluateItem() method

**Signature:**

```typescript
formatEvaluateItem(items: EvaluateItemSchema[]): string;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| items | [EvaluateItemSchema](./llm-ops.evaluateitemschema.md)<!-- -->\[\] | |

**Returns:**

string

11 changes: 11 additions & 0 deletions docs/api/llm-ops.agentprompttemplate.humansituation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [llm-ops](./llm-ops.md) &gt; [AgentPromptTemplate](./llm-ops.agentprompttemplate.md) &gt; [humanSituation](./llm-ops.agentprompttemplate.humansituation.md)

## AgentPromptTemplate.humanSituation property

**Signature:**

```typescript
humanSituation?: string;
```
11 changes: 11 additions & 0 deletions docs/api/llm-ops.agentprompttemplate.keyrole.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [llm-ops](./llm-ops.md) &gt; [AgentPromptTemplate](./llm-ops.agentprompttemplate.md) &gt; [keyRole](./llm-ops.agentprompttemplate.keyrole.md)

## AgentPromptTemplate.keyRole property

**Signature:**

```typescript
keyRole?: string;
```
11 changes: 11 additions & 0 deletions docs/api/llm-ops.agentprompttemplate.language.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [llm-ops](./llm-ops.md) &gt; [AgentPromptTemplate](./llm-ops.agentprompttemplate.md) &gt; [language](./llm-ops.agentprompttemplate.language.md)

## AgentPromptTemplate.language property

**Signature:**

```typescript
language?: languageType;
```
11 changes: 11 additions & 0 deletions docs/api/llm-ops.agentprompttemplate.level.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [llm-ops](./llm-ops.md) &gt; [AgentPromptTemplate](./llm-ops.agentprompttemplate.md) &gt; [level](./llm-ops.agentprompttemplate.level.md)

## AgentPromptTemplate.level property

**Signature:**

```typescript
level?: levelType;
```
47 changes: 47 additions & 0 deletions docs/api/llm-ops.agentprompttemplate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [llm-ops](./llm-ops.md) &gt; [AgentPromptTemplate](./llm-ops.agentprompttemplate.md)

## AgentPromptTemplate class

**Signature:**

```typescript
export declare class AgentPromptTemplate extends BasePromptTemplate
```
**Extends:** [BasePromptTemplate](./llm-ops.baseprompttemplate.md)
## Constructors
| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)({ role, desc, toneStyle, communicationStyle, level, field, keyRole, reasoning, rules, reflection, memory, humanSituation, language, other, evaluate, })](./llm-ops.agentprompttemplate._constructor_.md) | | Constructs a new instance of the <code>AgentPromptTemplate</code> class |
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [communicationStyle?](./llm-ops.agentprompttemplate.communicationstyle.md) | | [communicationStyleType](./llm-ops.communicationstyletype.md) | _(Optional)_ |
| [desc?](./llm-ops.agentprompttemplate.desc.md) | | string | _(Optional)_ |
| [evaluate?](./llm-ops.agentprompttemplate.evaluate.md) | | [TeacherEvaluateSchema](./llm-ops.teacherevaluateschema.md) | _(Optional)_ |
| [field?](./llm-ops.agentprompttemplate.field.md) | | string | _(Optional)_ |
| [humanSituation?](./llm-ops.agentprompttemplate.humansituation.md) | | string | _(Optional)_ |
| [keyRole?](./llm-ops.agentprompttemplate.keyrole.md) | | string | _(Optional)_ |
| [language?](./llm-ops.agentprompttemplate.language.md) | | [languageType](./llm-ops.languagetype.md) | _(Optional)_ |
| [level?](./llm-ops.agentprompttemplate.level.md) | | [levelType](./llm-ops.leveltype.md) | _(Optional)_ |
| [memory?](./llm-ops.agentprompttemplate.memory.md) | | [MemoryPromptTemplateSchema](./llm-ops.memoryprompttemplateschema.md) | _(Optional)_ |
| [other?](./llm-ops.agentprompttemplate.other.md) | | string | _(Optional)_ |
| [reasoning?](./llm-ops.agentprompttemplate.reasoning.md) | | [reasoningType](./llm-ops.reasoningtype.md) | _(Optional)_ |
| [reflection?](./llm-ops.agentprompttemplate.reflection.md) | | [ReflectionPromptTemplateSchema](./llm-ops.reflectionprompttemplateschema.md) | _(Optional)_ |
| [returnPrompt?](./llm-ops.agentprompttemplate.returnprompt.md) | | [messagesType](./llm-ops.messagestype.md) | _(Optional)_ |
| [role?](./llm-ops.agentprompttemplate.role.md) | | string | _(Optional)_ |
| [rules?](./llm-ops.agentprompttemplate.rules.md) | | string \| string\[\] | _(Optional)_ |
| [toneStyle?](./llm-ops.agentprompttemplate.tonestyle.md) | | [toneStyleType](./llm-ops.tonestyletype.md) | _(Optional)_ |
## Methods
| Method | Modifiers | Description |
| --- | --- | --- |
| [format()](./llm-ops.agentprompttemplate.format.md) | | |
| [formatEvaluateItem(items)](./llm-ops.agentprompttemplate.formatevaluateitem.md) | | |
11 changes: 11 additions & 0 deletions docs/api/llm-ops.agentprompttemplate.memory.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [llm-ops](./llm-ops.md) &gt; [AgentPromptTemplate](./llm-ops.agentprompttemplate.md) &gt; [memory](./llm-ops.agentprompttemplate.memory.md)

## AgentPromptTemplate.memory property

**Signature:**

```typescript
memory?: MemoryPromptTemplateSchema;
```
11 changes: 11 additions & 0 deletions docs/api/llm-ops.agentprompttemplate.other.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [llm-ops](./llm-ops.md) &gt; [AgentPromptTemplate](./llm-ops.agentprompttemplate.md) &gt; [other](./llm-ops.agentprompttemplate.other.md)

## AgentPromptTemplate.other property

**Signature:**

```typescript
other?: string;
```
Loading

0 comments on commit a5caadc

Please sign in to comment.