diff --git a/src/funcchain/_llms.py b/src/funcchain/_llms.py index 4a496df..e3b48ea 100644 --- a/src/funcchain/_llms.py +++ b/src/funcchain/_llms.py @@ -6,7 +6,14 @@ from langchain_core.callbacks.manager import CallbackManagerForLLMRun from langchain_core.language_models import BaseChatModel, BaseLanguageModel -from langchain_core.messages import AIMessage, AIMessageChunk, BaseMessage, ChatMessage, HumanMessage, SystemMessage +from langchain_core.messages import ( + AIMessage, + AIMessageChunk, + BaseMessage, + ChatMessage, + HumanMessage, + SystemMessage, +) from langchain_core.outputs import ChatGeneration, ChatGenerationChunk, ChatResult from langchain_core.pydantic_v1 import Field, root_validator from langchain_core.utils import get_pydantic_field_names diff --git a/src/funcchain/chain/creation.py b/src/funcchain/chain/creation.py index 74eea55..f4ccea1 100644 --- a/src/funcchain/chain/creation.py +++ b/src/funcchain/chain/creation.py @@ -5,7 +5,11 @@ from langchain_core.prompts import ChatPromptTemplate from langchain_core.schema import AIMessage, BaseMessage, BaseOutputParser, HumanMessage from langchain_core.schema.chat_history import BaseChatMessageHistory -from langchain_core.schema.runnable import RunnableSequence, RunnableSerializable, RunnableWithFallbacks +from langchain_core.schema.runnable import ( + RunnableSequence, + RunnableSerializable, + RunnableWithFallbacks, +) from PIL import Image from pydantic import BaseModel @@ -27,7 +31,11 @@ pydantic_to_grammar, univeral_model_selector, ) -from .prompt import HumanImageMessagePromptTemplate, create_chat_prompt, create_instruction_prompt +from .prompt import ( + HumanImageMessagePromptTemplate, + create_chat_prompt, + create_instruction_prompt, +) ChainOutput = TypeVar("ChainOutput") diff --git a/src/funcchain/chain/prompt.py b/src/funcchain/chain/prompt.py index 9f44d27..5a887b7 100644 --- a/src/funcchain/chain/prompt.py +++ b/src/funcchain/chain/prompt.py @@ -4,7 +4,10 @@ from langchain_core.chat_history import BaseChatMessageHistory from langchain_core.messages import BaseMessage, HumanMessage, SystemMessage from langchain_core.prompts import ChatPromptTemplate -from langchain_core.prompts.chat import BaseStringMessagePromptTemplate, MessagePromptTemplateT +from langchain_core.prompts.chat import ( + BaseStringMessagePromptTemplate, + MessagePromptTemplateT, +) from langchain_core.prompts.prompt import PromptTemplate from PIL import Image from pydantic import BaseModel diff --git a/src/funcchain/utils/model_defaults.py b/src/funcchain/utils/model_defaults.py index b6c4d5f..32bc80e 100644 --- a/src/funcchain/utils/model_defaults.py +++ b/src/funcchain/utils/model_defaults.py @@ -1,7 +1,12 @@ from pathlib import Path from typing import Any -from langchain.chat_models import AzureChatOpenAI, ChatAnthropic, ChatGooglePalm, ChatOpenAI +from langchain.chat_models import ( + AzureChatOpenAI, + ChatAnthropic, + ChatGooglePalm, + ChatOpenAI, +) from langchain_core.language_models import BaseChatModel from .._llms import ChatLlamaCpp