Fix deduplication for "message" type long-term memories #171
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python Tests | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
cache: 'pip' | |
- name: Install pre-commit | |
run: | | |
python -m pip install --upgrade pip | |
pip install uv | |
uv sync --only-dev | |
- name: Run pre-commit | |
run: | | |
uv run pre-commit run --all-files | |
test: | |
needs: lint | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [3.12] # Not testing with 3.13 at the moment | |
redis-version: ['6.2.6-v9', 'latest'] # 8.0-M03 is not working atm | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set Redis image name | |
run: | | |
if [[ "${{ matrix.redis-version }}" == "8.0-M03" ]]; then | |
echo "REDIS_IMAGE=redis:${{ matrix.redis-version }}" >> $GITHUB_ENV | |
else | |
echo "REDIS_IMAGE=redis/redis-stack-server:${{ matrix.redis-version }}" >> $GITHUB_ENV | |
fi | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install uv | |
uv sync --all-extras | |
- name: Install agent-memory-client | |
run: | | |
uv pip install -e ./agent-memory-client | |
- name: Run tests | |
run: | | |
uv run pytest --run-api-tests | |
env: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
docker: | |
needs: test | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Extract version from __init__.py | |
id: version | |
run: | | |
VERSION=$(grep '__version__ =' agent_memory_server/__init__.py | sed 's/__version__ = "\(.*\)"/\1/' || echo "latest") | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
echo "Version: $VERSION" | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: | | |
andrewbrookins510/agent-memory-server:latest | |
andrewbrookins510/agent-memory-server:${{ steps.version.outputs.version }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |