mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-06 13:22:12 +00:00
Skip creating the default agent if there's no default conversation config
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import logging
|
||||
import math
|
||||
import random
|
||||
import secrets
|
||||
@@ -46,6 +47,8 @@ from khoj.utils import state
|
||||
from khoj.utils.config import OfflineChatProcessorModel
|
||||
from khoj.utils.helpers import generate_random_name, is_none_or_empty
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class SubscriptionState(Enum):
|
||||
TRIAL = "trial"
|
||||
@@ -436,6 +439,9 @@ class AgentAdapters:
|
||||
@staticmethod
|
||||
def create_default_agent():
|
||||
default_conversation_config = ConversationAdapters.get_default_conversation_config()
|
||||
if default_conversation_config is None:
|
||||
logger.info("No default conversation config found, skipping default agent creation")
|
||||
return None
|
||||
default_personality = prompts.personality.format(current_date="placeholder")
|
||||
|
||||
agent = Agent.objects.filter(name=AgentAdapters.DEFAULT_AGENT_NAME).first()
|
||||
|
||||
Reference in New Issue
Block a user