langgraph-agent-toolkit 0.4.2__tar.gz → 0.4.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/.github/workflows/deploy.yml +16 -1
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/.github/workflows/sphinx.yml +1 -1
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/CHANGELOG.md +16 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/PKG-INFO +24 -19
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/README.md +12 -7
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/agents/blueprints/react_so/agent.py +6 -3
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/agents/components/creators/create_react_agent.py +59 -48
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/agents/components/utils.py +9 -1
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/core/models/factory.py +14 -4
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/core/settings.py +1 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/run_agent.py +9 -2
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/run_service.py +1 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/pyproject.toml +13 -13
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/tests/service/test_service.py +1 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/uv.lock +62 -55
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/.coveragerc +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/.dockerignore +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/.env.example +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/.github/RELEASE_TEMPLATE/release-template.md +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/.github/codecov.yml +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/.github/dependabot.yml +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/.github/scripts/tag_from_pyproject.sh +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/.github/workflows/release.yml +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/.github/workflows/test.yml +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/.gitignore +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/.pre-commit-config.yaml +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/.project-root +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/CONTRIBUTING.md +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/LICENSE +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/Makefile +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/configs/clickhouse/.clickhouse.env.example +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/configs/langfuse/.langfuse.env.example +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/configs/litellm/.litellm.env.example +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/configs/litellm/config.example.yaml +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/configs/minio/.minio.env.example +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/configs/postgres/.postgres.env.example +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/configs/redis/.redis.env.example +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/docker/app/Dockerfile +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/docker/service/Dockerfile +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/docker-compose.yaml +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/docs/.gitignore +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/docs/Makefile +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/docs/_static/custom.css +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/docs/_templates/class.rst +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/docs/_templates/layout.html +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/docs/_templates/module.rst +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/docs/conf.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/docs/contributing.rst +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/docs/environment_setup.rst +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/docs/index.rst +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/docs/installation.rst +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/docs/make.bat +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/docs/media/agent_architecture.excalidraw +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/docs/media/agent_architecture.png +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/docs/media/agent_diagram.png +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/docs/media/logo.svg +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/docs/usage.rst +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph.json +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/__init__.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/agents/__init__.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/agents/agent.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/agents/agent_executor.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/agents/blueprints/__init__.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/agents/blueprints/bg_task_agent/__init__.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/agents/blueprints/bg_task_agent/agent.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/agents/blueprints/bg_task_agent/task.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/agents/blueprints/bg_task_agent/utils.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/agents/blueprints/chatbot/__init__.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/agents/blueprints/chatbot/agent.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/agents/blueprints/command_agent/__init__.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/agents/blueprints/command_agent/agent.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/agents/blueprints/interrupt_agent/__init__.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/agents/blueprints/interrupt_agent/agent.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/agents/blueprints/knowledge_base_agent/__init__.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/agents/blueprints/knowledge_base_agent/agent.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/agents/blueprints/react/__init__.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/agents/blueprints/react/agent.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/agents/blueprints/react_so/__init__.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/agents/blueprints/supervisor_agent/__init__.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/agents/blueprints/supervisor_agent/agent.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/agents/components/__init__.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/agents/components/creators/__init__.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/agents/components/tools.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/client/__init__.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/client/client.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/core/__init__.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/core/memory/__init__.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/core/memory/base.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/core/memory/factory.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/core/memory/postgres.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/core/memory/sqlite.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/core/memory/types.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/core/models/__init__.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/core/models/chat_openai.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/core/models/fake.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/core/observability/__init__.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/core/observability/base.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/core/observability/empty.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/core/observability/factory.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/core/observability/langfuse.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/core/observability/langsmith.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/core/observability/types.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/core/prompts/__init__.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/core/prompts/chat_prompt_template.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/helper/__init__.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/helper/constants.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/helper/logging.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/helper/types.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/helper/utils.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/run_client.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/schema/__init__.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/schema/models.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/schema/schema.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/schema/task_data.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/service/__init__.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/service/exception_handlers.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/service/factory.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/service/handler.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/service/middleware.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/service/routes.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/service/types.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/service/utils.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/streamlit_app.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/scripts/postgres-init/create_databases.sql +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/scripts/python/01-invoke-proxy.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/scripts/python/02-test-local-pm.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/scripts/python/03-test-langfuse-pm.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/scripts/python/04-test-langsmith-pm.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/scripts/python/05-test-prompt-types.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/scripts/python/06-test-custom-chat-prompt-template.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/scripts/python/07-test-get-chat-history.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/scripts/python/08-test-update-chat-history.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/scripts/python/09-test-clear-chat-history.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/tests/agents/test_agent_executor.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/tests/agents/test_service_streaming.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/tests/app/conftest.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/tests/app/test_streamlit_app.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/tests/client/conftest.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/tests/client/test_client.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/tests/conftest.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/tests/core/test_llm.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/tests/core/test_memory.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/tests/core/test_observability.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/tests/core/test_prompts.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/tests/core/test_settings.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/tests/integration/test_docker_e2e.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/tests/service/conftest.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/tests/service/test_auth.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/tests/service/test_factory.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/tests/service/test_service_e2e.py +0 -0
- {langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/tests/service/test_utils.py +0 -0
{langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/.github/workflows/deploy.yml
RENAMED
|
@@ -5,16 +5,29 @@ on:
|
|
|
5
5
|
branches:
|
|
6
6
|
- main
|
|
7
7
|
workflow_dispatch:
|
|
8
|
+
inputs:
|
|
9
|
+
deploy_enabled:
|
|
10
|
+
description: 'Enable deployment (set to "true" to deploy)'
|
|
11
|
+
required: true
|
|
12
|
+
default: "false"
|
|
13
|
+
type: choice
|
|
14
|
+
options:
|
|
15
|
+
- "false"
|
|
16
|
+
- "true"
|
|
8
17
|
|
|
9
18
|
jobs:
|
|
10
19
|
test:
|
|
11
20
|
# Don't try to run deployment in forks and repo copies
|
|
12
|
-
if: github.repository == '
|
|
21
|
+
if: github.repository == 'kryvokhyzha/langgraph-agent-toolkit'
|
|
13
22
|
uses: ./.github/workflows/test.yml
|
|
14
23
|
|
|
15
24
|
build:
|
|
16
25
|
runs-on: ubuntu-latest
|
|
17
26
|
needs: [test]
|
|
27
|
+
# Skip build if not manually triggered with deploy_enabled=true
|
|
28
|
+
if:
|
|
29
|
+
github.event_name == 'workflow_dispatch' &&
|
|
30
|
+
github.event.inputs.deploy_enabled == 'true'
|
|
18
31
|
|
|
19
32
|
steps:
|
|
20
33
|
- uses: actions/checkout@v4
|
|
@@ -42,6 +55,8 @@ jobs:
|
|
|
42
55
|
deploy:
|
|
43
56
|
runs-on: ubuntu-latest
|
|
44
57
|
needs: build
|
|
58
|
+
# This job will only run if build job runs and succeeds
|
|
59
|
+
if: always() && needs.build.result == 'success'
|
|
45
60
|
|
|
46
61
|
steps:
|
|
47
62
|
- name: Deploy to Azure Web App
|
|
@@ -6,6 +6,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
6
6
|
and this project adheres to
|
|
7
7
|
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
8
8
|
|
|
9
|
+
## [0.4.4]
|
|
10
|
+
|
|
11
|
+
### Updated
|
|
12
|
+
|
|
13
|
+
- Project dependencies
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- Strucuted output and model factory
|
|
18
|
+
|
|
19
|
+
## [0.4.3]
|
|
20
|
+
|
|
21
|
+
### Updated
|
|
22
|
+
|
|
23
|
+
- Project dependencies
|
|
24
|
+
|
|
9
25
|
## [0.4.2]
|
|
10
26
|
|
|
11
27
|
### Fixed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: langgraph-agent-toolkit
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.4
|
|
4
4
|
Summary: Full toolkit for running an AI agent service built with LangGraph, FastAPI and Streamlit
|
|
5
5
|
Project-URL: documentation, https://kryvokhyzha.github.io/langgraph-agent-toolkit
|
|
6
6
|
Project-URL: repository, https://github.com/kryvokhyzha/langgraph-agent-toolkit
|
|
@@ -28,14 +28,14 @@ Requires-Dist: grpcio>=1.68.0
|
|
|
28
28
|
Requires-Dist: httpx~=0.28.1
|
|
29
29
|
Requires-Dist: jinja2~=3.1.6
|
|
30
30
|
Requires-Dist: jiter~=0.9.0
|
|
31
|
-
Requires-Dist: joblib
|
|
32
|
-
Requires-Dist: langchain-community~=0.3.
|
|
33
|
-
Requires-Dist: langchain-core~=0.3.
|
|
34
|
-
Requires-Dist: langgraph-checkpoint-postgres~=2.0.
|
|
35
|
-
Requires-Dist: langgraph-checkpoint-sqlite~=2.0.
|
|
36
|
-
Requires-Dist: langgraph-cli[inmem]~=0.2.
|
|
37
|
-
Requires-Dist: langgraph-supervisor~=0.0.
|
|
38
|
-
Requires-Dist: langgraph~=0.3
|
|
31
|
+
Requires-Dist: joblib>=1.4.2
|
|
32
|
+
Requires-Dist: langchain-community~=0.3.23
|
|
33
|
+
Requires-Dist: langchain-core~=0.3.59
|
|
34
|
+
Requires-Dist: langgraph-checkpoint-postgres~=2.0.21
|
|
35
|
+
Requires-Dist: langgraph-checkpoint-sqlite~=2.0.7
|
|
36
|
+
Requires-Dist: langgraph-cli[inmem]~=0.2.8
|
|
37
|
+
Requires-Dist: langgraph-supervisor~=0.0.21
|
|
38
|
+
Requires-Dist: langgraph~=0.4.3
|
|
39
39
|
Requires-Dist: loguru~=0.7.3
|
|
40
40
|
Requires-Dist: multidict>6.3.2
|
|
41
41
|
Requires-Dist: numpy~=1.26.4; python_version <= '3.12'
|
|
@@ -49,7 +49,7 @@ Requires-Dist: pyowm~=3.3.0
|
|
|
49
49
|
Requires-Dist: python-dotenv~=1.1.0
|
|
50
50
|
Requires-Dist: rootutils>=1.0.7
|
|
51
51
|
Requires-Dist: setuptools>=75.6.0
|
|
52
|
-
Requires-Dist: streamlit~=1.
|
|
52
|
+
Requires-Dist: streamlit~=1.45.0
|
|
53
53
|
Requires-Dist: uvicorn~=0.34.0
|
|
54
54
|
Requires-Dist: watchdog~=6.0.0
|
|
55
55
|
Provides-Extra: all-backends
|
|
@@ -65,7 +65,7 @@ Requires-Dist: langchain-google-genai~=2.1.4; extra == 'all-llms'
|
|
|
65
65
|
Requires-Dist: langchain-google-vertexai~=2.0.21; extra == 'all-llms'
|
|
66
66
|
Requires-Dist: langchain-groq~=0.3.2; extra == 'all-llms'
|
|
67
67
|
Requires-Dist: langchain-ollama~=0.3.2; extra == 'all-llms'
|
|
68
|
-
Requires-Dist: langchain-openai~=0.3.
|
|
68
|
+
Requires-Dist: langchain-openai~=0.3.16; extra == 'all-llms'
|
|
69
69
|
Provides-Extra: all-observability
|
|
70
70
|
Requires-Dist: langfuse~=2.60.3; extra == 'all-observability'
|
|
71
71
|
Requires-Dist: langsmith~=0.3.31; extra == 'all-observability'
|
|
@@ -95,13 +95,13 @@ Requires-Dist: langsmith~=0.3.31; extra == 'langsmith'
|
|
|
95
95
|
Provides-Extra: ollama
|
|
96
96
|
Requires-Dist: langchain-ollama~=0.3.2; extra == 'ollama'
|
|
97
97
|
Provides-Extra: openai
|
|
98
|
-
Requires-Dist: langchain-openai~=0.3.
|
|
98
|
+
Requires-Dist: langchain-openai~=0.3.16; extra == 'openai'
|
|
99
99
|
Provides-Extra: uvicorn-backend
|
|
100
100
|
Requires-Dist: uvicorn~=0.34.2; extra == 'uvicorn-backend'
|
|
101
101
|
Description-Content-Type: text/markdown
|
|
102
102
|
|
|
103
103
|
<div align="center">
|
|
104
|
-
<img alt="LangGraph Agent Toolkit Logo" src="https://
|
|
104
|
+
<img alt="LangGraph Agent Toolkit Logo" src="https://raw.githubusercontent.com/kryvokhyzha/langgraph-agent-toolkit/main/docs/media/logo.svg" width="300">
|
|
105
105
|
</div>
|
|
106
106
|
|
|
107
107
|
---
|
|
@@ -111,7 +111,7 @@ Description-Content-Type: text/markdown
|
|
|
111
111
|
| | |
|
|
112
112
|
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
113
113
|
| CI/Testing | [](https://github.com/kryvokhyzha/langgraph-agent-toolkit/actions/workflows/test.yml) [](https://github.com/kryvokhyzha/langgraph-agent-toolkit/actions/workflows/sphinx.yml) [](https://codecov.io/gh/kryvokhyzha/langgraph-agent-toolkit) |
|
|
114
|
-
| Package | [](https://pypi.org/project/langgraph-agent-toolkit/) [](https://pypi.org/project/langgraph-agent-toolkit/) [](https://pypi.org/project/langgraph-agent-toolkit/) [](https://pypi.org/project/langgraph-agent-toolkit/) [](https://github.com/kryvokhyzha/langgraph-agent-toolkit/blob/main/pyproject.toml) |
|
|
115
115
|
| Meta | [](https://github.com/astral-sh/ruff) [](https://github.com/kryvokhyzha/langgraph-agent-toolkit/blob/main/LICENSE) |
|
|
116
116
|
|
|
117
117
|
<!-- [](https://langgraph-agent-toolkit.streamlit.app/) -->
|
|
@@ -213,7 +213,7 @@ For detailed installation instructions and available extras, see the
|
|
|
213
213
|
|
|
214
214
|
## 🏗️ Architecture
|
|
215
215
|
|
|
216
|
-
<img src="https://
|
|
216
|
+
<img src="https://raw.githubusercontent.com/kryvokhyzha/langgraph-agent-toolkit/main/docs/media/agent_architecture.png" width="800">
|
|
217
217
|
|
|
218
218
|
<a name="key-features"></a>
|
|
219
219
|
|
|
@@ -284,11 +284,13 @@ Docker setup, using the AgentClient, and local development, see the
|
|
|
284
284
|
|
|
285
285
|
## 📚 Documentation
|
|
286
286
|
|
|
287
|
-
Full documentation is available
|
|
287
|
+
Full documentation is available at
|
|
288
|
+
[GitHub repository](https://github.com/kryvokhyzha/langgraph-agent-toolkit/tree/main/docs/)
|
|
289
|
+
and includes:
|
|
288
290
|
|
|
289
|
-
- [Installation Guide](docs/installation.rst)
|
|
290
|
-
- [Environment Setup](docs/environment_setup.rst)
|
|
291
|
-
- [Usage Guide](docs/usage.rst)
|
|
291
|
+
- [Installation Guide](https://github.com/kryvokhyzha/langgraph-agent-toolkit/blob/main/docs/installation.rst)
|
|
292
|
+
- [Environment Setup](https://github.com/kryvokhyzha/langgraph-agent-toolkit/blob/main/docs/environment_setup.rst)
|
|
293
|
+
- [Usage Guide](https://github.com/kryvokhyzha/langgraph-agent-toolkit/blob/main/docs/usage.rst)
|
|
292
294
|
|
|
293
295
|
<a name="useful-resources"></a>
|
|
294
296
|
|
|
@@ -297,6 +299,9 @@ Full documentation is available in the `docs/` directory and includes:
|
|
|
297
299
|
- [LangGraph documentation](https://langchain-ai.github.io/langgraph/concepts/low_level/#multiple-schemas)
|
|
298
300
|
- [LangGraph Memory Concept](https://langchain-ai.github.io/langgraph/concepts/memory/)
|
|
299
301
|
- [LangGraph Memory Persistence](https://langchain-ai.github.io/langgraph/concepts/persistence/#memory)
|
|
302
|
+
- [LangGraph 101 - blueprints](https://github.com/langchain-ai/langgraph-101)
|
|
303
|
+
- [LangGraph - Examples](https://github.com/langchain-ai/langgraph/tree/main/examples)
|
|
304
|
+
- [Complex data extraction with function calling](https://langchain-ai.github.io/langgraph/tutorials/extraction/retries/)
|
|
300
305
|
- [How to edit graph state](https://langchain-ai.github.io/langgraph/how-tos/human_in_the_loop/edit-graph-state/)
|
|
301
306
|
- [How to create tools in Langchain](https://python.langchain.com/docs/how_to/custom_tools/)
|
|
302
307
|
- [Simple Serverless FastAPI with AWS Lambda](https://www.deadbear.io/simple-serverless-fastapi-with-aws-lambda/)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<img alt="LangGraph Agent Toolkit Logo" src="https://
|
|
2
|
+
<img alt="LangGraph Agent Toolkit Logo" src="https://raw.githubusercontent.com/kryvokhyzha/langgraph-agent-toolkit/main/docs/media/logo.svg" width="300">
|
|
3
3
|
</div>
|
|
4
4
|
|
|
5
5
|
---
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
| | |
|
|
10
10
|
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
11
11
|
| CI/Testing | [](https://github.com/kryvokhyzha/langgraph-agent-toolkit/actions/workflows/test.yml) [](https://github.com/kryvokhyzha/langgraph-agent-toolkit/actions/workflows/sphinx.yml) [](https://codecov.io/gh/kryvokhyzha/langgraph-agent-toolkit) |
|
|
12
|
-
| Package | [](https://pypi.org/project/langgraph-agent-toolkit/) [](https://pypi.org/project/langgraph-agent-toolkit/) [](https://pypi.org/project/langgraph-agent-toolkit/) [](https://pypi.org/project/langgraph-agent-toolkit/) [](https://github.com/kryvokhyzha/langgraph-agent-toolkit/blob/main/pyproject.toml) |
|
|
13
13
|
| Meta | [](https://github.com/astral-sh/ruff) [](https://github.com/kryvokhyzha/langgraph-agent-toolkit/blob/main/LICENSE) |
|
|
14
14
|
|
|
15
15
|
<!-- [](https://langgraph-agent-toolkit.streamlit.app/) -->
|
|
@@ -111,7 +111,7 @@ For detailed installation instructions and available extras, see the
|
|
|
111
111
|
|
|
112
112
|
## 🏗️ Architecture
|
|
113
113
|
|
|
114
|
-
<img src="https://
|
|
114
|
+
<img src="https://raw.githubusercontent.com/kryvokhyzha/langgraph-agent-toolkit/main/docs/media/agent_architecture.png" width="800">
|
|
115
115
|
|
|
116
116
|
<a name="key-features"></a>
|
|
117
117
|
|
|
@@ -182,11 +182,13 @@ Docker setup, using the AgentClient, and local development, see the
|
|
|
182
182
|
|
|
183
183
|
## 📚 Documentation
|
|
184
184
|
|
|
185
|
-
Full documentation is available
|
|
185
|
+
Full documentation is available at
|
|
186
|
+
[GitHub repository](https://github.com/kryvokhyzha/langgraph-agent-toolkit/tree/main/docs/)
|
|
187
|
+
and includes:
|
|
186
188
|
|
|
187
|
-
- [Installation Guide](docs/installation.rst)
|
|
188
|
-
- [Environment Setup](docs/environment_setup.rst)
|
|
189
|
-
- [Usage Guide](docs/usage.rst)
|
|
189
|
+
- [Installation Guide](https://github.com/kryvokhyzha/langgraph-agent-toolkit/blob/main/docs/installation.rst)
|
|
190
|
+
- [Environment Setup](https://github.com/kryvokhyzha/langgraph-agent-toolkit/blob/main/docs/environment_setup.rst)
|
|
191
|
+
- [Usage Guide](https://github.com/kryvokhyzha/langgraph-agent-toolkit/blob/main/docs/usage.rst)
|
|
190
192
|
|
|
191
193
|
<a name="useful-resources"></a>
|
|
192
194
|
|
|
@@ -195,6 +197,9 @@ Full documentation is available in the `docs/` directory and includes:
|
|
|
195
197
|
- [LangGraph documentation](https://langchain-ai.github.io/langgraph/concepts/low_level/#multiple-schemas)
|
|
196
198
|
- [LangGraph Memory Concept](https://langchain-ai.github.io/langgraph/concepts/memory/)
|
|
197
199
|
- [LangGraph Memory Persistence](https://langchain-ai.github.io/langgraph/concepts/persistence/#memory)
|
|
200
|
+
- [LangGraph 101 - blueprints](https://github.com/langchain-ai/langgraph-101)
|
|
201
|
+
- [LangGraph - Examples](https://github.com/langchain-ai/langgraph/tree/main/examples)
|
|
202
|
+
- [Complex data extraction with function calling](https://langchain-ai.github.io/langgraph/tutorials/extraction/retries/)
|
|
198
203
|
- [How to edit graph state](https://langchain-ai.github.io/langgraph/how-tos/human_in_the_loop/edit-graph-state/)
|
|
199
204
|
- [How to create tools in Langchain](https://python.langchain.com/docs/how_to/custom_tools/)
|
|
200
205
|
- [Simple Serverless FastAPI with AWS Lambda](https://www.deadbear.io/simple-serverless-fastapi-with-aws-lambda/)
|
|
@@ -5,7 +5,10 @@ from pydantic import BaseModel, Field
|
|
|
5
5
|
from langgraph_agent_toolkit.agents.agent import Agent
|
|
6
6
|
from langgraph_agent_toolkit.agents.components.creators.create_react_agent import create_react_agent
|
|
7
7
|
from langgraph_agent_toolkit.agents.components.tools import add, multiply
|
|
8
|
-
from langgraph_agent_toolkit.agents.components.utils import
|
|
8
|
+
from langgraph_agent_toolkit.agents.components.utils import (
|
|
9
|
+
AgentStateWithStructuredResponseAndRemainingSteps,
|
|
10
|
+
pre_model_hook_standard,
|
|
11
|
+
)
|
|
9
12
|
from langgraph_agent_toolkit.core import settings
|
|
10
13
|
from langgraph_agent_toolkit.core.models.factory import ModelFactory
|
|
11
14
|
from langgraph_agent_toolkit.schema.models import ModelProvider
|
|
@@ -37,8 +40,8 @@ react_agent_so = Agent(
|
|
|
37
40
|
"You can also ask clarifying questions to the user. "
|
|
38
41
|
),
|
|
39
42
|
pre_model_hook=pre_model_hook_standard,
|
|
40
|
-
response_format=ResponseSchema,
|
|
41
|
-
state_schema=
|
|
43
|
+
# response_format=ResponseSchema,
|
|
44
|
+
state_schema=AgentStateWithStructuredResponseAndRemainingSteps,
|
|
42
45
|
checkpointer=MemorySaver(),
|
|
43
46
|
immediate_step_threshold=5,
|
|
44
47
|
),
|
|
@@ -10,6 +10,7 @@ from typing import (
|
|
|
10
10
|
get_type_hints,
|
|
11
11
|
)
|
|
12
12
|
|
|
13
|
+
from langchain.chat_models.base import _ConfigurableModel
|
|
13
14
|
from langchain_core.language_models import (
|
|
14
15
|
BaseChatModel,
|
|
15
16
|
LanguageModelInput,
|
|
@@ -24,16 +25,17 @@ from langchain_core.messages import (
|
|
|
24
25
|
)
|
|
25
26
|
from langchain_core.runnables import (
|
|
26
27
|
Runnable,
|
|
28
|
+
RunnableBinding,
|
|
27
29
|
RunnableConfig,
|
|
30
|
+
RunnableSequence,
|
|
28
31
|
)
|
|
29
32
|
from langchain_core.tools import BaseTool
|
|
30
|
-
from langgraph.graph import END, StateGraph
|
|
33
|
+
from langgraph.graph import END, START, StateGraph
|
|
31
34
|
from langgraph.graph.graph import CompiledGraph
|
|
32
35
|
from langgraph.prebuilt.chat_agent_executor import (
|
|
33
36
|
AgentState,
|
|
34
37
|
AgentStateWithStructuredResponse,
|
|
35
38
|
StructuredResponseSchema,
|
|
36
|
-
_get_model,
|
|
37
39
|
_get_prompt_runnable,
|
|
38
40
|
_get_state_value,
|
|
39
41
|
_should_bind_tools,
|
|
@@ -45,6 +47,30 @@ from langgraph.types import Checkpointer, Send
|
|
|
45
47
|
from langgraph.utils.runnable import RunnableCallable, RunnableLike
|
|
46
48
|
from pydantic import BaseModel
|
|
47
49
|
|
|
50
|
+
from langgraph_agent_toolkit.agents.components.utils import default_pre_model_hook
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def _get_model(model: LanguageModelLike, config: RunnableConfig) -> BaseChatModel:
|
|
54
|
+
"""Get the underlying model from a RunnableBinding or return the model itself."""
|
|
55
|
+
if isinstance(model, _ConfigurableModel):
|
|
56
|
+
return model._model(config)
|
|
57
|
+
|
|
58
|
+
if isinstance(model, RunnableSequence):
|
|
59
|
+
model = next(
|
|
60
|
+
(step for step in model.steps if isinstance(step, (RunnableBinding, BaseChatModel))),
|
|
61
|
+
model,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
if isinstance(model, RunnableBinding):
|
|
65
|
+
model = model.bound
|
|
66
|
+
|
|
67
|
+
if not isinstance(model, BaseChatModel):
|
|
68
|
+
raise TypeError(
|
|
69
|
+
f"Expected `model` to be a ChatModel or RunnableBinding (e.g. model.bind_tools(...)), got {type(model)}"
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
return model
|
|
73
|
+
|
|
48
74
|
|
|
49
75
|
def create_react_agent(
|
|
50
76
|
model: Union[str, LanguageModelLike],
|
|
@@ -64,8 +90,8 @@ def create_react_agent(
|
|
|
64
90
|
debug: bool = False,
|
|
65
91
|
version: Literal["v1", "v2"] = "v1",
|
|
66
92
|
name: Optional[str] = None,
|
|
67
|
-
immediate_step_threshold: int = 5,
|
|
68
|
-
immediate_generation_prompt: Optional[str] = None,
|
|
93
|
+
immediate_step_threshold: int = 5,
|
|
94
|
+
immediate_generation_prompt: Optional[str] = None,
|
|
69
95
|
) -> CompiledGraph:
|
|
70
96
|
"""Create a graph that works with a chat model that utilizes tool calling with an additional router.
|
|
71
97
|
|
|
@@ -230,7 +256,7 @@ def create_react_agent(
|
|
|
230
256
|
prompt_with_instruction = [immediate_prompt] + list(messages)
|
|
231
257
|
|
|
232
258
|
# Use the model directly without tool calling capabilities
|
|
233
|
-
base_model = _get_model(model)
|
|
259
|
+
base_model = _get_model(model, config)
|
|
234
260
|
response = cast(AIMessage, base_model.invoke(prompt_with_instruction, config))
|
|
235
261
|
response.name = name
|
|
236
262
|
|
|
@@ -248,7 +274,7 @@ def create_react_agent(
|
|
|
248
274
|
messages = _get_state_value(state, "messages")
|
|
249
275
|
prompt_with_instruction = [immediate_prompt] + list(messages)
|
|
250
276
|
|
|
251
|
-
base_model = _get_model(model)
|
|
277
|
+
base_model = _get_model(model, config)
|
|
252
278
|
# Fix: Use ainvoke instead of invoke for async function
|
|
253
279
|
response = cast(AIMessage, await base_model.ainvoke(prompt_with_instruction, config))
|
|
254
280
|
response.name = name
|
|
@@ -292,7 +318,7 @@ def create_react_agent(
|
|
|
292
318
|
system_prompt, structured_response_schema = response_format
|
|
293
319
|
messages = [SystemMessage(content=system_prompt)] + list(messages)
|
|
294
320
|
|
|
295
|
-
model_with_structured_output = _get_model(model).with_structured_output(
|
|
321
|
+
model_with_structured_output = _get_model(model, config).with_structured_output(
|
|
296
322
|
cast(StructuredResponseSchema, structured_response_schema)
|
|
297
323
|
)
|
|
298
324
|
response = model_with_structured_output.invoke(messages, config)
|
|
@@ -305,12 +331,16 @@ def create_react_agent(
|
|
|
305
331
|
system_prompt, structured_response_schema = response_format
|
|
306
332
|
messages = [SystemMessage(content=system_prompt)] + list(messages)
|
|
307
333
|
|
|
308
|
-
model_with_structured_output = _get_model(model).with_structured_output(
|
|
334
|
+
model_with_structured_output = _get_model(model, config).with_structured_output(
|
|
309
335
|
cast(StructuredResponseSchema, structured_response_schema)
|
|
310
336
|
)
|
|
311
337
|
response = await model_with_structured_output.ainvoke(messages, config)
|
|
312
338
|
return {"structured_response": response}
|
|
313
339
|
|
|
340
|
+
# Use default_pre_model_hook if pre_model_hook is None
|
|
341
|
+
if pre_model_hook is None:
|
|
342
|
+
pre_model_hook = default_pre_model_hook
|
|
343
|
+
|
|
314
344
|
if not tool_calling_enabled:
|
|
315
345
|
# Define a new graph
|
|
316
346
|
workflow = StateGraph(state_schema, config_schema=config_schema)
|
|
@@ -328,16 +358,14 @@ def create_react_agent(
|
|
|
328
358
|
input=input_schema,
|
|
329
359
|
)
|
|
330
360
|
|
|
331
|
-
#
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
workflow.add_conditional_edges("START", router_condition, ["agent", "immediate_generation"])
|
|
340
|
-
entrypoint = "START"
|
|
361
|
+
# Always add pre_model_hook
|
|
362
|
+
workflow.add_node("pre_model_hook", pre_model_hook)
|
|
363
|
+
|
|
364
|
+
# Route pre_model_hook directly to either agent or immediate_generation based on condition
|
|
365
|
+
workflow.add_conditional_edges("pre_model_hook", router_condition, ["agent", "immediate_generation"])
|
|
366
|
+
|
|
367
|
+
# Always set START as entry point
|
|
368
|
+
workflow.add_edge(START, "pre_model_hook")
|
|
341
369
|
|
|
342
370
|
# Connect both agent and immediate_generation to END or structured response
|
|
343
371
|
if response_format is not None:
|
|
@@ -352,8 +380,6 @@ def create_react_agent(
|
|
|
352
380
|
workflow.add_edge("agent", END)
|
|
353
381
|
workflow.add_edge("immediate_generation", END)
|
|
354
382
|
|
|
355
|
-
workflow.set_entry_point(entrypoint)
|
|
356
|
-
|
|
357
383
|
return workflow.compile(
|
|
358
384
|
checkpointer=checkpointer,
|
|
359
385
|
store=store,
|
|
@@ -379,10 +405,7 @@ def create_react_agent(
|
|
|
379
405
|
if version == "v1":
|
|
380
406
|
return "tools"
|
|
381
407
|
elif version == "v2":
|
|
382
|
-
tool_calls = [
|
|
383
|
-
tool_node.inject_tool_args(call, state, store) # type: ignore[arg-type]
|
|
384
|
-
for call in last_message.tool_calls
|
|
385
|
-
]
|
|
408
|
+
tool_calls = [tool_node.inject_tool_args(call, state, store) for call in last_message.tool_calls]
|
|
386
409
|
return [Send("tools", [tool_call]) for tool_call in tool_calls]
|
|
387
410
|
|
|
388
411
|
# Define a new graph
|
|
@@ -395,19 +418,14 @@ def create_react_agent(
|
|
|
395
418
|
)
|
|
396
419
|
workflow.add_node("tools", tool_node)
|
|
397
420
|
|
|
398
|
-
#
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
entrypoint = "pre_model_hook"
|
|
404
|
-
else:
|
|
405
|
-
# If no pre_model_hook, use START as the conditional router
|
|
406
|
-
workflow.add_conditional_edges("START", router_condition, ["agent", "immediate_generation"])
|
|
407
|
-
entrypoint = "START"
|
|
421
|
+
# Always add pre_model_hook node
|
|
422
|
+
workflow.add_node("pre_model_hook", pre_model_hook)
|
|
423
|
+
|
|
424
|
+
# Route pre_model_hook to either agent or immediate_generation based on condition
|
|
425
|
+
workflow.add_conditional_edges("pre_model_hook", router_condition, ["agent", "immediate_generation"])
|
|
408
426
|
|
|
409
|
-
# Set the
|
|
410
|
-
workflow.
|
|
427
|
+
# Set START as the entry point and route to pre_model_hook
|
|
428
|
+
workflow.add_edge(START, "pre_model_hook")
|
|
411
429
|
|
|
412
430
|
# Add structured output node if response_format is provided
|
|
413
431
|
if response_format is not None:
|
|
@@ -436,21 +454,14 @@ def create_react_agent(
|
|
|
436
454
|
if m.name in should_return_direct:
|
|
437
455
|
return END
|
|
438
456
|
|
|
439
|
-
# After tools, go
|
|
440
|
-
return "pre_model_hook"
|
|
457
|
+
# After tools, always go to pre_model_hook
|
|
458
|
+
return "pre_model_hook"
|
|
441
459
|
|
|
442
460
|
if should_return_direct:
|
|
443
|
-
|
|
444
|
-
if pre_model_hook is not None:
|
|
445
|
-
destinations.append("pre_model_hook")
|
|
446
|
-
else:
|
|
447
|
-
destinations.append("START")
|
|
448
|
-
|
|
449
|
-
destinations.append(END)
|
|
450
|
-
workflow.add_conditional_edges("tools", route_tool_responses, destinations)
|
|
461
|
+
workflow.add_conditional_edges("tools", route_tool_responses, ["pre_model_hook", END])
|
|
451
462
|
else:
|
|
452
|
-
# After tools, go
|
|
453
|
-
workflow.add_edge("tools", "pre_model_hook"
|
|
463
|
+
# After tools, always go to pre_model_hook
|
|
464
|
+
workflow.add_edge("tools", "pre_model_hook")
|
|
454
465
|
|
|
455
466
|
# Finally, we compile it!
|
|
456
467
|
return workflow.compile(
|
|
@@ -3,7 +3,7 @@ from typing import TypeVar
|
|
|
3
3
|
from langchain_core.messages.utils import trim_messages
|
|
4
4
|
from langchain_core.runnables import RunnableConfig
|
|
5
5
|
from langgraph.managed.is_last_step import RemainingSteps
|
|
6
|
-
from langgraph.prebuilt.chat_agent_executor import AgentState
|
|
6
|
+
from langgraph.prebuilt.chat_agent_executor import AgentState, AgentStateWithStructuredResponse
|
|
7
7
|
|
|
8
8
|
from langgraph_agent_toolkit.helper.constants import DEFAULT_MAX_MESSAGE_HISTORY_LENGTH
|
|
9
9
|
|
|
@@ -15,6 +15,10 @@ class AgentStateWithRemainingSteps(AgentState):
|
|
|
15
15
|
remaining_steps: RemainingSteps
|
|
16
16
|
|
|
17
17
|
|
|
18
|
+
class AgentStateWithStructuredResponseAndRemainingSteps(AgentStateWithStructuredResponse):
|
|
19
|
+
remaining_steps: RemainingSteps
|
|
20
|
+
|
|
21
|
+
|
|
18
22
|
def pre_model_hook_standard(state: T, config: RunnableConfig):
|
|
19
23
|
# https://langchain-ai.github.io/langgraph/how-tos/create-react-agent-manage-message-history/
|
|
20
24
|
# if last message is a human message, trim the messages to only include human messages
|
|
@@ -40,3 +44,7 @@ def pre_model_hook_standard(state: T, config: RunnableConfig):
|
|
|
40
44
|
)
|
|
41
45
|
|
|
42
46
|
return {"llm_input_messages": updated_messages}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def default_pre_model_hook(state: T, config: RunnableConfig) -> T:
|
|
50
|
+
return state
|
|
@@ -13,6 +13,7 @@ from typing import (
|
|
|
13
13
|
|
|
14
14
|
from langchain.chat_models.base import _ConfigurableModel, _init_chat_model_helper
|
|
15
15
|
from langchain_core.language_models import BaseChatModel
|
|
16
|
+
from langchain_core.runnables import Runnable, RunnableConfig
|
|
16
17
|
from typing_extensions import TypeAlias
|
|
17
18
|
|
|
18
19
|
from langgraph_agent_toolkit.core.models import ChatOpenAIPatched, FakeToolModel
|
|
@@ -27,11 +28,20 @@ from langgraph_agent_toolkit.schema.models import ModelProvider
|
|
|
27
28
|
ModelT: TypeAlias = FakeToolModel | _ConfigurableModel | BaseChatModel
|
|
28
29
|
|
|
29
30
|
|
|
31
|
+
class _ConfigurableModelCustom(_ConfigurableModel):
|
|
32
|
+
def _model(self, config: Optional[RunnableConfig] = None) -> Runnable:
|
|
33
|
+
params = {**self._default_config, **self._model_params(config)}
|
|
34
|
+
model = ModelFactory._init_chat_model_helper(**params)
|
|
35
|
+
for name, args, kwargs in self._queued_declarative_operations:
|
|
36
|
+
model = getattr(model, name)(*args, **kwargs)
|
|
37
|
+
return model
|
|
38
|
+
|
|
39
|
+
|
|
30
40
|
class ModelFactory:
|
|
31
41
|
"""Factory for creating model instances."""
|
|
32
42
|
|
|
33
43
|
@staticmethod
|
|
34
|
-
def
|
|
44
|
+
def _init_chat_model_helper(model: str, *, model_provider: Optional[str] = None, **kwargs: Any) -> BaseChatModel:
|
|
35
45
|
if model_provider == "openai":
|
|
36
46
|
return ChatOpenAIPatched(model_name=model, **kwargs)
|
|
37
47
|
else:
|
|
@@ -58,13 +68,13 @@ class ModelFactory:
|
|
|
58
68
|
)
|
|
59
69
|
|
|
60
70
|
if not configurable_fields:
|
|
61
|
-
return ModelFactory.
|
|
71
|
+
return ModelFactory._init_chat_model_helper(cast(str, model), model_provider=model_provider, **kwargs)
|
|
62
72
|
else:
|
|
63
73
|
if model:
|
|
64
74
|
kwargs["model"] = model
|
|
65
75
|
if model_provider:
|
|
66
76
|
kwargs["model_provider"] = model_provider
|
|
67
|
-
return
|
|
77
|
+
return _ConfigurableModelCustom(
|
|
68
78
|
default_config=kwargs,
|
|
69
79
|
config_prefix=config_prefix,
|
|
70
80
|
configurable_fields=configurable_fields,
|
|
@@ -97,7 +107,7 @@ class ModelFactory:
|
|
|
97
107
|
ValueError: If the requested model is not supported
|
|
98
108
|
|
|
99
109
|
""" # noqa: E501
|
|
100
|
-
_configurable_fields = configurable_fields
|
|
110
|
+
_configurable_fields = DEFAULT_CONFIGURABLE_FIELDS if configurable_fields is None else configurable_fields
|
|
101
111
|
_config_prefix = config_prefix or DEFAULT_CONFIG_PREFIX
|
|
102
112
|
_model_parameter_values = model_parameter_values or DEFAULT_MODEL_PARAMETER_VALUES
|
|
103
113
|
|
|
@@ -76,6 +76,7 @@ class Settings(BaseSettings):
|
|
|
76
76
|
AGENT_PATHS: list[str] = [
|
|
77
77
|
"langgraph_agent_toolkit.agents.blueprints.react.agent:react_agent",
|
|
78
78
|
"langgraph_agent_toolkit.agents.blueprints.chatbot.agent:chatbot_agent",
|
|
79
|
+
"langgraph_agent_toolkit.agents.blueprints.react_so.agent:react_agent_so",
|
|
79
80
|
]
|
|
80
81
|
|
|
81
82
|
LANGCHAIN_TRACING_V2: bool = False
|
{langgraph_agent_toolkit-0.4.2 → langgraph_agent_toolkit-0.4.4}/langgraph_agent_toolkit/run_agent.py
RENAMED
|
@@ -2,12 +2,19 @@ import asyncio
|
|
|
2
2
|
import random
|
|
3
3
|
from uuid import UUID
|
|
4
4
|
|
|
5
|
+
import rootutils
|
|
5
6
|
from dotenv import find_dotenv, load_dotenv
|
|
6
7
|
from langchain_core.runnables import RunnableConfig
|
|
7
8
|
from langfuse.callback import CallbackHandler
|
|
8
9
|
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
_ = rootutils.setup_root(
|
|
12
|
+
search_from=__file__,
|
|
13
|
+
indicator=".project-root",
|
|
14
|
+
pythonpath=True,
|
|
15
|
+
dotenv=False,
|
|
16
|
+
)
|
|
17
|
+
load_dotenv(find_dotenv(".local.env"), override=True)
|
|
11
18
|
|
|
12
19
|
from langgraph_agent_toolkit.agents.agent_executor import AgentExecutor
|
|
13
20
|
from langgraph_agent_toolkit.core.settings import settings
|
|
@@ -47,7 +54,7 @@ async def main() -> None:
|
|
|
47
54
|
),
|
|
48
55
|
)
|
|
49
56
|
logger.info(result.keys())
|
|
50
|
-
logger.info(result)
|
|
57
|
+
# logger.info(result)
|
|
51
58
|
|
|
52
59
|
try:
|
|
53
60
|
result["messages"][-1].pretty_print()
|
|
@@ -24,6 +24,7 @@ def run_service(
|
|
|
24
24
|
custom_settings=dict(
|
|
25
25
|
AGENT_PATHS=[
|
|
26
26
|
"langgraph_agent_toolkit.agents.blueprints.react.agent:react_agent",
|
|
27
|
+
"langgraph_agent_toolkit.agents.blueprints.react_so.agent:react_agent_so",
|
|
27
28
|
"langgraph_agent_toolkit.agents.blueprints.supervisor_agent.agent:supervisor_agent",
|
|
28
29
|
"langgraph_agent_toolkit.agents.blueprints.chatbot.agent:chatbot_agent",
|
|
29
30
|
]
|