Skip to content
Open
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
27 changes: 11 additions & 16 deletions libs/deepagents-cli/deepagents_cli/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import dotenv
from rich.console import Console
from langchain_core.language_models import BaseChatModel

dotenv.load_dotenv()

Expand All @@ -21,19 +22,14 @@

# ASCII art banner
DEEP_AGENTS_ASCII = """
██████╗ ███████╗ ███████╗ ██████╗
██╔══██╗ ██╔════╝ ██╔════╝ ██╔══██╗
██║ ██║ █████╗ █████╗ ██████╔╝
██║ ██║ ██╔══╝ ██╔══╝ ██╔═══╝
██████╔╝ ███████╗ ███████╗ ██║
╚═════╝ ╚══════╝ ╚══════╝ ╚═╝

█████╗ ██████╗ ███████╗ ███╗ ██╗ ████████╗ ███████╗
██╔══██╗ ██╔════╝ ██╔════╝ ████╗ ██║ ╚══██╔══╝ ██╔════╝
███████║ ██║ ███╗ █████╗ ██╔██╗ ██║ ██║ ███████╗
██╔══██║ ██║ ██║ ██╔══╝ ██║╚██╗██║ ██║ ╚════██║
██║ ██║ ╚██████╔╝ ███████╗ ██║ ╚████║ ██║ ███████║
╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═══╝ ╚═╝ ╚══════╝
▖ ▄▖▌ ▘ ▄▓▓▄
▌ ▀▌▛▌▛▌▌ ▛▌▀▌▌▛▌ ▓•███▙
▙▖█▌▌▌▙▌▙▖▌▌█▌▌▌▌ ░▀▀████▙▖
▄▄▄▄ ▄▌▄▄▄▄▄ ▗▄▄▄▄▄ ▄▄▄▄▄ ▄▄ ▄▄▄ ▗▄▄▄▄▄ ▄▄ ▄▄▄▄▄▄▄▄ ▄▄▄▄ █▓████▙▖
█ ▀▄ █ █ █ ▀█ ██ ▄▀ ▀ █ █▀▄ █ █ █▀ ▀ ▝█▓█████▙
█ █ █▄▄▄▄▄ █▄▄▄▄▄ █▄▄▄█▀ █ █ █ ▄▄ █▄▄▄▄▄ █ █▄ █ █ ▀█▄▄▄ ░▜█▓████▙
█ █ █ █ █ █▄▄█ █ █ █ █ █ █ █ ▀█ ░█▀█▛▀▀▜▙▄
█▄▄▄▀ ▜▄▄▄▄▄ ▜▄▄▄▄▄ █ █ █ ▀▄▄▄▀ ▜▄▄▄▄▄ █ ██ █ ▀▄▄▄█▀ ░▀░▀▒▛░░ ▝▀▘
"""

# Interactive commands
Expand Down Expand Up @@ -79,7 +75,8 @@
class SessionState:
"""Holds mutable session state (auto-approve mode, etc)."""

def __init__(self, auto_approve: bool = False):
def __init__(self, model: BaseChatModel | None = None, auto_approve: bool = False):
self.model = model
self.auto_approve = auto_approve

def toggle_auto_approve(self) -> bool:
Expand Down Expand Up @@ -114,7 +111,6 @@ def create_model():
from langchain_openai import ChatOpenAI

model_name = os.environ.get("OPENAI_MODEL", "gpt-5-mini")
console.print(f"[dim]Using OpenAI model: {model_name}[/dim]")
return ChatOpenAI(
model=model_name,
temperature=0.7,
Expand All @@ -123,7 +119,6 @@ def create_model():
from langchain_anthropic import ChatAnthropic

model_name = os.environ.get("ANTHROPIC_MODEL", "claude-sonnet-4-5-20250929")
console.print(f"[dim]Using Anthropic model: {model_name}[/dim]")
return ChatAnthropic(
model_name=model_name,
max_tokens=20000,
Expand Down
1 change: 1 addition & 0 deletions libs/deepagents-cli/deepagents_cli/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ def _(event):
enable_open_in_editor=True, # Allow Ctrl+X Ctrl+E to open external editor
bottom_toolbar=get_bottom_toolbar(session_state), # Persistent status bar at bottom
style=toolbar_style, # Apply toolbar styling
reserve_space_for_menu=0, # Prevent extra vertical space
)

return session
7 changes: 5 additions & 2 deletions libs/deepagents-cli/deepagents_cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ def parse_args():

async def simple_cli(agent, assistant_id: str | None, session_state, baseline_tokens: int = 0):
"""Main CLI loop."""
console.clear()
console.print(DEEP_AGENTS_ASCII, style=f"bold {COLORS['primary']}")
console.print()

if tavily_client is None:
console.print(
Expand All @@ -113,6 +111,7 @@ async def simple_cli(agent, assistant_id: str | None, session_state, baseline_to
console.print()

console.print("... Ready to code! What would you like to build?", style=COLORS["agent"])
console.print(f" [dim]Model: {session_state.model.model}[/dim]")
console.print(f" [dim]Working directory: {Path.cwd()}[/dim]")
console.print()

Expand Down Expand Up @@ -174,6 +173,10 @@ async def main(assistant_id: str, session_state):
"""Main entry point."""
# Create the model (checks API keys)
model = create_model()
session_state.model = model
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mutable assignment here?

FWIW something related to this change crashes the app

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try to resolve now


# Clear screen
console.clear()

# Create agent with conditional tools
tools = [http_request]
Expand Down