Skip to content

Commit

Permalink
merge dev
Browse files Browse the repository at this point in the history
  • Loading branch information
HamadaSalhab committed Oct 22, 2024
2 parents a006be6 + d9799e6 commit fbf28c7
Show file tree
Hide file tree
Showing 43 changed files with 752 additions and 710 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/doctoc-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ jobs:
MAX_HEADER_LEVEL: 3
TOC_TITLE: '<h3>📖 Table of Contents</h3>'
FOLDING: false
CREATE_PR: true
CHECK_ONLY_DEFAULT_BRANCH: true
94 changes: 52 additions & 42 deletions README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Julep 支持创建多步骤任务,包括决策、循环、并行处理以及

1. 🧠 **持久 AI 代理**:在长期交互​​中记住上下文和信息。
2. 💾 **状态会话**:跟踪过去的互动以获得个性化回应。
3. 🔄 **多步骤任务**通过循环和决策构建复杂的多步骤流程
3. 🔄 **多步骤任务**使用循环和决策构建复杂的多步骤流程
4.**任务管理**:处理可以无限期运行的长时间运行的任务。
5.🛠️**内置工具**:在您的任务中使用内置工具和外部 API。
6. 🔧 **自我修复**:Julep 将自动重试失败的步骤、重新发送消息,并确保您的任务顺利运行。
Expand Down Expand Up @@ -158,12 +158,12 @@ tools:
integration:
provider: brave
setup:
api_key: BSAqES7dj9d... # dummy key
api_key: BSAqES7dj9d... # dummy key

- name: discord_webhook
type: api_call
api_call:
url: https://eobuxj02se0n.m.pipedream.net # dummy requestbin
url: https://eobuxj02se0n.m.pipedream.net # dummy requestbin
method: POST
headers:
Content-Type: application/json
Expand Down Expand Up @@ -231,34 +231,40 @@ main:
<summary><b>人工智能研究摘要</b> <i>(点击展开)</i></summary>
> **人工智能研究摘要**
>
>
>###人工智能(AI)研究成果摘要
>
>
> #### 简介
>
> 近年来,人工智能 (AI) 领域取得了重大进展,其特点是方法和技术的发展,使机器能够感知环境、从数据中学习并做出决策。本摘要主要关注从与 AI 相关的各种研究成果中获得的见解。
>
>
> #### 主要发现
>
>
> 1. **人工智能的定义和范围**:
>
> - 人工智能被定义为计算机科学的一个分支,专注于创建能够执行需要类似人类智能的任务的系统,包括学习、推理和解决问题(维基百科)。
>——它涵盖了各种子领域,包括机器学习、自然语言处理、机器人和计算机视觉。
>
>
> 2. **影响与应用**:
>
> - AI 技术正在融入众多领域,提高效率和生产力。应用范围从自动驾驶汽车和医疗诊断到客户服务自动化和财务预测(OpenAI)。
> - 谷歌致力于让人工智能造福每个人,这凸显了其通过增强各个平台的用户体验(谷歌人工智能)显著改善日常生活的潜力。
>
>
> 3. **道德考虑**:
>
> - 关于人工智能的伦理影响的讨论一直在进行中,包括对隐私、偏见和决策过程中的责任的担忧。强调需要一个确保安全和负责任地使用人工智能技术的框架(OpenAI)。
>
>
> 4. **学习机制**:
>
> - AI 系统利用不同的学习机制,例如监督学习、无监督学习和强化学习。这些方法允许 AI 通过从过去的经验和数据中学习来提高性能(维基百科)。
> - 监督学习和无监督学习之间的区别至关重要;监督学习依赖于标记数据,而无监督学习则识别没有预定义标签的模式(无监督)。
>
>
> 5. **未来方向**:
> - 未来人工智能的发展预计将专注于增强人工智能系统的可解释性和透明度,确保它们能够提供合理的决策和行动(OpenAI)。
> - 人们还在努力使人工智能系统更易于访问和用户友好,鼓励不同人群和行业更广泛地采用它(谷歌人工智能)。
>
>
> #### 结论
>
> 人工智能代表着跨多个领域的变革力量,有望重塑行业并改善生活质量。然而,随着其能力的扩展,解决随之而来的伦理和社会影响至关重要。技术专家、伦理学家和政策制定者之间的持续研究和合作对于驾驭人工智能的未来格局至关重要。
</details>
Expand All @@ -268,6 +274,7 @@ main:
要开始使用 Julep,请使用 [npm](https://www.npmjs.com/package/@julep/sdk) 或 [pip](https://pypi.org/project/julep/) 安装它:
**Node.js**:
```bash
npm install @julep/sdk

Expand All @@ -277,6 +284,7 @@ bun add @julep/sdk
```

**Python**

```bash
pip install julep
```
Expand All @@ -293,7 +301,7 @@ pip install julep
## Python 快速入门🐍

```python
````python
### Step 0: Setup

import time
Expand Down Expand Up @@ -378,7 +386,7 @@ main:
{% for idea in outputs[1].plot_ideas %}
- {{idea}}
{% endfor %}
Here are the results from researching the plot ideas on Wikipedia:
{{_.wikipedia_results}}
Expand Down Expand Up @@ -430,7 +438,7 @@ while (result := client.executions.get(execution.id)).status 不在 ['成功', '
打印(结果.输出)
别的:
引发异常(结果.错误)
```
````

You can find the full python example [here](example.py).

Expand All @@ -445,25 +453,27 @@ You can find the full python example [here](example.py).

## Node.js Quick Start 🟩

### Step 1: Create an Agent

```JavaScript的
// 步骤 0:设置
const dotenv = require('dotenv');
const { Julep } = require('@julep/sdk');
const yaml = require('yaml');
const dotenv = require(dotenv);
const { Julep } = require(“@julep/sdk”);
const yaml = require(“yaml”);
dotenv.配置();
const 客户端 = new Julep({ apiKey:process.env.JULEP_API_KEY, 环境:process.env.JULEP_ENVIRONMENT || “生产” });
const 客户端 = new Julep({
apiKey:process.env.JULEP_API_KEY,
环境:process.env.JULEP_ENVIRONMENT || “生产”,
});
/* 步骤 1:创建代理 */
异步函数 createAgent() {
const 代理 = 等待客户端.代理.创建({
名称:“讲故事特工”,
模型:“claude-3.5-sonnet”,
关于:“您是一位富有创意的讲故事者,能够就无数主题创作引人入胜的故事。”,
关于:
“您是一位富有创意的讲故事者,能就无数主题创作出引人入胜的故事。”
});
回報代理;
}
Expand Down Expand Up @@ -567,26 +577,23 @@ wikipedia_results:'NEWLINE.join([f“- {doc.metadata.title}:{doc.metadata.
`;
异步函数 createTask(agentId){
const task = await 客户端.tasks.create(
代理人编号,
yaml.解析(taskYaml)
(英文):
const task = 等待客户端.tasks.创建(agentId, yaml.parse(taskYaml));
返回任务;
}
/* 步骤 3:执行任务 */
异步函数 executeTask (taskId) {
const 执行 = 等待客户端.执行.创建(taskId,{
输入:{ 想法:“一只学飞的猫” }
输入:{想法:“一只学飞的猫”},
});
// 🎉 观看故事和漫画面板的生成
while (真) {
const result = 等待客户端.executions.get(execution.id);
控制台.log(结果.状态,结果.输出);
if (result.status === '成功' || result.status === '失败') {
if (result.status === "成功" || result.status === "失败") {
// 📦执行完成后,检索结果
如果 (result.status === "成功") {
控制台.log(结果.输出);
Expand All @@ -596,7 +603,7 @@ if (result.status === '成功' || result.status === '失败') {
休息;
}
等待新的 Promise(resolve => setTimeout(resolve,1000));
等待新的Promise((resolve=> setTimeout(resolve,1000));
}
}
Expand All @@ -611,7 +618,9 @@ console.error("发生错误:", error);
}
}
main().then(() => console.log("完成")).catch(console.error);
主要的()
.then(() => console.log("完成"))
.catch(控制台.错误);
```

You can find the full Node.js example [here](example.js).
Expand Down Expand Up @@ -685,7 +694,6 @@ classDef 核心填充:#f9f,描边:#333,描边宽度:2px;
- **Documents**: Text or data objects associated with agents or users, vectorized and stored for semantic search and retrieval.
- **Executions**: Instances of tasks that have been initiated with specific inputs, with their own lifecycle and state machine.


<div align="center">
<a href="#top">
<img src="https://img.shields.io/badge/Back%20to%20Top-000000?style=for-the-badge&logo=github&logoColor=white" alt="Back to Top">
Expand Down Expand Up @@ -858,6 +866,7 @@ Retrieve a value from the execution's key-value store.
Assign a value to a key in the execution's key-value store.
<br><br><b>Note:</b> The set step uses Python expressions.
</td>
<td>
Expand Down Expand Up @@ -1095,6 +1104,7 @@ Agents can be given access to a number of "tools" -- any programmatic interface
Unlike agent frameworks, julep is a _backend_ that manages agent execution. Clients can interact with agents using our SDKs. julep takes care of executing tasks and running integrations.

Tools in julep can be one of:

1. **User-defined `functions`**: These are function signatures that you can give the model to choose from, similar to how [openai]'s function-calling works. They need to be handled by the client. The workflow will pause until the client calls the function and gives the results back to julep.
2. **`system` tools**: Built-in tools that can be used to call the julep APIs themselves, like triggering a task execution, appending to a metadata field, etc.
3. **`integrations`**: Built-in third party tools that can be used to extend the capabilities of your agents.
Expand Down Expand Up @@ -1128,12 +1138,11 @@ These are function signatures that you can give the model to choose from, simila

Whenever julep encounters a _user-defined function_, it pauses, giving control back to the client and waits for the client to run the function call and give the results back to julep.

> [!TIP]
> **Example cookbook**: [cookbooks/13-Error_Handling_and_Recovery.py](https://github.com/julep-ai/julep/blob/dev/cookbooks/13-Error_Handling_and_Recovery.py)
> [!TIP] > **Example cookbook**: [cookbooks/13-Error_Handling_and_Recovery.py](https://github.com/julep-ai/julep/blob/dev/cookbooks/13-Error_Handling_and_Recovery.py)

### `system` tools

Built-in tools that can be used to call the julep APIs themselves, like triggering a task execution, appending to a metadata field, etc.
Built-in tools that can be used to call the julep APIs themselves, like triggering a task execution, appending to a metadata field, etc.

`system` tools are built into the backend. They get executed automatically when needed. They do _not_ require any action from the client-side.

Expand Down Expand Up @@ -1161,20 +1170,23 @@ For example,
#### Available `system` resources and operations

- `agent`:

- `list`: List all agents.
- `get`: Get a single agent by id.
- `create`: Create a new agent.
- `update`: Update an existing agent.
- `delete`: Delete an existing agent.

- `user`:

- `list`: List all users.
- `get`: Get a single user by id.
- `create`: Create a new user.
- `update`: Update an existing user.
- `delete`: Delete an existing user.

- `session`:

- `list`: List all sessions.
- `get`: Get a single session by id.
- `create`: Create a new session.
Expand All @@ -1184,6 +1196,7 @@ For example,
- `history`: Get the chat history with a session.

- `task`:

- `list`: List all tasks.
- `get`: Get a single task by id.
- `create`: Create a new task.
Expand All @@ -1197,6 +1210,7 @@ For example,
- `search`: Search for documents.

Additional operations available for some resources:

- `embed`: Embed a resource (specific resources not specified in the provided code).
- `change_status`: Change the status of a resource (specific resources not specified in the provided code).
- `chat`: Chat with a resource (specific resources not specified in the provided code).
Expand All @@ -1205,18 +1219,15 @@ Additional operations available for some resources:

Note: The availability of these operations may vary depending on the specific resource and implementation details.

> [!TIP]
> **Example cookbook**: [cookbooks/10-Document_Management_and_Search.py](https://github.com/julep-ai/julep/blob/dev/cookbooks/10-Document_Management_and_Search.py)
> [!TIP] > **Example cookbook**: [cookbooks/10-Document_Management_and_Search.py](https://github.com/julep-ai/julep/blob/dev/cookbooks/10-Document_Management_and_Search.py)

### Built-in `integrations`

Julep comes with a number of built-in integrations (as described in the section below). `integration` tools are directly executed on the julep backend. Any additional parameters needed by them at runtime can be set in the agent/session/user's `metadata` fields.

See [Integrations](#integrations) for details on the available integrations.

> [!TIP]
> **Example cookbook**: [cookbooks/01-Website_Crawler_using_Spider.ipynb](https://github.com/julep-ai/julep/blob/dev/cookbooks/01-Website_Crawler_using_Spider.ipynb)

> [!TIP] > **Example cookbook**: [cookbooks/01-Website_Crawler_using_Spider.ipynb](https://github.com/julep-ai/julep/blob/dev/cookbooks/01-Website_Crawler_using_Spider.ipynb)

### Direct `api_calls`

Expand Down Expand Up @@ -1286,7 +1297,7 @@ result: string # Brave Search 的结果
设置:
api_key: string # BrowserBase 的 API 密钥
project_id: string # BrowserBase 的项目 ID
session_id: string #(可选)BrowserBase 的会话 ID
session_id: string # (可选)BrowserBase 的会话 ID
参数:
urls: list[string] # 使用 BrowserBase 加载的 URL
Expand Down Expand Up @@ -1530,8 +1541,7 @@ metadata_filter={“category”:“research_paper”}
</a>
</div>


*****
---

## Julep 和 LangChain 等有什么区别?

Expand Down
Loading

0 comments on commit fbf28c7

Please sign in to comment.