# LangChain

These are the classes to use with LangChain.

- *class* imagine.langchain.ImagineChat(*\*args*, *client*, *async\_client*, *api\_key=None*, *endpoint=None*, *max\_retries=5*, *timeout=120*, *verify=False*, *name=None*, *cache=None*, *verbose=&lt;factory&gt;*, *callbacks=None*, *tags=None*, *metadata=None*, *custom\_get\_token\_ids=None*, *rate\_limiter=None*, *disable\_streaming=False*, *output\_version=&lt;factory&gt;*, *profile=None*, *model='Llama-3.1-8B'*, *temperature=0.0*, *max\_tokens=None*, *top\_k=None*, *top\_p=None*, *streaming=False*, *frequency\_penalty=None*, *presence\_penalty=None*, *repetition\_penalty=None*, *stop=None*, *max\_seconds=None*, *ignore\_eos=None*, *skip\_special\_tokens=None*, *stop\_token\_ids=None*)[\[source\]](https://docs.qualcomm.com/doc/80-88545-1/topic/chat_models.html#ImagineChat)

    - A chat model that use Imagine Inference API

- *classmethod* get\_lc\_namespace()[\[source\]](https://docs.qualcomm.com/doc/80-88545-1/topic/chat_models.html#ImagineChat.get_lc_namespace)

    - Get the namespace of the langchain object.

- *classmethod* is\_lc\_serializable()[\[source\]](https://docs.qualcomm.com/doc/80-88545-1/topic/chat_models.html#ImagineChat.is_lc_serializable)

    - Return whether this model can be serialized by Langchain.

- *class* imagine.langchain.ImagineLLM(*\*args*, *client*, *async\_client*, *api\_key=None*, *endpoint=None*, *max\_retries=5*, *timeout=120*, *verify=False*, *name=None*, *cache=None*, *verbose=&lt;factory&gt;*, *callbacks=None*, *tags=None*, *metadata=None*, *custom\_get\_token\_ids=None*, *model='Llama-3.1-8B'*, *temperature=0.0*, *max\_tokens=None*, *top\_k=None*, *top\_p=None*, *streaming=False*, *frequency\_penalty=None*, *presence\_penalty=None*, *repetition\_penalty=None*, *stop=None*, *max\_seconds=None*, *ignore\_eos=None*, *skip\_special\_tokens=None*, *stop\_token\_ids=None*)[\[source\]](https://docs.qualcomm.com/doc/80-88545-1/topic/llms.html#ImagineLLM)

    - An LLM that uses Imagine Inference API

- *class* imagine.langchain.ImagineEmbeddings(*\**, *client*, *async\_client*, *api\_key=None*, *endpoint=None*, *max\_retries=5*, *timeout=120*, *verify=False*, *max\_concurrent\_requests=64*, *model='BAAI/bge-large-en-v1.5'*)[\[source\]](https://docs.qualcomm.com/doc/80-88545-1/topic/embeddings.html#ImagineEmbeddings)

    - Imagine embedding models.

- *async* aembed\_documents(*texts*)[\[source\]](https://docs.qualcomm.com/doc/80-88545-1/topic/embeddings.html#ImagineEmbeddings.aembed_documents)

    - Embed a list of document texts.

- Args:
    - texts: The list of texts to embed.

- Returns:
    - List of embeddings, one for each text.

- *async* aembed\_query(*text*)[\[source\]](https://docs.qualcomm.com/doc/80-88545-1/topic/embeddings.html#ImagineEmbeddings.aembed_query)

    - Embed a single query text.

- Args:
    - text: The text to embed.

- Returns:
    - Embedding for the text.

- embed\_documents(*texts*)[\[source\]](https://docs.qualcomm.com/doc/80-88545-1/topic/embeddings.html#ImagineEmbeddings.embed_documents)

    - Embed a list of document texts.

- Args:
    - texts: The list of texts to embed.

- Returns:
    - List of embeddings, one for each text.

- embed\_query(*text*)[\[source\]](https://docs.qualcomm.com/doc/80-88545-1/topic/embeddings.html#ImagineEmbeddings.embed_query)

    - Embed a single query text.

- Args:
    - text: The text to embed.

- Returns:
    - Embedding for the text.

## Next steps

- Review code samples on [how to use LangChain with the Qualcomm AI Inference Suite SDK](https://docs.qualcomm.com/doc/80-88545-1/topic/langchain.html#3_0_langchain.md)
- See [LangChain Docs](https://docs.langchain.com/) for general information about LangChain.

Last Published: Apr 17, 2026

[Previous Topic
Data transfer objects and exceptions](https://docs.qualcomm.com/bundle/publicresource/80-88545-1/topics/dtos.md)