Refactor create_conversation function to accept additional keyword arguments for flexibility

This commit is contained in:
2024-10-30 18:43:29 -04:00
parent f4de0049f9
commit f828f9991b
+9 -2
View File
@@ -55,13 +55,20 @@ class Session:
def create_conversation(
llm_model=None, llm_provider=None, *, plugins: Optional[List[BasePlugin]] = None
*,
llm_model=None,
llm_provider=None,
plugins: Optional[List[BasePlugin]] = None,
**kwargs,
):
"""Create a new conversation."""
# Note: kwargs are here to eat up any extra arguments passed in from sessions.
# Create the conversation.
conversation = Conversation(
llm_model=llm_model, llm_provider=llm_provider or settings.DEFAULT_LLM_PROVIDER
llm_model=llm_model,
llm_provider=llm_provider or settings.DEFAULT_LLM_PROVIDER,
)
# Add plugins to the conversation.