style(core): fix some noqa escapes (#34675)

Co-authored-by: Mason Daugherty <github@mdrxy.com>
Co-authored-by: Mason Daugherty <mason@langchain.dev>
This commit is contained in:
Christophe Bornet
2026-01-09 23:36:08 +01:00
committed by GitHub
parent fd69425439
commit 8e3c6b109f
25 changed files with 286 additions and 149 deletions

View File

@@ -2,9 +2,9 @@
from __future__ import annotations
import builtins # noqa: TC003
import contextlib
import json
import typing
from abc import ABC, abstractmethod
from collections.abc import Mapping # noqa: TC003
from functools import cached_property
@@ -51,7 +51,7 @@ class BasePromptTemplate(
These variables are auto inferred from the prompt and user need not provide them.
"""
input_types: typing.Dict[str, Any] = Field(default_factory=dict, exclude=True) # noqa: UP006
input_types: builtins.dict[str, Any] = Field(default_factory=dict, exclude=True)
"""A dictionary of the types of the variables the prompt template expects.
If not provided, all variables are assumed to be strings.
@@ -64,7 +64,7 @@ class BasePromptTemplate(
Partial variables populate the template so that you don't need to pass them in every
time you call the prompt.
"""
metadata: typing.Dict[str, Any] | None = None # noqa: UP006
metadata: builtins.dict[str, Any] | None = None
"""Metadata to be used for tracing."""
tags: list[str] | None = None
"""Tags to be used for tracing."""

View File

@@ -845,9 +845,9 @@ class ChatPromptTemplate(BaseChatPromptTemplate):
!!! note "Single-variable template"
If your prompt has only a single input variable (i.e., 1 instance of "{variable_nams}"),
and you invoke the template with a non-dict object, the prompt template will
inject the provided argument into that variable location.
If your prompt has only a single input variable (i.e., 1 instance of
"{variable_nams}"), and you invoke the template with a non-dict object, the
prompt template will inject the provided argument into that variable location.
```python
from langchain_core.prompts import ChatPromptTemplate
@@ -871,7 +871,7 @@ class ChatPromptTemplate(BaseChatPromptTemplate):
# ]
# )
```
""" # noqa: E501
"""
messages: Annotated[list[MessageLike], SkipValidation()]
"""List of messages consisting of either message prompt templates or messages."""