langchain/libs/cli/langchain_cli/integration_template
ccurme 22d1a7d7b6
standard-tests[patch]: require model_name in response_metadata if returns_usage_metadata (#30497)
We are implementing a token-counting callback handler in
`langchain-core` that is intended to work with all chat models
supporting usage metadata. The callback will aggregate usage metadata by
model. This requires responses to include the model name in its
metadata.

To support this, if a model `returns_usage_metadata`, we check that it
includes a string model name in its `response_metadata` in the
`"model_name"` key.

More context: https://github.com/langchain-ai/langchain/pull/30487
2025-03-26 12:20:53 -04:00
..
docs cli: update integration doc template for tools (#30188) 2025-03-09 21:14:43 +00:00
integration_template standard-tests[patch]: require model_name in response_metadata if returns_usage_metadata (#30497) 2025-03-26 12:20:53 -04:00
scripts
tests docs: standard tests to markdown, load templates from files (#28603) 2024-12-07 01:37:21 +00:00
.gitignore
LICENSE
Makefile cli: standard tests in cli, test that they run, skip vectorstore tests (#28521) 2024-12-05 00:38:32 -08:00
pyproject.toml cli: release 0.0.34 (#28525) 2024-12-05 15:35:49 +00:00
README.md

package_name

This package contains the LangChain integration with ModuleName

Installation

pip install -U __package_name__

And you should configure credentials by setting the following environment variables:

  • TODO: fill this out

Chat Models

Chat__ModuleName__ class exposes chat models from ModuleName.

from __module_name__ import Chat__ModuleName__

llm = Chat__ModuleName__()
llm.invoke("Sing a ballad of LangChain.")

Embeddings

__ModuleName__Embeddings class exposes embeddings from ModuleName.

from __module_name__ import __ModuleName__Embeddings

embeddings = __ModuleName__Embeddings()
embeddings.embed_query("What is the meaning of life?")

LLMs

__ModuleName__LLM class exposes LLMs from ModuleName.

from __module_name__ import __ModuleName__LLM

llm = __ModuleName__LLM()
llm.invoke("The meaning of life is")