diff --git a/sdks/python/examples/demo_data_generator.py b/sdks/python/examples/demo_data_generator.py index 3dc91f8ab4..8b411e02c5 100644 --- a/sdks/python/examples/demo_data_generator.py +++ b/sdks/python/examples/demo_data_generator.py @@ -11,10 +11,11 @@ UUID_MAP = {} + def get_new_uuid(old_id): """ The demo_data has the IDs hardcoded in, to preserve the relationships between the traces and spans. - However, we need to generate unique ones before logging them. + However, we need to generate unique ones before logging them. """ if old_id in UUID_MAP: new_id = UUID_MAP[old_id] @@ -23,9 +24,15 @@ def get_new_uuid(old_id): UUID_MAP[old_id] = new_id return new_id + def create_demo_data(base_url: str, workspace_name, comet_api_key): - - client = opik.Opik(project_name="Demo evaluation", workspace=workspace_name, host=base_url, api_key=comet_api_key) + + client = opik.Opik( + project_name="Demo evaluation", + workspace=workspace_name, + host=base_url, + api_key=comet_api_key, + ) for trace in sorted(evaluation_traces, key=lambda x: x["start_time"]): new_id = get_new_uuid(trace["id"]) @@ -46,7 +53,12 @@ def create_demo_data(base_url: str, workspace_name, comet_api_key): # We have a simple chatbot application built using llama-index. # We gave it the content of Opik documentation as context, and then asked it a few questions. - client = opik.Opik(project_name="Demo chatbot 🤖", workspace=workspace_name, host=base_url, api_key=comet_api_key) + client = opik.Opik( + project_name="Demo chatbot 🤖", + workspace=workspace_name, + host=base_url, + api_key=comet_api_key, + ) for trace in sorted(demo_traces, key=lambda x: x["start_time"]): new_id = get_new_uuid(trace["id"])