Skip to content

Commit

Permalink
Fixed a crash with lite_llm_model_uses_system_message == false
Browse files Browse the repository at this point in the history
  • Loading branch information
curvedinf committed Jan 11, 2025
1 parent 50282f5 commit 3f61650
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dir_assistant/assistant/lite_llm_assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,14 @@ def __init__(
self.lite_llm_model = lite_llm_model
self.context_size = lite_llm_context_size
self.pass_through_context_size = lite_llm_pass_through_context_size
self.lite_llm_model_uses_system_message = lite_llm_model_uses_system_message
print(
f"{Fore.LIGHTBLACK_EX}LiteLLM context size: {self.context_size}{Style.RESET_ALL}"
)
if not lite_llm_model_uses_system_message:

def initialize_history(self):
super().initialize_history()
if not self.lite_llm_model_uses_system_message:
self.chat_history[0]["role"] = "user"

def call_completion(self, chat_history):
Expand Down

0 comments on commit 3f61650

Please sign in to comment.