File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
libs/core/langchain_core/language_models Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 1
1
from __future__ import annotations
2
2
3
+ import warnings
3
4
from abc import ABC , abstractmethod
4
5
from collections .abc import Mapping , Sequence
5
6
from functools import cache
12
13
TypeVar ,
13
14
Union ,
14
15
)
15
- import warnings
16
16
17
17
from pydantic import BaseModel , ConfigDict , Field , field_validator
18
18
from typing_extensions import TypeAlias , TypedDict , override
@@ -387,7 +387,8 @@ def get_num_tokens_from_messages(
387
387
"""
388
388
if tools is not None :
389
389
warnings .warn (
390
- "Counting tokens in tool schemas is not yet supported. Ignoring tools."
390
+ "Counting tokens in tool schemas is not yet supported. Ignoring tools." ,
391
+ stacklevel = 2 ,
391
392
)
392
393
return sum ([self .get_num_tokens (get_buffer_string ([m ])) for m in messages ])
393
394
You can’t perform that action at this time.
0 commit comments