Home / Function/ test_image_prompt_template_deserializable_old() — langchain Function Reference

test_image_prompt_template_deserializable_old() — langchain Function Reference

Architecture documentation for the test_image_prompt_template_deserializable_old() function in test_image.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  a5f5fbdc_a001_bd96_6e37_b7b6c875358d["test_image_prompt_template_deserializable_old()"]
  2a2911fa_5788_9b58_e748_943d24d9d560["test_image.py"]
  a5f5fbdc_a001_bd96_6e37_b7b6c875358d -->|defined in| 2a2911fa_5788_9b58_e748_943d24d9d560
  style a5f5fbdc_a001_bd96_6e37_b7b6c875358d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/prompts/test_image.py lines 18–109

def test_image_prompt_template_deserializable_old() -> None:
    """Test that the image prompt template is serializable."""
    loads(
        json.dumps(
            {
                "lc": 1,
                "type": "constructor",
                "id": ["langchain", "prompts", "chat", "ChatPromptTemplate"],
                "kwargs": {
                    "messages": [
                        {
                            "lc": 1,
                            "type": "constructor",
                            "id": [
                                "langchain",
                                "prompts",
                                "chat",
                                "SystemMessagePromptTemplate",
                            ],
                            "kwargs": {
                                "prompt": [
                                    {
                                        "lc": 1,
                                        "type": "constructor",
                                        "id": [
                                            "langchain",
                                            "prompts",
                                            "prompt",
                                            "PromptTemplate",
                                        ],
                                        "kwargs": {
                                            "template": "Foo",
                                            "input_variables": [],
                                            "template_format": "f-string",
                                            "partial_variables": {},
                                        },
                                    }
                                ]
                            },
                        },
                        {
                            "lc": 1,
                            "type": "constructor",
                            "id": [
                                "langchain",
                                "prompts",
                                "chat",
                                "HumanMessagePromptTemplate",
                            ],
                            "kwargs": {
                                "prompt": [
                                    {
                                        "lc": 1,
                                        "type": "constructor",
                                        "id": [
                                            "langchain",
                                            "prompts",
                                            "image",
                                            "ImagePromptTemplate",
                                        ],
                                        "kwargs": {
                                            "template": {
                                                "url": "data:image/png;base64,{img}"
                                            },
                                            "input_variables": ["img"],
                                        },
                                    },
                                    {
                                        "lc": 1,
                                        "type": "constructor",
                                        "id": [
                                            "langchain",
                                            "prompts",
                                            "prompt",
                                            "PromptTemplate",
                                        ],
                                        "kwargs": {
                                            "template": "{input}",
                                            "input_variables": ["input"],
                                            "template_format": "f-string",
                                            "partial_variables": {},

Domain

Subdomains

Frequently Asked Questions

What does test_image_prompt_template_deserializable_old() do?
test_image_prompt_template_deserializable_old() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/prompts/test_image.py.
Where is test_image_prompt_template_deserializable_old() defined?
test_image_prompt_template_deserializable_old() is defined in libs/core/tests/unit_tests/prompts/test_image.py at line 18.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free