langchain/libs/core/tests/unit_tests
ccurme fbfed65fb1
core, partners: add token usage attribute to AIMessage (#21944)
```python
class UsageMetadata(TypedDict):
    """Usage metadata for a message, such as token counts.

    Attributes:
        input_tokens: (int) count of input (or prompt) tokens
        output_tokens: (int) count of output (or completion) tokens
        total_tokens: (int) total token count
    """

    input_tokens: int
    output_tokens: int
    total_tokens: int
```
```python
class AIMessage(BaseMessage):
    ...
    usage_metadata: Optional[UsageMetadata] = None
    """If provided, token usage information associated with the message."""
    ...
```
2024-05-23 14:21:58 -04:00
..
_api core: use qualname in beta message (#20361) 2024-04-23 11:20:13 -07:00
callbacks community, core[callbacks]: move FileCallbackHandler from community to core (#20495) 2024-04-17 22:29:30 -04:00
chat_history core[patch],community[patch]: Move file chat history back to community (#20834) 2024-04-24 12:47:25 -04:00
data Separate out langchain_core package (#13577) 2023-11-20 13:09:30 -08:00
dependencies community[minor]: Add glue catalog loader (#20220) 2024-04-16 11:39:23 -04:00
document_loaders core[minor]: Add aload to document loader (#19936) 2024-04-03 10:46:47 -04:00
documents core[minor]: move document compressor base (#17910) 2024-02-26 17:20:50 -08:00
embeddings core[minor]: moved fake llms and embeddings to core (#19226) 2024-03-18 10:01:26 -07:00
example_selectors core[minor]: Add async methods to MaxMarginalRelevanceExampleSelector (#19639) 2024-03-27 16:03:18 -04:00
examples core:adds tests for partial_variables (#15427) 2024-01-02 15:00:06 -08:00
fake core: Assign missing message ids in BaseChatModel (#19863) 2024-04-02 01:18:36 +00:00
indexing core[minor],langchain[patch]: Move base indexing interface and logic to core (#20667) 2024-04-24 13:18:42 -04:00
language_models community[patch]: update use of deprecated llm methods (#20393) 2024-04-12 17:28:23 -04:00
load BUG: more core fixes (#13665) 2023-11-21 15:15:48 -08:00
messages fix: core: Include in json output also fields set outside the constructor (#21342) 2024-05-06 14:37:36 -07:00
output_parsers core[patch]: improve comma separated list output parser to handle non-space separated list (#20434) 2024-04-25 20:10:56 +00:00
outputs core[patch]: fix ChatGeneration.text with content blocks (#20294) 2024-04-10 15:54:06 -07:00
prompts core: mustache prompt templates (#19980) 2024-04-10 11:25:32 -07:00
runnables core, partners: add token usage attribute to AIMessage (#21944) 2024-05-23 14:21:58 -04:00
stores core[minor],langchain[patch],community[patch]: Move storage interfaces to core (#20750) 2024-04-30 13:14:26 -04:00
tracers core[patch]: Check if event loop is closed in memory stream (#21841) 2024-05-17 21:53:59 +00:00
utils core[patch]: Fix NPE in function_calling._get_python_function_required_args (#21863) 2024-05-20 22:06:27 +00:00
__init__.py Separate out langchain_core package (#13577) 2023-11-20 13:09:30 -08:00
conftest.py fix: core: Include in json output also fields set outside the constructor (#21342) 2024-05-06 14:37:36 -07:00
prompt_file.txt Separate out langchain_core package (#13577) 2023-11-20 13:09:30 -08:00
stubs.py core: Assign missing message ids in BaseChatModel (#19863) 2024-04-02 01:18:36 +00:00
test_globals.py Separate out langchain_core package (#13577) 2023-11-20 13:09:30 -08:00
test_imports.py infra: Fix test filesystem paths incompatible with windows (#14388) 2023-12-21 13:45:42 -08:00
test_messages.py core, partners: add token usage attribute to AIMessage (#21944) 2024-05-23 14:21:58 -04:00
test_outputs.py REFACTOR: Refactor langchain_core (#13627) 2023-11-21 08:35:29 -08:00
test_sys_info.py core(minor): Add a way to print out system information for debugging purposes. (#15718) 2024-01-08 12:20:18 -08:00
test_tools.py infra: rm unused # noqa violations (#22049) 2024-05-22 15:21:08 -07:00