From ea177ef8e2e78d9f841d02c17c2d4fe32b9e612e Mon Sep 17 00:00:00 2001 From: cthomas Date: Tue, 8 Apr 2025 14:13:56 -0700 Subject: [PATCH] fix: change llm config validation errors to warnings (#1623) --- letta/schemas/llm_config.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/letta/schemas/llm_config.py b/letta/schemas/llm_config.py index 255dcc66..e5c24540 100644 --- a/letta/schemas/llm_config.py +++ b/letta/schemas/llm_config.py @@ -2,6 +2,10 @@ from typing import Literal, Optional from pydantic import BaseModel, ConfigDict, Field, model_validator +from letta.log import get_logger + +logger = get_logger(__name__) + class LLMConfig(BaseModel): """ @@ -88,14 +92,14 @@ class LLMConfig(BaseModel): return values @model_validator(mode="after") - def validate_reasoning_constraints(self) -> "LLMConfig": + def issue_warning_for_reasoning_constraints(self) -> "LLMConfig": if self.enable_reasoner: if self.max_reasoning_tokens is None: - raise ValueError("max_reasoning_tokens must be set when enable_reasoner is True") + logger.warning("max_reasoning_tokens must be set when enable_reasoner is True") if self.max_tokens is not None and self.max_reasoning_tokens >= self.max_tokens: - raise ValueError("max_tokens must be greater than max_reasoning_tokens (thinking budget)") + logger.warning("max_tokens must be greater than max_reasoning_tokens (thinking budget)") if self.put_inner_thoughts_in_kwargs: - raise ValueError("Extended thinking is not compatible with put_inner_thoughts_in_kwargs") + logger.warning("Extended thinking is not compatible with put_inner_thoughts_in_kwargs") return self @classmethod