Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Amanda Savluchinske <amandasavluchinske@gmail.com>
  • Loading branch information
fjsj and amandasavluchinske authored Jun 19, 2024
1 parent 03e4a01 commit 3e3b621
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions django_ai_assistant/helpers/assistants.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def __init_subclass__(cls, **kwargs):
"""Called when a class is subclassed from AIAssistant.
This method is automatically invoked when a new subclass of AIAssistant
is created. It allows AIAssistant to perform additional setup or configuration
is created. It allows AIAssistant to perform additional setup or configuration.
for the subclass, such as registering the subclass in a registry.
Args:
Expand Down Expand Up @@ -237,7 +237,7 @@ def get_model_kwargs(self) -> dict[str, Any]:

def get_prompt_template(self) -> ChatPromptTemplate:
"""Get the `ChatPromptTemplate` for the Langchain chain to use.\n
The system prompt come from the `get_instructions` method.\n
The system prompt comes from the `get_instructions` method.\n
The template includes placeholders for the instructions, chat `{history}`, user `{input}`,
and `{agent_scratchpad}`, all which are necessary for the chain to work properly.\n
The chat history is filled by the chain using the message history from `get_message_history`.\n
Expand Down Expand Up @@ -417,7 +417,7 @@ def get_history_aware_retriever(self) -> Runnable[dict, RetrieverOutput]:

def as_chain(self, thread_id: int | None) -> Runnable[dict, dict]:
"""Create the Langchain chain for the assistant.\n
This chain is a agent that supports chat history, tool calling, and RAG (if `has_rag=True`).\n
This chain is an agent that supports chat history, tool calling, and RAG (if `has_rag=True`).\n
`as_chain` uses many other methods to create the chain.\n
Prefer to override the other methods to customize the chain for the assistant.
Only override this method if you need to customize the chain at a lower level.
Expand Down

0 comments on commit 3e3b621

Please sign in to comment.