format_instructions.py — langchain Source File
Architecture documentation for format_instructions.py, a python file in the langchain codebase.
Entity Profile
Source Code
"""Format instructions."""
JSON_FORMAT_INSTRUCTIONS = """STRICT OUTPUT FORMAT:
- Return only the JSON value that conforms to the schema. Do not include any additional text, explanations, headings, or separators.
- Do not wrap the JSON in Markdown or code fences (no ``` or ```json).
- Do not prepend or append any text (e.g., do not write "Here is the JSON:").
- The response must be a single top-level JSON value exactly as required by the schema (object/array/etc.), with no trailing commas or comments.
The output should be formatted as a JSON instance that conforms to the JSON schema below.
As an example, for the schema {{"properties": {{"foo": {{"title": "Foo", "description": "a list of strings", "type": "array", "items": {{"type": "string"}}}}}}, "required": ["foo"]}} the object {{"foo": ["bar", "baz"]}} is a well-formatted instance of the schema. The object {{"properties": {{"foo": ["bar", "baz"]}}}} is not well-formatted.
Here is the output schema (shown in a code block for readability only — do not include any backticks or Markdown in your output):
```
{schema}
```""" # noqa: E501
Source
Frequently Asked Questions
What does format_instructions.py do?
format_instructions.py is a source file in the langchain codebase, written in python.
Where is format_instructions.py in the architecture?
format_instructions.py is located at libs/core/langchain_core/output_parsers/format_instructions.py (directory: libs/core/langchain_core/output_parsers).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free