55import json
66import os
77from concurrent .futures import ThreadPoolExecutor
8- from typing import List , Optional , Union
8+ from typing import Any , Dict , List , Optional , Union
99
1010import tiktoken
1111
@@ -76,6 +76,7 @@ def generate_description(
7676 title : Optional [str ] = None ,
7777 instructions : Optional [str ] = None ,
7878 additional_context : Optional [str ] = None ,
79+ params : Optional [Dict [str , Any ]] = None ,
7980):
8081 """Generate the description for the test results."""
8182 from validmind .api_client import generate_test_result_description
@@ -124,6 +125,7 @@ def generate_description(
124125 "figures" : [figure ._get_b64_url () for figure in figures or []],
125126 "additional_context" : additional_context ,
126127 "instructions" : instructions ,
128+ "params" : params ,
127129 }
128130 )["content" ]
129131
@@ -137,6 +139,7 @@ def background_generate_description(
137139 title : Optional [str ] = None ,
138140 instructions : Optional [str ] = None ,
139141 additional_context : Optional [str ] = None ,
142+ params : Optional [Dict [str , Any ]] = None ,
140143):
141144 def wrapped ():
142145 try :
@@ -150,6 +153,7 @@ def wrapped():
150153 title = title ,
151154 instructions = instructions ,
152155 additional_context = additional_context ,
156+ params = params ,
153157 ),
154158 True ,
155159 )
@@ -181,6 +185,7 @@ def get_result_description(
181185 title : Optional [str ] = None ,
182186 instructions : Optional [str ] = None ,
183187 additional_context : Optional [str ] = None ,
188+ params : Optional [Dict [str , Any ]] = None ,
184189):
185190 """Get the metadata dictionary for a test or metric result.
186191
@@ -204,6 +209,7 @@ def get_result_description(
204209 should_generate (bool): Whether to generate the description or not. Defaults to True.
205210 instructions (Optional[str]): Instructions for the LLM to generate the description.
206211 additional_context (Optional[str]): Additional context for the LLM to generate the description.
212+ params (Optional[Dict[str, Any]]): Test parameters used to customize test behavior.
207213
208214 Returns:
209215 str: The description to be logged with the test results.
@@ -232,6 +238,7 @@ def get_result_description(
232238 title = title ,
233239 instructions = _instructions ,
234240 additional_context = additional_context ,
241+ params = params ,
235242 )
236243
237244 else :
0 commit comments