Skip to content

Commit cd7961b

Browse files
release(cli): 0.4.17 (langchain-ai#7166)
release new templates --------- Co-authored-by: William Fu-Hinthorn <13333726+hinthornw@users.noreply.github.com>
1 parent c315dd0 commit cd7961b

2 files changed

Lines changed: 20 additions & 61 deletions

File tree

libs/cli/langgraph_cli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.4.16"
1+
__version__ = "0.4.17"

libs/cli/langgraph_cli/templates.py

Lines changed: 19 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,20 @@
88
import click
99

1010
TEMPLATES: dict[str, dict[str, str]] = {
11+
"Deep Agent": {
12+
"description": "An opinionated deployment template for a Deep Agent.",
13+
"python": "https://github.com/langchain-ai/deep-agent-template/archive/refs/heads/main.zip",
14+
"js": "https://github.com/langchain-ai/deep-agent-template-js/archive/refs/heads/main.zip",
15+
},
16+
"Agent": {
17+
"description": "A simple agent that can be flexibly extended to many tools.",
18+
"python": "https://github.com/langchain-ai/simple-agent-template/archive/refs/heads/main.zip",
19+
},
1120
"New LangGraph Project": {
1221
"description": "A simple, minimal chatbot with memory.",
1322
"python": "https://github.com/langchain-ai/new-langgraph-project/archive/refs/heads/main.zip",
1423
"js": "https://github.com/langchain-ai/new-langgraphjs-project/archive/refs/heads/main.zip",
1524
},
16-
"ReAct Agent": {
17-
"description": "A simple agent that can be flexibly extended to many tools.",
18-
"python": "https://github.com/langchain-ai/react-agent/archive/refs/heads/main.zip",
19-
"js": "https://github.com/langchain-ai/react-agent-js/archive/refs/heads/main.zip",
20-
},
21-
"Memory Agent": {
22-
"description": "A ReAct-style agent with an additional tool to store memories for use across conversational threads.",
23-
"python": "https://github.com/langchain-ai/memory-agent/archive/refs/heads/main.zip",
24-
"js": "https://github.com/langchain-ai/memory-agent-js/archive/refs/heads/main.zip",
25-
},
26-
"Retrieval Agent": {
27-
"description": "An agent that includes a retrieval-based question-answering system.",
28-
"python": "https://github.com/langchain-ai/retrieval-agent-template/archive/refs/heads/main.zip",
29-
"js": "https://github.com/langchain-ai/retrieval-agent-template-js/archive/refs/heads/main.zip",
30-
},
31-
"Data-enrichment Agent": {
32-
"description": "An agent that performs web searches and organizes its findings into a structured format.",
33-
"python": "https://github.com/langchain-ai/data-enrichment/archive/refs/heads/main.zip",
34-
"js": "https://github.com/langchain-ai/data-enrichment-js/archive/refs/heads/main.zip",
35-
},
36-
"Basic Deep Agent": {
37-
"description": "An opinionated deployment template for a Deep Agent built with createDeepAgent.",
38-
"python": "https://github.com/langchain-ai/deep-agent-template/archive/refs/heads/main.zip",
39-
"js": "https://github.com/langchain-ai/deep-agent-template-js/archive/refs/heads/main.zip",
40-
},
4125
}
4226

4327
# Generate TEMPLATE_IDS programmatically
@@ -83,19 +67,25 @@ def _choose_template() -> str:
8367
click.secho("❌ Invalid choice. Please try again.", fg="red")
8468
return _choose_template()
8569

86-
# Prompt the user to choose between Python or JS/TS version
70+
template_info = TEMPLATES[selected_template]
71+
available_langs = [lang for lang in ("python", "js") if lang in template_info]
72+
8773
click.secho(
88-
f"\nYou selected: {selected_template} - {TEMPLATES[selected_template]['description']}",
74+
f"\nYou selected: {selected_template} - {template_info['description']}",
8975
fg="green",
9076
)
77+
78+
if len(available_langs) == 1:
79+
return template_info[available_langs[0]]
80+
9181
version_choice: int = click.prompt(
9282
"Choose language (1 for Python 🐍, 2 for JS/TS 🌐)", type=int
9383
)
9484

9585
if version_choice == 1:
96-
return TEMPLATES[selected_template]["python"]
86+
return template_info["python"]
9787
elif version_choice == 2:
98-
return TEMPLATES[selected_template]["js"]
88+
return template_info["js"]
9989
else:
10090
click.secho("❌ Invalid choice. Please try again.", fg="red")
10191
return _choose_template()
@@ -135,37 +125,6 @@ def _download_repo_with_requests(repo_url: str, path: str) -> None:
135125
sys.exit(1)
136126

137127

138-
def _get_template_url(template_name: str) -> str | None:
139-
"""
140-
Retrieves the template URL based on the provided template name.
141-
142-
Args:
143-
template_name: The name of the template.
144-
145-
Returns:
146-
Optional[str]: The URL of the template if found, else None.
147-
"""
148-
if template_name in TEMPLATES:
149-
click.secho(f"Template selected: {template_name}", fg="green")
150-
version_choice: int = click.prompt(
151-
"Choose version (1 for Python 🐍, 2 for JS/TS 🌐)", type=int
152-
)
153-
154-
if version_choice == 1:
155-
return TEMPLATES[template_name]["python"]
156-
elif version_choice == 2:
157-
return TEMPLATES[template_name]["js"]
158-
else:
159-
click.secho("❌ Invalid choice. Please try again.", fg="red")
160-
return None
161-
else:
162-
click.secho(
163-
f"Template '{template_name}' not found. Please select from the available options.",
164-
fg="red",
165-
)
166-
return None
167-
168-
169128
def create_new(path: str | None, template: str | None) -> None:
170129
"""Create a new LangGraph project at the specified PATH using the chosen TEMPLATE.
171130

0 commit comments

Comments
 (0)