genai.extensions.langchain.utils module#
- class genai.extensions.langchain.utils.CustomAIMessageChunk[source]#
Bases:
AIMessageChunk
Replaces LangChain’s ‘merge_dicts’ with our simplified ‘merge_objects’ utility
- class genai.extensions.langchain.utils.CustomChatGenerationChunk[source]#
Bases:
ChatGenerationChunk
- genai.extensions.langchain.utils.create_llm_output(*, model, token_usages=None, **kwargs)[source]#
- Parameters:
model (str) –
token_usages (list[dict | None] | None) –
- Return type:
dict[str, Any]
- genai.extensions.langchain.utils.dump_optional_model(model)[source]#
- Parameters:
model (BaseModel | None) –
- Return type:
Mapping[str, Any] | None
- genai.extensions.langchain.utils.load_config(file)[source]#
- Parameters:
file (str | Path) –
- Return type:
dict