Skip to content

Commit

Permalink
Merge branch 'baidubce:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
C9luster authored Aug 22, 2024
2 parents 79c1a17 + d2591bf commit 066e533
Show file tree
Hide file tree
Showing 110 changed files with 6,344 additions and 2,354 deletions.
8 changes: 8 additions & 0 deletions .env_template
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# rename this file to .env

APPBUILDER_TOKEN=your-token
APPBUILDER_TOKEN_V2=your-token
BAIDU_VDB_API_KEY=your-token
INSTANCE_ID=your-token
DATASET_ID=your-token
APPBUILDER_TOKEN_DOC_FORMAT=your-token
53 changes: 27 additions & 26 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,31 @@ on:
branches: [ "master" ]

jobs:
# Pylint:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# python-version: ["3.12"]
Pylint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.12.5"]

# steps:
# - uses: actions/checkout@v3
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v3
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# python -m pip install flake8 pytest
# python -m pip install chainlit~=1.0.200 flask~=2.3.2 flask-restful==0.3.9
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install chainlit~=1.0.200 flask~=2.3.2 flask-restful==0.3.9
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
Linux-CI-Tests:
runs-on: ubuntu-latest
Expand All @@ -44,7 +44,7 @@ jobs:
APPBUILDER_TOKEN_V2: bce-v3/ALTAK-zX2OwTWGE9JxXSKxcBYQp/7dd073d9129c01c617ef76d8b7220a74835eb2f4
BAIDU_VDB_API_KEY: apaasTest1
INSTANCE_ID: vdb-bj-vuzmppgqrnhv
DATASET_ID: c4652b26-3f2b-4cd1-9ca2-98cd26adc36f
DATASET_ID: 2626a842-132f-45ce-977f-f701d18fd104
APPBUILDER_TOKEN_DOC_FORMAT: bce-v3/ALTAK-bcKsgHd39g0Aaq3nCYUUQ/b06384229df1462c6fb011383d09230346a20ac4
strategy:
fail-fast: false
Expand Down Expand Up @@ -89,8 +89,9 @@ jobs:
python3 -m pip install coverage
python3 -m pip install diff-cover
python3 -m pip install pydub
python3 -m pip install SQLAlchemy==2.0.31
python3 -m pip install chainlit~=1.0.200 flask~=2.3.2 flask-restful==0.3.9
python3 -m pip install opentelemetry-exporter-otlp==1.25.0 opentelemetry-instrumentation==0.46b0 opentelemetry-sdk==1.25.0 opentelemetry-api==1.25.0
python3 -m pip install opentelemetry-exporter-otlp==1.23.0 opentelemetry-instrumentation==0.44b0 opentelemetry-sdk==1.23.0 opentelemetry-api==1.23.0
- name: Build whl
run: |
cd cicd/app-builder
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,12 @@ FETCH_HEAD
# vscode
.vscode
./ppdiffusers/ppdiffusers/version.py


# chainlit
.chainlit
# chainlit.md is generated by chainlit if not found
chainlit.md

# sqlite
*.db
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
]
}
18 changes: 18 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"python.testing.unittestArgs": [
"-v",
"-s",
"./appbuilder",
"-p",
"test*.py"
],
"python.testing.unittestEnabled": true,
"python.envFile": "${workspaceFolder}/.env",
"go.testFlags": [
"-v"
],
"go.testEnvFile": "${workspaceFolder}/.env",
"go.toolsEnvVars": {
"GOPATH": "${workspaceFolder}/go",
}
}
75 changes: 75 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Contributing to AppBuilder

Thanks for your interest in contributing to AppBuilder! Please follow these guidelines to make the contribution process easy and effective for everyone involved.


## Contributing Guide for python SDK

### Development

Clone the source code from Github

```
git clone https://github.com/baidubce/app-builder.git
```

Use `pip` to install from source

```shell
cd appbuilder
pip install -e .
```

`-e` means "editable mode" in pip. With "editable mode" all changes to python code will immediately become effective in the current environment.

### Testing

We highly recommend writing tests for new features or bug fixes and ensure all tests passing before submitting a PR.

AppBuilder uses [unittest](https://docs.python.org/3/library/unittest.html) as the test framework, requires no 3rd party dependencies to install.

Before running tests, make sure add the following environment variables:

```shell
export TEST_CASE=CPU_PARALLEL
export APPBUILDER_TOKEN=<your_token>
```


To run all existing test cases together, run

```
pip install -e .[all]
sh appbuilder/tests/run_python_test.sh
```

If you only want to run specific test file, e.g.:

```
python appbuilder/tests/test_playground.py
```


To debug tests in vs code update .env file to roo folder of the project:
```
APPBUILDER_TOKEN=<your-token>
APPBUILDER_TOKEN_V2=<your-token>
TEST_CASE=CPU_SERIAL
```

and add/update `.vscode/settings.json` file with the following content:

```
{
"python.testing.unittestArgs": [
"-v",
"-s",
"./appbuilder",
"-p",
"test*.py"
],
"python.testing.unittestEnabled": true,
"python.envFile": "${workspaceFolder}/.env"
}
```

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
![Supported OSs](https://img.shields.io/badge/os-linux%2C%20win%2C%20mac-yellow.svg)
</div>

简体中文 | [English](./README_en.md)
简体中文 | [English](./README_en.md) | [日本語](./README_ja.md)

<br>

Expand Down Expand Up @@ -76,7 +76,7 @@ AppBuilder-SDK不仅提供了百度智能云提供的基础能力组件,同时

## 如何安装AppBuilder-SDK

#### 百度智能云千帆AppBuilder-SDK 最新版本 0.9.1 (2024-07-25)
#### 百度智能云千帆AppBuilder-SDK 最新版本 0.9.3 (2024-08-20)

百度智能云千帆AppBuilder-SDK 更新记录&最新特性请查阅我们的[版本说明](/docs/quick_start/changelog.md)

Expand Down Expand Up @@ -255,7 +255,7 @@ Hook:
#### 更多示例

- 更多AI原生应用示例,请浏览[应用广场](https://console.bce.baidu.com/ai_apaas/appCenter)
- 更多代码CookBook,请浏览 [CookBooks](./cookbooks/README.md),我们有以下cookbook推荐您优先阅读:
- 更多代码Cookbook,请浏览 [Cookbooks](./cookbooks/README.md),我们有以下cookbook推荐您优先阅读:

| 应用类型 |应用链接 | 推荐理由 |
|--|--|--|
Expand Down Expand Up @@ -285,7 +285,7 @@ Hook:
- [流程编排](/docs/basic_module/assistant_sdk.md)
- [端到端应用](/docs/basic_module/appbuilder_client.md)
- [进阶实践](/docs/advanced_application/README.md)
- [CookBooks](/cookbooks/README.md)
- [Cookbooks](/cookbooks/README.md)
- [AppBuilder Trace](https://github.com/baidubce/app-builder/blob/master/docs/trace/README.md)
- [服务化部署](/docs/service/README.md)
- [API调用](/docs/service/flask.md)
Expand Down
6 changes: 3 additions & 3 deletions README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
![Supported OSs](https://img.shields.io/badge/os-linux%2C%20win%2C%20mac-yellow.svg)
</div>

[简体中文](./README.md) | English
[简体中文](./README.md) | English | [日本語](./README_ja.md)

<br>

Expand Down Expand Up @@ -47,7 +47,7 @@ Baidu AI Cloud Qianfan AppBuilder-SDK offers the following essential features fo

## How to install?

#### The latest version of Baidu AI Cloud Qianfan AppBuilder SDK is 0.9.1 (2024-07-25)
#### The latest version of Baidu AI Cloud Qianfan AppBuilder SDK is 0.9.3 (2024-08-20)

Baidu AI Cloud Qianfan AppBuilder SDK ReleaseNote please refer to our [version description](/docs/quick_start/changelog.md)

Expand Down Expand Up @@ -254,7 +254,7 @@ Hook:
- [Process orchestration](/docs/basic_module/assistant_sdk.md)
- [End-to-end applications](/docs/basic_module/appbuilder_client.md)
- [Advanced Practice](/docs/advanced_application/README.md)
- [CookBooks](/cookbooks/README.md)
- [Cookbooks](/cookbooks/README.md)
- [Service deployment](/docs/service/README.md)
- [API calls](/docs/service/flask.md)
- [Interactive front-end](/docs/service/chainlit.md)
Expand Down
Loading

0 comments on commit 066e533

Please sign in to comment.