Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLI] Add openapi param to config #2765

Merged
merged 2 commits into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions libs/cli/langgraph_cli/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import json

Check notice on line 1 in libs/cli/langgraph_cli/config.py

View workflow job for this annotation

GitHub Actions / benchmark

Benchmark results

......................................... fanout_to_subgraph_10x: Mean +- std dev: 61.0 ms +- 1.7 ms ......................................... fanout_to_subgraph_10x_sync: Mean +- std dev: 51.8 ms +- 0.7 ms ......................................... fanout_to_subgraph_10x_checkpoint: Mean +- std dev: 73.7 ms +- 2.3 ms ......................................... fanout_to_subgraph_10x_checkpoint_sync: Mean +- std dev: 93.7 ms +- 1.8 ms ......................................... fanout_to_subgraph_100x: Mean +- std dev: 599 ms +- 23 ms ......................................... fanout_to_subgraph_100x_sync: Mean +- std dev: 508 ms +- 7 ms ......................................... fanout_to_subgraph_100x_checkpoint: Mean +- std dev: 742 ms +- 14 ms ......................................... fanout_to_subgraph_100x_checkpoint_sync: Mean +- std dev: 946 ms +- 45 ms ......................................... react_agent_10x: Mean +- std dev: 30.6 ms +- 0.7 ms ......................................... react_agent_10x_sync: Mean +- std dev: 22.6 ms +- 0.2 ms ......................................... react_agent_10x_checkpoint: Mean +- std dev: 37.9 ms +- 0.7 ms ......................................... react_agent_10x_checkpoint_sync: Mean +- std dev: 36.6 ms +- 0.4 ms ......................................... react_agent_100x: Mean +- std dev: 338 ms +- 6 ms ......................................... react_agent_100x_sync: Mean +- std dev: 273 ms +- 2 ms ......................................... react_agent_100x_checkpoint: Mean +- std dev: 835 ms +- 7 ms ......................................... react_agent_100x_checkpoint_sync: Mean +- std dev: 826 ms +- 7 ms ......................................... wide_state_25x300: Mean +- std dev: 22.7 ms +- 0.4 ms ......................................... wide_state_25x300_sync: Mean +- std dev: 14.7 ms +- 0.2 ms ......................................... wide_state_25x300_checkpoint: Mean +- std dev: 277 ms +- 13 ms ......................................... wide_state_25x300_checkpoint_sync: Mean +- std dev: 274 ms +- 13 ms ......................................... wide_state_15x600: Mean +- std dev: 26.6 ms +- 0.5 ms ......................................... wide_state_15x600_sync: Mean +- std dev: 17.1 ms +- 0.2 ms ......................................... wide_state_15x600_checkpoint: Mean +- std dev: 474 ms +- 13 ms ......................................... wide_state_15x600_checkpoint_sync: Mean +- std dev: 472 ms +- 13 ms ......................................... wide_state_9x1200: Mean +- std dev: 26.7 ms +- 0.6 ms ......................................... wide_state_9x1200_sync: Mean +- std dev: 17.2 ms +- 0.4 ms ......................................... wide_state_9x1200_checkpoint: Mean +- std dev: 311 ms +- 15 ms ......................................... wide_state_9x1200_checkpoint_sync: Mean +- std dev: 310 ms +- 17 ms

Check notice on line 1 in libs/cli/langgraph_cli/config.py

View workflow job for this annotation

GitHub Actions / benchmark

Comparison against main

+----------------------------------------+---------+-----------------------+ | Benchmark | main | changes | +========================================+=========+=======================+ | wide_state_25x300 | 22.8 ms | 22.7 ms: 1.01x faster | +----------------------------------------+---------+-----------------------+ | wide_state_15x600 | 26.8 ms | 26.6 ms: 1.01x faster | +----------------------------------------+---------+-----------------------+ | fanout_to_subgraph_10x_checkpoint_sync | 94.2 ms | 93.7 ms: 1.01x faster | +----------------------------------------+---------+-----------------------+ | react_agent_10x_sync | 22.7 ms | 22.6 ms: 1.01x faster | +----------------------------------------+---------+-----------------------+ | wide_state_9x1200_sync | 17.1 ms | 17.2 ms: 1.01x slower | +----------------------------------------+---------+-----------------------+ | fanout_to_subgraph_10x | 60.6 ms | 61.0 ms: 1.01x slower | +----------------------------------------+---------+-----------------------+ | wide_state_9x1200_checkpoint | 307 ms | 311 ms: 1.01x slower | +----------------------------------------+---------+-----------------------+ | wide_state_9x1200_checkpoint_sync | 305 ms | 310 ms: 1.02x slower | +----------------------------------------+---------+-----------------------+ | Geometric mean | (ref) | 1.00x slower | +----------------------------------------+---------+-----------------------+ Benchmark hidden because not significant (20): fanout_to_subgraph_100x, wide_state_9x1200, wide_state_25x300_sync, wide_state_15x600_sync, fanout_to_subgraph_100x_sync, react_agent_10x_checkpoint_sync, fanout_to_subgraph_10x_sync, react_agent_100x_sync, react_agent_10x, react_agent_100x_checkpoint_sync, fanout_to_subgraph_100x_checkpoint, wide_state_15x600_checkpoint_sync, react_agent_100x, react_agent_100x_checkpoint, react_agent_10x_checkpoint, fanout_to_subgraph_10x_checkpoint, wide_state_25x300_checkpoint_sync, wide_state_15x600_checkpoint, fanout_to_subgraph_100x_checkpoint_sync, wide_state_25x300_checkpoint
import os
import pathlib
import textwrap
Expand Down Expand Up @@ -47,9 +47,42 @@
"""Configuration for vector embeddings in store."""


class SecurityConfig(TypedDict, total=False):
securitySchemes: dict
security: list
# path => {method => security}
paths: dict[str, dict[str, list]]


class AuthConfig(TypedDict, total=False):
path: str
"""Path to the authentication function in a Python file."""
disable_studio_auth: bool
"""Whether to disable auth when connecting from the LangSmith Studio."""
openapi: SecurityConfig
"""The schema to use for updating the openapi spec.

Example:
{
"securitySchemes": {
"OAuth2": {
"type": "oauth2",
"flows": {
"password": {
"tokenUrl": "/token",
"scopes": {
"me": "Read information about the current user",
"items": "Access to create and manage items"
}
}
}
}
},
"security": [
{"OAuth2": ["me"]} # Default security requirement for all endpoints
]
}
"""


class Config(TypedDict, total=False):
Expand Down
8 changes: 4 additions & 4 deletions libs/cli/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions libs/cli/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "langgraph-cli"
version = "0.1.62"
version = "0.1.63"
description = "CLI for interacting with LangGraph API"
authors = []
license = "MIT"
Expand All @@ -14,7 +14,7 @@ langgraph = "langgraph_cli.cli:cli"
[tool.poetry.dependencies]
python = "^3.9.0,<4.0"
click = "^8.1.7"
langgraph-api = { version = ">=0.0.7,<0.1.0", optional = true, python = ">=3.11,<4.0" }
langgraph-api = { version = ">=0.0.8,<0.1.0", optional = true, python = ">=3.11,<4.0" }
python-dotenv = { version = ">=0.8.0", optional = true }

[tool.poetry.group.dev.dependencies]
Expand Down
Loading