Title: input | deepagents_code | LangChain Reference
Open Graph Title: input | deepagents_code
X Title: input | deepagents_code
Description: Python API reference for input in deepagents_code. Part of the LangChain ecosystem.
Open Graph Description: Python API reference for input in deepagents_code. Part of the LangChain ecosystem.
X Description: Python API reference for input in deepagents_code. Part of the LangChain ecosystem.
Opengraph URL: https://reference.langchain.com/python/deepagents-code/input
Domain: reference.langchain.com
| og:image | https://reference.langchain.com/og/python/deepagents-code/input |
| og:image:width | 1200 |
| og:image:height | 630 |
| og:image:alt | input | deepagents_code |
| og:type | article |
| twitter:card | summary_large_image |
| twitter:image | https://reference.langchain.com/og/python/deepagents-code/input |
Links:
| LangChain Reference home page | https://reference.langchain.com/ |
| GitHub | https://github.com/langchain-ai |
| Main Docs | https://docs.langchain.com/oss/python/deepagents |
| Deep Agents | https://reference.langchain.com/python/deepagents |
| LangChain | https://reference.langchain.com/python/langchain/overview |
| LangGraph | https://reference.langchain.com/python/langgraph/overview |
| Integrations | https://reference.langchain.com/python/integrations/overview |
| LangSmith | https://reference.langchain.com/python/langsmith |
| Deep Agents Code | https://reference.langchain.com/python/deepagents-code |
| Deep Agents Code | https://reference.langchain.com/python/deepagents-code |
| deepagents-code | https://reference.langchain.com/python/deepagents-code |
| attributeconsole: Console | https://reference.langchain.com/python/deepagents-code/config/console |
| attributelogger | https://reference.langchain.com/python/deepagents-code/input/logger |
| attributePATH_CHAR_CLASS: strCharacters allowed in file paths. Includes alphanumeric, period, underscore, tilde (home), forward/back slashes (path separators), colon (Windows drive letters), and hyphen. | https://reference.langchain.com/python/deepagents-code/input/PATH_CHAR_CLASS |
| attributeFILE_MENTION_PATTERNPattern for extracting @file mentions from input text. Matches @ followed by one or more path characters or escaped character pairs (backslash + any character, e.g., \ for spaces in paths). Uses + (not *) because a bare @ without a path is not a valid file reference. | https://reference.langchain.com/python/deepagents-code/input/FILE_MENTION_PATTERN |
| attributeEMAIL_PREFIX_PATTERNPattern to detect email-like text preceding an @ symbol. If the character immediately before @ matches this pattern, the @mention is likely part of an email address (e.g., user@example.com) rather than a file reference. | https://reference.langchain.com/python/deepagents-code/input/EMAIL_PREFIX_PATTERN |
| attributeINPUT_HIGHLIGHT_PATTERNPattern for highlighting @mentions and /commands in rendered user messages. Matches either: Slash commands at the start of the string (e.g., /help) @file mentions anywhere in the text (e.g., @README.md) Note: The ^ anchor matches start of string, not start of line. The consumer in UserMessage.compose() additionally checks start == 0 before styling slash commands, so a / mid-string is not highlighted. | https://reference.langchain.com/python/deepagents-code/input/INPUT_HIGHLIGHT_PATTERN |
| attributeMediaKind: Literal['image', 'video']Accepted values for the kind parameter in MediaTracker methods. | https://reference.langchain.com/python/deepagents-code/input/MediaKind |
| attributeIMAGE_PLACEHOLDER_PATTERNPattern for image placeholders with a named id capture group. Used to extract numeric IDs from placeholder tokens so the tracker can prune stale entries and compute the next available ID. | https://reference.langchain.com/python/deepagents-code/input/IMAGE_PLACEHOLDER_PATTERN |
| attributeVIDEO_PLACEHOLDER_PATTERNPattern for video placeholders with a named id capture group. Used to extract numeric IDs from placeholder tokens so the tracker can prune stale entries and compute the next available ID. | https://reference.langchain.com/python/deepagents-code/input/VIDEO_PLACEHOLDER_PATTERN |
| functionparse_file_mentionsExtract @file mentions and return the text with resolved file paths. Parses @file mentions from the input text and resolves them to absolute file paths. Files that do not exist or cannot be resolved are excluded with a warning printed to the console. Email addresses (e.g., user@example.com) are automatically excluded by detecting email-like characters before the @ symbol. Backslash-escaped spaces in paths (e.g., @my\ folder/file.txt) are unescaped before resolution. Tilde paths (e.g., @~/file.txt) are expanded via Path.expanduser(). Only regular files are returned; directories are excluded. This function does not raise exceptions; invalid paths are handled internally with a console warning. | https://reference.langchain.com/python/deepagents-code/input/parse_file_mentions |
| functionparse_pasted_file_pathsParse a paste payload that may contain dragged-and-dropped file paths. The parser is strict on purpose: it only returns paths when the entire paste payload can be interpreted as one or more existing files. Any invalid token falls back to normal text paste behavior by returning an empty list. Supports common dropped-path formats: Absolute/relative paths POSIX shell quoting and escaping file:// URLs | https://reference.langchain.com/python/deepagents-code/input/parse_pasted_file_paths |
| functionparse_pasted_path_payloadParse dropped-path payload variants through one entrypoint. Parsing order is: strict multi-path payload parsing (parse_pasted_file_paths) single-path normalization/parsing (parse_single_pasted_file_path) optional leading-path extraction (extract_leading_pasted_file_path) | https://reference.langchain.com/python/deepagents-code/input/parse_pasted_path_payload |
| functionparse_single_pasted_file_pathParse and resolve a single pasted path payload. Unlike parse_pasted_file_paths, this helper only accepts one path token and is intended for fallback handling when a paste event carries a single path representation. | https://reference.langchain.com/python/deepagents-code/input/parse_single_pasted_file_path |
| functionextract_leading_pasted_file_pathExtract and resolve a leading pasted path token from input text. This is used for submit-time recovery when a user message starts with a path token followed by additional prompt text. | https://reference.langchain.com/python/deepagents-code/input/extract_leading_pasted_file_path |
| functionnormalize_pasted_pathNormalize pasted text that may represent a single filesystem path. Supports: quoted and shell-escaped single paths file:// URLs Windows drive-letter and UNC paths | https://reference.langchain.com/python/deepagents-code/input/normalize_pasted_path |
| classImageDataRepresents a pasted image with its base64 encoding. | https://reference.langchain.com/python/deepagents-code/media_utils/ImageData |
| classVideoDataRepresents a pasted video with its base64 encoding. | https://reference.langchain.com/python/deepagents-code/media_utils/VideoData |
| classParsedPastedPathPayloadUnified parse result for dropped-path payload detection. | https://reference.langchain.com/python/deepagents-code/input/ParsedPastedPathPayload |
| classMediaTrackerTrack pasted images and videos in the current conversation. | https://reference.langchain.com/python/deepagents-code/input/MediaTracker |
| View source on GitHub | https://github.com/langchain-ai/deepagents/blob/bd9bafaad3f51d426563aa24658bbb3a089d4825/libs/code/deepagents_code/input.py |
Viewport: width=device-width, initial-scale=1