@@ -1298,7 +1298,7 @@ def create_prompt(
12981298 name : str ,
12991299 prompt : List [ChatMessageDict ],
13001300 is_active : Optional [bool ] = None , # deprecated
1301- labels : List [str ] = [] ,
1301+ labels : Optional [ List [str ]] = None ,
13021302 tags : Optional [List [str ]] = None ,
13031303 type : Optional [Literal ["chat" ]],
13041304 config : Optional [Any ] = None ,
@@ -1312,7 +1312,7 @@ def create_prompt(
13121312 name : str ,
13131313 prompt : str ,
13141314 is_active : Optional [bool ] = None , # deprecated
1315- labels : List [str ] = [] ,
1315+ labels : Optional [ List [str ]] = None ,
13161316 tags : Optional [List [str ]] = None ,
13171317 type : Optional [Literal ["text" ]] = "text" ,
13181318 config : Optional [Any ] = None ,
@@ -1325,7 +1325,7 @@ def create_prompt(
13251325 name : str ,
13261326 prompt : Union [str , List [ChatMessageDict ]],
13271327 is_active : Optional [bool ] = None , # deprecated
1328- labels : List [str ] = [] ,
1328+ labels : Optional [ List [str ]] = None ,
13291329 tags : Optional [List [str ]] = None ,
13301330 type : Optional [Literal ["chat" , "text" ]] = "text" ,
13311331 config : Optional [Any ] = None ,
@@ -1347,6 +1347,8 @@ def create_prompt(
13471347 TextPromptClient: The prompt if type argument is 'text'.
13481348 ChatPromptClient: The prompt if type argument is 'chat'.
13491349 """
1350+ if labels is None :
1351+ labels = []
13501352 try :
13511353 self .log .debug (f"Creating prompt { name = } , { version = } , { labels = } " )
13521354
@@ -1401,7 +1403,7 @@ def update_prompt(
14011403 * ,
14021404 name : str ,
14031405 version : int ,
1404- new_labels : List [str ] = [] ,
1406+ new_labels : Optional [ List [str ]] = None ,
14051407 ):
14061408 """Update an existing prompt version in Langfuse. The Langfuse SDK prompt cache is invalidated for all prompts witht he specified name.
14071409
@@ -1414,6 +1416,8 @@ def update_prompt(
14141416 Prompt: The updated prompt from the Langfuse API.
14151417
14161418 """
1419+ if new_labels is None :
1420+ new_labels = []
14171421 updated_prompt = self .client .prompt_version .update (
14181422 name = name ,
14191423 version = version ,
@@ -3424,7 +3428,7 @@ def observe_llama_index(
34243428 run_name : str ,
34253429 run_description : Optional [str ] = None ,
34263430 run_metadata : Optional [Any ] = None ,
3427- llama_index_integration_constructor_kwargs : Optional [Dict [str , Any ]] = {} ,
3431+ llama_index_integration_constructor_kwargs : Optional [Dict [str , Any ]] = None ,
34283432 ):
34293433 """Context manager for observing LlamaIndex operations linked to this dataset item.
34303434
@@ -3454,6 +3458,8 @@ def observe_llama_index(
34543458 Raises:
34553459 ImportError: If required modules for LlamaIndex integration are not available.
34563460 """
3461+ if llama_index_integration_constructor_kwargs is None :
3462+ llama_index_integration_constructor_kwargs = {}
34573463 metadata = {
34583464 "dataset_item_id" : self .id ,
34593465 "run_name" : run_name ,
@@ -3513,7 +3519,7 @@ def get_llama_index_handler(
35133519 run_name : str ,
35143520 run_description : Optional [str ] = None ,
35153521 run_metadata : Optional [Any ] = None ,
3516- llama_index_integration_constructor_kwargs : Optional [Dict [str , Any ]] = {} ,
3522+ llama_index_integration_constructor_kwargs : Optional [Dict [str , Any ]] = None ,
35173523 ):
35183524 """Create and get a llama-index callback handler linked to this dataset item.
35193525
@@ -3526,6 +3532,8 @@ def get_llama_index_handler(
35263532 Returns:
35273533 LlamaIndexCallbackHandler: An instance of LlamaIndexCallbackHandler linked to the dataset item.
35283534 """
3535+ if llama_index_integration_constructor_kwargs is None :
3536+ llama_index_integration_constructor_kwargs = {}
35293537 metadata = {
35303538 "dataset_item_id" : self .id ,
35313539 "run_name" : run_name ,
0 commit comments