Skip to content

Commit

Permalink
specify stacklevel
Browse files Browse the repository at this point in the history
  • Loading branch information
ccurme committed Nov 12, 2024
1 parent 1c0add6 commit 95a561d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions libs/core/langchain_core/language_models/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import warnings
from abc import ABC, abstractmethod
from collections.abc import Mapping, Sequence
from functools import cache
Expand All @@ -12,7 +13,6 @@
TypeVar,
Union,
)
import warnings

from pydantic import BaseModel, ConfigDict, Field, field_validator
from typing_extensions import TypeAlias, TypedDict, override
Expand Down Expand Up @@ -387,7 +387,8 @@ def get_num_tokens_from_messages(
"""
if tools is not None:
warnings.warn(
"Counting tokens in tool schemas is not yet supported. Ignoring tools."
"Counting tokens in tool schemas is not yet supported. Ignoring tools.",
stacklevel=2,
)
return sum([self.get_num_tokens(get_buffer_string([m])) for m in messages])

Expand Down

0 comments on commit 95a561d

Please sign in to comment.