[GH-ISSUE #83] feat: support SystemMessage for systemPrompt parameter in createDeepAgent() #28

Closed
opened 2026-02-16 06:16:54 -05:00 by yindo · 0 comments
Owner

Originally created by @ps06756 on GitHub (Dec 26, 2025).
Original GitHub issue: https://github.com/langchain-ai/deepagentsjs/issues/83

Feature Request

Currently, createDeepAgent() only accepts a string for the systemPrompt parameter:

systemPrompt?: string;

However, langchain's underlying createAgent() already supports both string and SystemMessage:

systemPrompt?: string | SystemMessage;

Problem

This creates friction for projects that model system prompts as structured SystemMessage objects. Users must either manually extract the string content or maintain separate conversion logic just to use DeepAgents.

Proposed Solution

Expand the type signature to accept both strings and SystemMessage instances:

systemPrompt?: string | SystemMessage;

If a SystemMessage is provided, the function should internally extract its content and use it following DeepAgents' existing prompt composition logic.

This maintains full backward compatibility with string inputs while enabling cleaner integration with higher-level prompt abstraction patterns.

Originally created by @ps06756 on GitHub (Dec 26, 2025). Original GitHub issue: https://github.com/langchain-ai/deepagentsjs/issues/83 ## Feature Request Currently, `createDeepAgent()` only accepts a `string` for the `systemPrompt` parameter: ```typescript systemPrompt?: string; ``` However, langchain's underlying `createAgent()` already supports both `string` and `SystemMessage`: ```typescript systemPrompt?: string | SystemMessage; ``` ## Problem This creates friction for projects that model system prompts as structured `SystemMessage` objects. Users must either manually extract the string content or maintain separate conversion logic just to use DeepAgents. ## Proposed Solution Expand the type signature to accept both strings and `SystemMessage` instances: ```typescript systemPrompt?: string | SystemMessage; ``` If a `SystemMessage` is provided, the function should internally extract its content and use it following DeepAgents' existing prompt composition logic. This maintains full backward compatibility with string inputs while enabling cleaner integration with higher-level prompt abstraction patterns.
yindo closed this issue 2026-02-16 06:16:54 -05:00
yindo changed title from feat: support SystemMessage for systemPrompt parameter in createDeepAgent() to [GH-ISSUE #83] feat: support SystemMessage for systemPrompt parameter in createDeepAgent() 2026-06-05 17:21:03 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/deepagentsjs#28