langgraph-agent-toolkit 0.3.0__tar.gz → 0.4.0__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.3.0 → langgraph_agent_toolkit-0.4.0}/.gitignore +1 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/CHANGELOG.md +26 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/Makefile +0 -8
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/PKG-INFO +17 -9
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/README.md +7 -5
- langgraph_agent_toolkit-0.4.0/docker/service/Dockerfile +32 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/agents/components/creators/create_react_agent.py +4 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/run_service.py +20 -3
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/schema/__init__.py +8 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/schema/schema.py +101 -2
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/service/factory.py +57 -38
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/service/handler.py +6 -1
- langgraph_agent_toolkit-0.4.0/langgraph_agent_toolkit/service/routes.py +356 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/service/utils.py +9 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/pyproject.toml +22 -7
- langgraph_agent_toolkit-0.4.0/scripts/python/07-test-get-chat-history.py +55 -0
- langgraph_agent_toolkit-0.4.0/scripts/python/08-test-update-chat-history.py +58 -0
- langgraph_agent_toolkit-0.4.0/scripts/python/09-test-clear-chat-history.py +57 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/tests/service/test_factory.py +20 -13
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/tests/service/test_service.py +8 -5
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/uv.lock +36 -6
- langgraph_agent_toolkit-0.3.0/docker/service/Dockerfile +0 -16
- langgraph_agent_toolkit-0.3.0/langgraph_agent_toolkit/service/routes.py +0 -177
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/.coveragerc +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/.dockerignore +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/.env.example +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/.github/RELEASE_TEMPLATE/release-template.md +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/.github/codecov.yml +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/.github/dependabot.yml +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/.github/scripts/tag_from_pyproject.sh +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/.github/workflows/deploy.yml +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/.github/workflows/release.yml +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/.github/workflows/test.yml +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/.pre-commit-config.yaml +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/.project-root +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/CONTRIBUTING.md +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/LICENSE +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/configs/clickhouse/.clickhouse.env.example +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/configs/langfuse/.langfuse.env.example +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/configs/litellm/.litellm.env.example +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/configs/litellm/config.example.yaml +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/configs/minio/.minio.env.example +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/configs/postgres/.postgres.env.example +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/configs/redis/.redis.env.example +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/docker/app/Dockerfile +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/docker-compose.yaml +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/docs/media/agent_architecture.excalidraw +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/docs/media/agent_architecture.png +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/docs/media/agent_diagram.png +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph.json +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/__init__.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/agents/__init__.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/agents/agent.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/agents/agent_executor.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/agents/blueprints/__init__.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/agents/blueprints/bg_task_agent/__init__.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/agents/blueprints/bg_task_agent/agent.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/agents/blueprints/bg_task_agent/task.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/agents/blueprints/bg_task_agent/utils.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/agents/blueprints/chatbot/__init__.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/agents/blueprints/chatbot/agent.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/agents/blueprints/command_agent/__init__.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/agents/blueprints/command_agent/agent.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/agents/blueprints/interrupt_agent/__init__.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/agents/blueprints/interrupt_agent/agent.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/agents/blueprints/knowledge_base_agent/__init__.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/agents/blueprints/knowledge_base_agent/agent.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/agents/blueprints/react/__init__.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/agents/blueprints/react/agent.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/agents/blueprints/react_so/__init__.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/agents/blueprints/react_so/agent.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/agents/blueprints/supervisor_agent/__init__.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/agents/blueprints/supervisor_agent/agent.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/agents/components/__init__.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/agents/components/creators/__init__.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/agents/components/tools.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/agents/components/utils.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/client/__init__.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/client/client.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/core/__init__.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/core/memory/__init__.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/core/memory/base.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/core/memory/factory.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/core/memory/postgres.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/core/memory/sqlite.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/core/memory/types.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/core/models/__init__.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/core/models/chat_openai.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/core/models/factory.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/core/models/fake.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/core/observability/__init__.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/core/observability/base.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/core/observability/empty.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/core/observability/factory.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/core/observability/langfuse.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/core/observability/langsmith.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/core/observability/types.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/core/prompts/__init__.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/core/prompts/chat_prompt_template.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/core/settings.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/helper/__init__.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/helper/constants.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/helper/logging.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/helper/types.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/helper/utils.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/run_agent.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/run_client.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/schema/models.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/schema/task_data.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/service/__init__.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/service/exception_handlers.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/service/middleware.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/service/types.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/langgraph_agent_toolkit/streamlit_app.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/scripts/postgres-init/create_databases.sql +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/scripts/python/01-invoke-proxy.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/scripts/python/02-test-local-pm.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/scripts/python/03-test-langfuse-pm.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/scripts/python/04-test-langsmith-pm.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/scripts/python/05-test-prompt-types.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/scripts/python/06-test-custom-chat-prompt-template.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/tests/agents/test_agent_executor.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/tests/agents/test_service_streaming.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/tests/app/conftest.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/tests/app/test_streamlit_app.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/tests/client/conftest.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/tests/client/test_client.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/tests/conftest.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/tests/core/test_llm.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/tests/core/test_memory.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/tests/core/test_observability.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/tests/core/test_prompts.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/tests/core/test_settings.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/tests/integration/test_docker_e2e.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/tests/service/conftest.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/tests/service/test_auth.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/tests/service/test_service_e2e.py +0 -0
- {langgraph_agent_toolkit-0.3.0 → langgraph_agent_toolkit-0.4.0}/tests/service/test_utils.py +0 -0
|
@@ -6,6 +6,32 @@ 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.0]
|
|
10
|
+
|
|
11
|
+
### Updated
|
|
12
|
+
|
|
13
|
+
- Endpoints
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- Endpoint to clear history
|
|
18
|
+
- Add new message to the history
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- Minor fixes and refactoring
|
|
23
|
+
|
|
24
|
+
## [0.3.1]
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
|
|
28
|
+
- Ability to pass parameters to service runner
|
|
29
|
+
- Argument to select service runner
|
|
30
|
+
|
|
31
|
+
### Updated
|
|
32
|
+
|
|
33
|
+
- Service Dockerfile
|
|
34
|
+
|
|
9
35
|
## [0.3.0]
|
|
10
36
|
|
|
11
37
|
### Added
|
|
@@ -16,14 +16,6 @@ uv_build_wheel:
|
|
|
16
16
|
uv build --wheel
|
|
17
17
|
|
|
18
18
|
# Install deployment dependencies (includes core dependencies + specified extras)
|
|
19
|
-
uv_install_aws:
|
|
20
|
-
uv sync --extras "aws" --no-install-project
|
|
21
|
-
uv_install_azure:
|
|
22
|
-
uv sync --extras "azure" --no-install-project
|
|
23
|
-
uv_install_gunicorn:
|
|
24
|
-
uv sync --extras "gunicorn" --no-install-project
|
|
25
|
-
uv_install_uvicorn:
|
|
26
|
-
uv sync --extras "uvicorn" --no-install-project
|
|
27
19
|
uv_install_deploy_all:
|
|
28
20
|
uv sync --extras "deploy-all" --no-install-project
|
|
29
21
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: langgraph-agent-toolkit
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Full toolkit for running an AI agent service built with LangGraph, FastAPI and Streamlit
|
|
5
5
|
Project-URL: repository, https://github.com/kryvokhyzha/langgraph-agent-toolkit
|
|
6
6
|
Project-URL: PyPI, https://pypi.org/project/langgraph-agent-toolkit
|
|
7
|
-
Author-email: Roman Kryvokhyzha <kriwohizha@gmail.com>
|
|
7
|
+
Author-email: Roman Kryvokhyzha <kriwohizha@gmail.com>, Joshua Carroll <carroll.joshk@gmail.com>
|
|
8
8
|
License-Expression: MIT
|
|
9
9
|
License-File: LICENSE
|
|
10
10
|
Keywords: agents,blueprint,fastapi,langgraph,litellm,streamlit
|
|
@@ -22,6 +22,7 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
|
22
22
|
Requires-Python: <3.14,>=3.11
|
|
23
23
|
Requires-Dist: duckduckgo-search>=7.3.0
|
|
24
24
|
Requires-Dist: fastapi~=0.115.5
|
|
25
|
+
Requires-Dist: fire~=0.7.0
|
|
25
26
|
Requires-Dist: grpcio>=1.68.0
|
|
26
27
|
Requires-Dist: httpx~=0.28.1
|
|
27
28
|
Requires-Dist: jinja2~=3.1.6
|
|
@@ -29,13 +30,11 @@ Requires-Dist: jiter~=0.9.0
|
|
|
29
30
|
Requires-Dist: joblib~=1.4.2
|
|
30
31
|
Requires-Dist: langchain-community~=0.3.21
|
|
31
32
|
Requires-Dist: langchain-core~=0.3.52
|
|
32
|
-
Requires-Dist: langfuse~=2.60.3
|
|
33
33
|
Requires-Dist: langgraph-checkpoint-postgres~=2.0.19
|
|
34
34
|
Requires-Dist: langgraph-checkpoint-sqlite~=2.0.6
|
|
35
35
|
Requires-Dist: langgraph-cli[inmem]~=0.2.3
|
|
36
36
|
Requires-Dist: langgraph-supervisor~=0.0.16
|
|
37
37
|
Requires-Dist: langgraph~=0.3.30
|
|
38
|
-
Requires-Dist: langsmith~=0.3.31
|
|
39
38
|
Requires-Dist: loguru~=0.7.3
|
|
40
39
|
Requires-Dist: multidict>6.3.2
|
|
41
40
|
Requires-Dist: numpy~=1.26.4; python_version <= '3.12'
|
|
@@ -66,6 +65,9 @@ Requires-Dist: langchain-google-vertexai~=2.0.21; extra == 'all-llms'
|
|
|
66
65
|
Requires-Dist: langchain-groq~=0.3.2; extra == 'all-llms'
|
|
67
66
|
Requires-Dist: langchain-ollama~=0.3.2; extra == 'all-llms'
|
|
68
67
|
Requires-Dist: langchain-openai~=0.3.12; extra == 'all-llms'
|
|
68
|
+
Provides-Extra: all-observability
|
|
69
|
+
Requires-Dist: langfuse~=2.60.3; extra == 'all-observability'
|
|
70
|
+
Requires-Dist: langsmith~=0.3.31; extra == 'all-observability'
|
|
69
71
|
Provides-Extra: anthropic
|
|
70
72
|
Requires-Dist: langchain-anthropic~=0.3.12; extra == 'anthropic'
|
|
71
73
|
Provides-Extra: aws
|
|
@@ -85,6 +87,10 @@ Requires-Dist: langchain-groq~=0.3.2; extra == 'groq'
|
|
|
85
87
|
Provides-Extra: gunicorn-backend
|
|
86
88
|
Requires-Dist: gunicorn~=23.0.0; extra == 'gunicorn-backend'
|
|
87
89
|
Requires-Dist: uvicorn[standard]~=0.34.2; extra == 'gunicorn-backend'
|
|
90
|
+
Provides-Extra: langfuse
|
|
91
|
+
Requires-Dist: langfuse~=2.60.3; extra == 'langfuse'
|
|
92
|
+
Provides-Extra: langsmith
|
|
93
|
+
Requires-Dist: langsmith~=0.3.31; extra == 'langsmith'
|
|
88
94
|
Provides-Extra: ollama
|
|
89
95
|
Requires-Dist: langchain-ollama~=0.3.2; extra == 'ollama'
|
|
90
96
|
Provides-Extra: openai
|
|
@@ -189,14 +195,14 @@ just the dependencies you need:
|
|
|
189
195
|
|
|
190
196
|
```sh
|
|
191
197
|
# LLM Provider Extras
|
|
192
|
-
pip install "langgraph-agent-toolkit[openai,uvicorn-backend]"
|
|
193
|
-
pip install "langgraph-agent-toolkit[anthropic,aws-backend]"
|
|
198
|
+
pip install "langgraph-agent-toolkit[openai,uvicorn-backend,langfuse]" # OpenAI, Uvicorn backend, and Langfuse observability
|
|
199
|
+
pip install "langgraph-agent-toolkit[anthropic,aws-backend,langsmith]" # Anthropic, AWS Lambda backend, and Langsmith observability
|
|
194
200
|
|
|
195
201
|
# Also available: google-vertexai, aws, ollama, groq, deepseek
|
|
196
|
-
pip install "langgraph-agent-toolkit[all-llms,
|
|
202
|
+
pip install "langgraph-agent-toolkit[all-llms,all-backends,all-observability]" # All LLM providers, all backends, and all observability platforms
|
|
197
203
|
|
|
198
204
|
# Client-Only Installation
|
|
199
|
-
pip install "langgraph-agent-toolkit[client]"
|
|
205
|
+
pip install "langgraph-agent-toolkit[client]" # Just the client and Streamlit app
|
|
200
206
|
```
|
|
201
207
|
|
|
202
208
|
<a name="architecture"></a>
|
|
@@ -222,7 +228,7 @@ pip install "langgraph-agent-toolkit[client]" # Just the
|
|
|
222
228
|
- Available agents and models listed at `/info` endpoint
|
|
223
229
|
- Supports different runners:
|
|
224
230
|
- unicorn
|
|
225
|
-
-
|
|
231
|
+
- gunicorn
|
|
226
232
|
- ⚠️ mangum (AWS Lambda) - _experimental_
|
|
227
233
|
- ⚠️ azure functions - _experimental_
|
|
228
234
|
|
|
@@ -557,6 +563,8 @@ The project works with
|
|
|
557
563
|
|
|
558
564
|
- [LangGraph documentation](https://langchain-ai.github.io/langgraph/concepts/low_level/#multiple-schemas)
|
|
559
565
|
- [LangGraph Memory Concept](https://langchain-ai.github.io/langgraph/concepts/memory/)
|
|
566
|
+
- [LangGraph Memory Persistence](https://langchain-ai.github.io/langgraph/concepts/persistence/#memory)
|
|
567
|
+
- [How to edit graph state](https://langchain-ai.github.io/langgraph/how-tos/human_in_the_loop/edit-graph-state/)
|
|
560
568
|
- [How to create tools in Langchain](https://python.langchain.com/docs/how_to/custom_tools/)
|
|
561
569
|
- [Simple Serverless FastAPI with AWS Lambda](https://www.deadbear.io/simple-serverless-fastapi-with-aws-lambda/)
|
|
562
570
|
|
|
@@ -94,14 +94,14 @@ just the dependencies you need:
|
|
|
94
94
|
|
|
95
95
|
```sh
|
|
96
96
|
# LLM Provider Extras
|
|
97
|
-
pip install "langgraph-agent-toolkit[openai,uvicorn-backend]"
|
|
98
|
-
pip install "langgraph-agent-toolkit[anthropic,aws-backend]"
|
|
97
|
+
pip install "langgraph-agent-toolkit[openai,uvicorn-backend,langfuse]" # OpenAI, Uvicorn backend, and Langfuse observability
|
|
98
|
+
pip install "langgraph-agent-toolkit[anthropic,aws-backend,langsmith]" # Anthropic, AWS Lambda backend, and Langsmith observability
|
|
99
99
|
|
|
100
100
|
# Also available: google-vertexai, aws, ollama, groq, deepseek
|
|
101
|
-
pip install "langgraph-agent-toolkit[all-llms,
|
|
101
|
+
pip install "langgraph-agent-toolkit[all-llms,all-backends,all-observability]" # All LLM providers, all backends, and all observability platforms
|
|
102
102
|
|
|
103
103
|
# Client-Only Installation
|
|
104
|
-
pip install "langgraph-agent-toolkit[client]"
|
|
104
|
+
pip install "langgraph-agent-toolkit[client]" # Just the client and Streamlit app
|
|
105
105
|
```
|
|
106
106
|
|
|
107
107
|
<a name="architecture"></a>
|
|
@@ -127,7 +127,7 @@ pip install "langgraph-agent-toolkit[client]" # Just the
|
|
|
127
127
|
- Available agents and models listed at `/info` endpoint
|
|
128
128
|
- Supports different runners:
|
|
129
129
|
- unicorn
|
|
130
|
-
-
|
|
130
|
+
- gunicorn
|
|
131
131
|
- ⚠️ mangum (AWS Lambda) - _experimental_
|
|
132
132
|
- ⚠️ azure functions - _experimental_
|
|
133
133
|
|
|
@@ -462,6 +462,8 @@ The project works with
|
|
|
462
462
|
|
|
463
463
|
- [LangGraph documentation](https://langchain-ai.github.io/langgraph/concepts/low_level/#multiple-schemas)
|
|
464
464
|
- [LangGraph Memory Concept](https://langchain-ai.github.io/langgraph/concepts/memory/)
|
|
465
|
+
- [LangGraph Memory Persistence](https://langchain-ai.github.io/langgraph/concepts/persistence/#memory)
|
|
466
|
+
- [How to edit graph state](https://langchain-ai.github.io/langgraph/how-tos/human_in_the_loop/edit-graph-state/)
|
|
465
467
|
- [How to create tools in Langchain](https://python.langchain.com/docs/how_to/custom_tools/)
|
|
466
468
|
- [Simple Serverless FastAPI with AWS Lambda](https://www.deadbear.io/simple-serverless-fastapi-with-aws-lambda/)
|
|
467
469
|
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
FROM python:3.12.10-slim
|
|
2
|
+
|
|
3
|
+
WORKDIR /app
|
|
4
|
+
|
|
5
|
+
ENV UV_PROJECT_ENVIRONMENT="/usr/local/"
|
|
6
|
+
ENV UV_COMPILE_BYTECODE=1
|
|
7
|
+
ENV PYTHONPATH="/app"
|
|
8
|
+
|
|
9
|
+
COPY pyproject.toml uv.lock ./
|
|
10
|
+
COPY langgraph_agent_toolkit/ ./langgraph_agent_toolkit/
|
|
11
|
+
|
|
12
|
+
RUN pip install --no-cache-dir uv
|
|
13
|
+
|
|
14
|
+
# -----------------------------------------------
|
|
15
|
+
# ------ Use unicorn as the backend server ------
|
|
16
|
+
# -----------------------------------------------
|
|
17
|
+
|
|
18
|
+
RUN uv sync --frozen --no-install-project --no-dev --extra uvicorn-backend --extra openai \
|
|
19
|
+
&& rm -rf /root/.cache
|
|
20
|
+
CMD ["python", "langgraph_agent_toolkit/run_service.py", "run_service", "--runner_type", "uvicorn"]
|
|
21
|
+
|
|
22
|
+
# ====================================================
|
|
23
|
+
|
|
24
|
+
# ------------------------------------------------
|
|
25
|
+
# ------ Use gunicorn as the backend server ------
|
|
26
|
+
# ------------------------------------------------
|
|
27
|
+
|
|
28
|
+
# RUN uv sync --frozen --no-install-project --no-dev --extra gunicorn-backend --extra openai \
|
|
29
|
+
# && rm -rf /root/.cache
|
|
30
|
+
# CMD ["python", "langgraph_agent_toolkit/run_service.py", "run_service", "--runner_type", "gunicorn", "--workers", "4"]
|
|
31
|
+
|
|
32
|
+
# ====================================================
|
|
@@ -366,6 +366,10 @@ def create_react_agent(
|
|
|
366
366
|
# Define the function that determines whether to continue or not
|
|
367
367
|
def should_continue(state: Any) -> Union[str, list]:
|
|
368
368
|
messages = _get_state_value(state, "messages")
|
|
369
|
+
|
|
370
|
+
if not messages:
|
|
371
|
+
return END if response_format is None else "generate_structured_response"
|
|
372
|
+
|
|
369
373
|
last_message = messages[-1]
|
|
370
374
|
# If there is no function call, then we finish
|
|
371
375
|
if not isinstance(last_message, AIMessage) or not last_message.tool_calls:
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import fire
|
|
1
2
|
from dotenv import load_dotenv
|
|
2
3
|
|
|
3
4
|
from langgraph_agent_toolkit.service.factory import RunnerType, ServiceRunner
|
|
@@ -5,8 +6,20 @@ from langgraph_agent_toolkit.service.factory import RunnerType, ServiceRunner
|
|
|
5
6
|
|
|
6
7
|
load_dotenv(override=True)
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
def run_service(
|
|
11
|
+
runner_type: str = "uvicorn",
|
|
12
|
+
**kwargs,
|
|
13
|
+
):
|
|
14
|
+
"""Run the service with the specified runner type.
|
|
15
|
+
|
|
16
|
+
Args:
|
|
17
|
+
runner_type (str): The type of runner to use.
|
|
18
|
+
**kwargs: Additional arguments to pass to the service runner.
|
|
19
|
+
|
|
20
|
+
"""
|
|
21
|
+
runner_type = RunnerType(runner_type)
|
|
22
|
+
|
|
10
23
|
service = ServiceRunner(
|
|
11
24
|
custom_settings=dict(
|
|
12
25
|
AGENT_PATHS=[
|
|
@@ -16,4 +29,8 @@ if __name__ == "__main__":
|
|
|
16
29
|
]
|
|
17
30
|
),
|
|
18
31
|
)
|
|
19
|
-
|
|
32
|
+
_ = service.run(runner_type=runner_type, **kwargs)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
if __name__ == "__main__":
|
|
36
|
+
fire.Fire(run_service)
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
from langgraph_agent_toolkit.schema.schema import (
|
|
2
|
+
AddMessagesInput,
|
|
3
|
+
AddMessagesResponse,
|
|
2
4
|
AgentInfo,
|
|
3
5
|
ChatHistory,
|
|
4
6
|
ChatHistoryInput,
|
|
5
7
|
ChatMessage,
|
|
8
|
+
ClearHistoryInput,
|
|
9
|
+
ClearHistoryResponse,
|
|
6
10
|
Feedback,
|
|
7
11
|
FeedbackResponse,
|
|
8
12
|
HealthCheck,
|
|
@@ -13,9 +17,13 @@ from langgraph_agent_toolkit.schema.schema import (
|
|
|
13
17
|
|
|
14
18
|
|
|
15
19
|
__all__ = [
|
|
20
|
+
"AddMessagesInput",
|
|
21
|
+
"AddMessagesResponse",
|
|
16
22
|
"AgentInfo",
|
|
17
23
|
"UserInput",
|
|
18
24
|
"ChatMessage",
|
|
25
|
+
"ClearHistoryInput",
|
|
26
|
+
"ClearHistoryResponse",
|
|
19
27
|
"ServiceMetadata",
|
|
20
28
|
"StreamInput",
|
|
21
29
|
"Feedback",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from typing import Any, Literal, NotRequired
|
|
2
2
|
|
|
3
|
-
from pydantic import BaseModel, Field
|
|
3
|
+
from pydantic import BaseModel, Field
|
|
4
4
|
from typing_extensions import TypedDict
|
|
5
5
|
|
|
6
6
|
from langgraph_agent_toolkit.helper.constants import (
|
|
@@ -197,11 +197,110 @@ class FeedbackResponse(BaseModel):
|
|
|
197
197
|
)
|
|
198
198
|
|
|
199
199
|
|
|
200
|
+
class MessageInput(BaseModel):
|
|
201
|
+
"""Input for a message to be added to the chat history."""
|
|
202
|
+
|
|
203
|
+
type: Literal["human", "ai", "tool", "custom"] = Field(
|
|
204
|
+
description="Role of the message.",
|
|
205
|
+
examples=["human", "ai", "tool", "custom"],
|
|
206
|
+
)
|
|
207
|
+
content: str = Field(
|
|
208
|
+
description="Content of the message.",
|
|
209
|
+
examples=["Hello, world!"],
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
class AddMessagesInput(BaseModel):
|
|
214
|
+
"""Input for adding messages to the chat history."""
|
|
215
|
+
|
|
216
|
+
thread_id: str | None = Field(
|
|
217
|
+
description="Thread ID to persist and continue a multi-turn conversation.",
|
|
218
|
+
default=None,
|
|
219
|
+
examples=["847c6285-8fc9-4560-a83f-4e6285809254"],
|
|
220
|
+
)
|
|
221
|
+
user_id: str | None = Field(
|
|
222
|
+
description="User ID to persist in observability platform and share long-term memory.",
|
|
223
|
+
default=None,
|
|
224
|
+
examples=["521c0a60-ea75-43fa-a793-a4cf11e013ae"],
|
|
225
|
+
)
|
|
226
|
+
messages: list[MessageInput] = Field(
|
|
227
|
+
description="List of messages to add to the chat history.",
|
|
228
|
+
examples=[
|
|
229
|
+
[
|
|
230
|
+
{
|
|
231
|
+
"type": "human",
|
|
232
|
+
"content": "Hello, how are you?",
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"type": "ai",
|
|
236
|
+
"content": "I'm doing well, thank you! How can I assist you today?",
|
|
237
|
+
},
|
|
238
|
+
]
|
|
239
|
+
],
|
|
240
|
+
)
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
class AddMessagesResponse(BaseModel):
|
|
244
|
+
"""Response after adding messages to the chat history."""
|
|
245
|
+
|
|
246
|
+
status: Literal["success"] = "success"
|
|
247
|
+
thread_id: str | None = Field(
|
|
248
|
+
description="Thread ID for which the message was added.",
|
|
249
|
+
default=None,
|
|
250
|
+
examples=["847c6285-8fc9-4560-a83f-4e6285809254"],
|
|
251
|
+
)
|
|
252
|
+
user_id: str | None = Field(
|
|
253
|
+
description="User ID associated with the message.",
|
|
254
|
+
default=None,
|
|
255
|
+
examples=["521c0a60-ea75-43fa-a793-a4cf11e013ae"],
|
|
256
|
+
)
|
|
257
|
+
message: str = Field(
|
|
258
|
+
description="Descriptive message about the operation.",
|
|
259
|
+
default="Messages added successfully.",
|
|
260
|
+
)
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
class ClearHistoryInput(BaseModel):
|
|
264
|
+
"""Input for clearing messages from the chat history."""
|
|
265
|
+
|
|
266
|
+
thread_id: str | None = Field(
|
|
267
|
+
description="Thread ID to persist and continue a multi-turn conversation.",
|
|
268
|
+
default=None,
|
|
269
|
+
examples=["847c6285-8fc9-4560-a83f-4e6285809254"],
|
|
270
|
+
)
|
|
271
|
+
user_id: str | None = Field(
|
|
272
|
+
description="User ID to persist in observability platform and share long-term memory.",
|
|
273
|
+
default=None,
|
|
274
|
+
examples=["521c0a60-ea75-43fa-a793-a4cf11e013ae"],
|
|
275
|
+
)
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
class ClearHistoryResponse(BaseModel):
|
|
279
|
+
"""Response after clearing messages from the chat history."""
|
|
280
|
+
|
|
281
|
+
status: Literal["success"] = "success"
|
|
282
|
+
thread_id: str | None = Field(
|
|
283
|
+
description="Thread ID for which the messages were cleared.",
|
|
284
|
+
default=None,
|
|
285
|
+
examples=["847c6285-8fc9-4560-a83f-4e6285809254"],
|
|
286
|
+
)
|
|
287
|
+
user_id: str | None = Field(
|
|
288
|
+
description="User ID associated with the operation.",
|
|
289
|
+
default=None,
|
|
290
|
+
examples=["521c0a60-ea75-43fa-a793-a4cf11e013ae"],
|
|
291
|
+
)
|
|
292
|
+
message: str = Field(
|
|
293
|
+
description="Descriptive message about the operation.",
|
|
294
|
+
default="Messages cleared successfully.",
|
|
295
|
+
)
|
|
296
|
+
|
|
297
|
+
|
|
200
298
|
class ChatHistoryInput(BaseModel):
|
|
201
299
|
"""Input for retrieving chat history."""
|
|
202
300
|
|
|
203
|
-
thread_id: str = Field(
|
|
301
|
+
thread_id: str | None = Field(
|
|
204
302
|
description="Thread ID to persist and continue a multi-turn conversation.",
|
|
303
|
+
default=None,
|
|
205
304
|
examples=["847c6285-8fc9-4560-a83f-4e6285809254"],
|
|
206
305
|
)
|
|
207
306
|
user_id: str | None = Field(
|
|
@@ -4,7 +4,6 @@ import os
|
|
|
4
4
|
import sys
|
|
5
5
|
from typing import Any, Dict, Optional
|
|
6
6
|
|
|
7
|
-
import uvicorn
|
|
8
7
|
from fastapi import FastAPI
|
|
9
8
|
|
|
10
9
|
from langgraph_agent_toolkit.core import settings as base_settings
|
|
@@ -61,37 +60,56 @@ class ServiceRunner:
|
|
|
61
60
|
|
|
62
61
|
self.app = create_app()
|
|
63
62
|
|
|
64
|
-
def run_uvicorn(self):
|
|
63
|
+
def run_uvicorn(self, **kwargs):
|
|
65
64
|
"""Run the API service with uvicorn."""
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
65
|
+
try:
|
|
66
|
+
import uvicorn
|
|
67
|
+
|
|
68
|
+
# Set Compatible event loop policy on Windows Systems.
|
|
69
|
+
if sys.platform == "win32":
|
|
70
|
+
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
|
|
71
|
+
|
|
72
|
+
# In development mode with reload=True, we need to use an import string
|
|
73
|
+
# instead of passing the app instance directly
|
|
74
|
+
if base_settings.is_dev():
|
|
75
|
+
logger.info("Starting in development mode with hot reload enabled")
|
|
76
|
+
|
|
77
|
+
# union of dict and kwargs
|
|
78
|
+
parameters = (
|
|
79
|
+
dict(
|
|
80
|
+
host=base_settings.HOST,
|
|
81
|
+
port=base_settings.PORT,
|
|
82
|
+
reload=True,
|
|
83
|
+
factory=True,
|
|
84
|
+
)
|
|
85
|
+
| kwargs
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
uvicorn.run("langgraph_agent_toolkit.service.handler:create_app", **parameters)
|
|
89
|
+
else:
|
|
90
|
+
# In production mode, use the app instance directly
|
|
91
|
+
parameters = (
|
|
92
|
+
dict(
|
|
93
|
+
host=base_settings.HOST,
|
|
94
|
+
port=base_settings.PORT,
|
|
95
|
+
reload=False,
|
|
96
|
+
)
|
|
97
|
+
| kwargs
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
uvicorn.run(
|
|
101
|
+
self.app,
|
|
102
|
+
**parameters,
|
|
103
|
+
)
|
|
104
|
+
except ImportError:
|
|
105
|
+
logger.error("Uvicorn not installed. Install it with 'pip install uvicorn'")
|
|
106
|
+
sys.exit(1)
|
|
107
|
+
|
|
108
|
+
def run_gunicorn(self, **kwargs):
|
|
91
109
|
"""Run the API service with gunicorn.
|
|
92
110
|
|
|
93
111
|
Args:
|
|
94
|
-
|
|
112
|
+
**kwargs: Additional arguments to pass to gunicorn
|
|
95
113
|
|
|
96
114
|
"""
|
|
97
115
|
try:
|
|
@@ -112,26 +130,25 @@ class ServiceRunner:
|
|
|
112
130
|
|
|
113
131
|
options = {
|
|
114
132
|
"bind": f"{base_settings.HOST}:{base_settings.PORT}",
|
|
115
|
-
"workers": workers,
|
|
116
133
|
"worker_class": "uvicorn.workers.UvicornWorker",
|
|
117
|
-
}
|
|
134
|
+
} | kwargs
|
|
118
135
|
|
|
119
136
|
GunicornApp(self.app, options).run()
|
|
120
137
|
except ImportError:
|
|
121
138
|
logger.error("Gunicorn not installed. Install it with 'pip install gunicorn'")
|
|
122
139
|
sys.exit(1)
|
|
123
140
|
|
|
124
|
-
def run_aws_lambda(self):
|
|
141
|
+
def run_aws_lambda(self, **kwargs):
|
|
125
142
|
"""Prepare the API service for AWS Lambda."""
|
|
126
143
|
try:
|
|
127
144
|
from mangum import Mangum
|
|
128
145
|
|
|
129
|
-
return Mangum(self.app)
|
|
146
|
+
return Mangum(self.app, **kwargs)
|
|
130
147
|
except ImportError:
|
|
131
148
|
logger.error("Mangum not installed. Install it with 'pip install mangum'")
|
|
132
149
|
sys.exit(1)
|
|
133
150
|
|
|
134
|
-
def run_azure_functions(self):
|
|
151
|
+
def run_azure_functions(self, **kwargs):
|
|
135
152
|
"""Prepare the API service for Azure Functions."""
|
|
136
153
|
try:
|
|
137
154
|
import azure.functions as func
|
|
@@ -198,15 +215,17 @@ class ServiceRunner:
|
|
|
198
215
|
**kwargs: Additional arguments to pass to the runner.
|
|
199
216
|
|
|
200
217
|
"""
|
|
218
|
+
runner_type = RunnerType(runner_type)
|
|
219
|
+
logger.info(f"Running service with runner type {runner_type.value} with options: {kwargs}")
|
|
220
|
+
|
|
201
221
|
match runner_type:
|
|
202
222
|
case RunnerType.UVICORN:
|
|
203
|
-
self.run_uvicorn()
|
|
223
|
+
self.run_uvicorn(**kwargs)
|
|
204
224
|
case RunnerType.GUNICORN:
|
|
205
|
-
|
|
206
|
-
self.run_gunicorn(workers=workers)
|
|
225
|
+
self.run_gunicorn(**kwargs)
|
|
207
226
|
case RunnerType.AWS_LAMBDA:
|
|
208
|
-
return self.run_aws_lambda()
|
|
227
|
+
return self.run_aws_lambda(**kwargs)
|
|
209
228
|
case RunnerType.AZURE_FUNCTIONS:
|
|
210
|
-
return self.run_azure_functions()
|
|
229
|
+
return self.run_azure_functions(**kwargs)
|
|
211
230
|
case _:
|
|
212
231
|
raise ValueError(f"Unknown runner type: {runner_type}")
|
|
@@ -105,7 +105,12 @@ def create_app() -> FastAPI:
|
|
|
105
105
|
"""Create and configure the FastAPI application."""
|
|
106
106
|
logger.info(f"Initializing API service v{__version__}")
|
|
107
107
|
|
|
108
|
-
app = FastAPI(
|
|
108
|
+
app = FastAPI(
|
|
109
|
+
lifespan=lifespan,
|
|
110
|
+
title="LangGraph Agent API",
|
|
111
|
+
description="API for interacting with LangGraph agents",
|
|
112
|
+
version=__version__,
|
|
113
|
+
)
|
|
109
114
|
|
|
110
115
|
# add middleware
|
|
111
116
|
app.add_middleware(LoggingMiddleware)
|