Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 19 additions & 36 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: PHPUnit
on: [ push, pull_request ]

env:
SWOOLE_VERSION: '5.0.2'
SWOOLE_VERSION: '5.1.5'
SWOW_VERSION: 'v1.2.0'

jobs:
Expand All @@ -13,54 +13,37 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest ]
php-version: [ '8.1', '8.2' ]
php-version: [ '8.1', '8.2', '8.3' ]
engine: [ 'none', 'swoole', 'swow' ]
max-parallel: 5
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: >-
${{ matrix.engine == 'swoole' && 'swoole' || '' }}
${{ matrix.engine == 'swow' && 'swow' || '' }}
tools: phpize
ini-values: opcache.enable_cli=0
coverage: none
- name: Setup Swoole
if: ${{ matrix.engine == 'swoole' }}
run: |
cd /tmp
sudo apt-get update
sudo apt-get install libcurl4-openssl-dev libc-ares-dev libpq-dev
wget https://github.com/swoole/swoole-src/archive/v${SWOOLE_VERSION}.tar.gz -O swoole.tar.gz
mkdir -p swoole
tar -xf swoole.tar.gz -C swoole --strip-components=1
rm swoole.tar.gz
cd swoole
phpize
./configure --enable-openssl --enable-swoole-curl --enable-cares --enable-swoole-pgsql
make -j$(nproc)
sudo make install
sudo sh -c "echo extension=swoole > /etc/php/${{ matrix.php-version }}/cli/conf.d/swoole.ini"
php --ri swoole
- name: Setup Swow
if: ${{ matrix.engine == 'swow' }}
run: |
cd /tmp
wget https://github.com/swow/swow/archive/"${SWOW_VERSION}".tar.gz -O swow.tar.gz
mkdir -p swow
tar -xf swow.tar.gz -C swow --strip-components=1
rm swow.tar.gz
cd swow/ext || exit

phpize
./configure --enable-swow --enable-swow-ssl --enable-swow-curl
make -j "$(nproc)"
sudo make install
sudo sh -c "echo extension=swow > /etc/php/${{ matrix.php-version }}/cli/conf.d/swow.ini"
php --ri swow
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Packages
run: composer update -o --no-scripts
- name: Install Engine Dependencies
run: |
if [ "${{ matrix.engine }}" = "swow" ]; then
echo "Installing hyperf/engine-swow for Swow environment"
composer require hyperf/engine-swow:^2.12 --no-scripts --dev
elif [ "${{ matrix.engine }}" = "swoole" ]; then
echo "Installing hyperf/engine for Swoole environment"
composer require hyperf/engine:^2.14 --no-scripts --dev
else
echo "No specific engine dependencies needed for 'none' environment"
fi
- name: Run Test Cases
run: |
vendor/bin/php-cs-fixer fix --dry-run
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Odin 是一个基于 PHP 的 LLM 应用开发框架,其命名灵感来自于
- **多模型支持**:支持 OpenAI、Azure OpenAI、AWS Bedrock、Doubao、ChatGLM 等多种大语言模型
- **统一接口**:提供一致的 API 接口,简化与不同 LLM 提供商的集成
- **工具调用**:支持 Function Calling,允许模型调用自定义工具和函数
- **MCP 集成**:基于 [dtyq/php-mcp](https://github.com/dtyq/php-mcp) 实现 Model Context Protocol 支持,轻松接入外部工具和服务
- **记忆管理**:提供灵活的记忆管理系统,支持会话上下文保持
- **向量存储**:集成 Qdrant 向量数据库,支持知识检索和语义搜索
- **Agent 开发**:内置 Agent 框架,支持智能代理开发
Expand Down Expand Up @@ -62,6 +63,7 @@ return [
- 记忆管理
- Agent 开发
- 示例项目
- MCP 集成
- 常见问题解答

## License
Expand Down
13 changes: 8 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@
"php": ">=8.1",
"ext-bcmath": "*",
"ext-mbstring": "*",
"guzzlehttp/guzzle": "^7.0",
"aws/aws-sdk-php": "^3.0",
"dtyq/php-mcp": "0.1.*",
"guzzlehttp/guzzle": "^7.0|^6.0",
"hyperf/cache": "~2.2.0 || 3.0.* || 3.1.*",
"hyperf/config": "~2.2.0 || 3.0.* || 3.1.*",
"hyperf/di": "~2.2.0 || 3.0.* || 3.1.*",
"hyperf/logger": "~2.2.0 || 3.0.* || 3.1.*",
"hyperf/cache": "~2.2.0 || 3.0.* || 3.1.*",
"hyperf/qdrant-client": "*",
"justinrainbow/json-schema": "^6.3",
"yethee/tiktoken": "^0.1.2",
"aws/aws-sdk-php": "^3.0"
"yethee/tiktoken": "^0.1.2"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.0",
Expand All @@ -39,7 +40,9 @@
"vlucas/phpdotenv": "^5.0"
},
"suggest": {
"swow/swow": "Required to create swow components."
"swow/swow": "Required to create swow components.",
"hyperf/engine-swow": "Required when using Swow as the event loop (^2.12).",
"hyperf/engine": "Required when using Swoole as the event loop (^2.14)."
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
Loading