File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
mem_reader/read_multi_modal Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ class BaseLLMConfig(BaseConfig):
1010
1111 model_name_or_path : str = Field (..., description = "Model name or path" )
1212 temperature : float = Field (default = 0.7 , description = "Temperature for sampling" )
13- max_tokens : int = Field (default = 8192 , description = "Maximum number of tokens to generate" )
13+ max_tokens : int = Field (default = 4096 , description = "Maximum number of tokens to generate" )
1414 top_p : float = Field (default = 0.95 , description = "Top-p sampling parameter" )
1515 top_k : int = Field (default = 50 , description = "Top-k sampling parameter" )
1616 remove_think_prefix : bool = Field (
Original file line number Diff line number Diff line change 11"""Parser for system messages."""
22
3+ import ast
34import json
45import re
56import uuid
@@ -137,8 +138,14 @@ def parse_fine(
137138 tool_schema = json .loads (content )
138139 assert isinstance (tool_schema , list ), "Tool schema must be a list[dict]"
139140 except json .JSONDecodeError :
140- logger .warning (f"[SystemParser] Failed to parse tool schema: { content } " )
141- return []
141+ try :
142+ tool_schema = ast .literal_eval (content )
143+ assert isinstance (tool_schema , list ), "Tool schema must be a list[dict]"
144+ except (ValueError , SyntaxError , AssertionError ):
145+ logger .warning (
146+ f"[SystemParser] Failed to parse tool schema with both JSON and ast.literal_eval: { content } "
147+ )
148+ return []
142149 except AssertionError :
143150 logger .warning (f"[SystemParser] Tool schema must be a list[dict]: { content } " )
144151 return []
You can’t perform that action at this time.
0 commit comments