-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
232 additions
and
61 deletions.
There are no files selected for viewing
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# This workflow will run integration tests for the current project once per day | ||
|
||
name: Integration Tests | ||
|
||
on: | ||
schedule: | ||
- cron: "37 14 * * *" # Run at 7:37 AM Pacific Time (14:37 UTC) every day | ||
workflow_dispatch: # Allows triggering the workflow manually in GitHub UI | ||
|
||
# If another scheduled run starts while this workflow is still running, | ||
# cancel the earlier run in favor of the next run. | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
integration-tests: | ||
name: Integration Tests | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
python-version: ["3.11", "3.12"] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
curl -LsSf https://astral.sh/uv/install.sh | sh | ||
uv venv | ||
uv pip install -r pyproject.toml | ||
uv pip install -U pytest-asyncio | ||
- name: Run integration tests | ||
env: | ||
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | ||
TAVILY_API_KEY: ${{ secrets.TAVILY_API_KEY }} | ||
run: | | ||
uv run pytest tests/integration_tests |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# This workflow will run unit tests for the current project | ||
|
||
name: CI | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
workflow_dispatch: # Allows triggering the workflow manually in GitHub UI | ||
|
||
# If another push to the same PR or branch happens while this workflow is still running, | ||
# cancel the earlier run in favor of the next run. | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
unit-tests: | ||
name: Unit Tests | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
python-version: ["3.11", "3.12"] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
curl -LsSf https://astral.sh/uv/install.sh | sh | ||
uv venv | ||
uv pip install -r pyproject.toml | ||
- name: Lint with ruff | ||
run: | | ||
uv pip install ruff | ||
uv run ruff check . | ||
- name: Lint with mypy | ||
run: | | ||
uv pip install mypy | ||
uv run mypy --strict src/ | ||
- name: Check README spelling | ||
uses: codespell-project/actions-codespell@v2 | ||
with: | ||
ignore_words_file: .codespellignore | ||
path: README.md | ||
- name: Check code spelling | ||
uses: codespell-project/actions-codespell@v2 | ||
with: | ||
ignore_words_file: .codespellignore | ||
path: src/ | ||
- name: Run tests with pytest | ||
run: | | ||
uv pip install pytest | ||
uv run pytest tests/unit_tests |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
"""Default prompts used by the agent.""" | ||
|
||
SYSTEM_PROMPT = """You are a helpful AI assistant. | ||
System time: {system_time}""" |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import pytest | ||
from langsmith import unit | ||
|
||
from react_agent import graph | ||
|
||
|
||
@pytest.mark.asyncio | ||
@unit | ||
async def test_react_agent_simple_passthrough() -> None: | ||
res = await graph.ainvoke( | ||
{"messages": [("user", "Who is the founder of LangChain?")]} | ||
) | ||
|
||
assert "harrison" in str(res["messages"][-1].content).lower() |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from react_agent.configuration import Configuration | ||
|
||
|
||
def test_configuration_empty(): | ||
Configuration.from_runnable_config({}) |