llumo 0.2.41__py3-none-any.whl → 0.2.42__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
llumo/client.py CHANGED
@@ -820,6 +820,8 @@ class LlumoClient:
820
820
  allBatches = []
821
821
  for index, row in dataframe.iterrows():
822
822
  # Extract required fields
823
+ query = row.get("query", "")
824
+ context = row.get("context", "")
823
825
  tools = row.get("tools", "")
824
826
  groundTruth = row.get("groundTruth", "")
825
827
  messageHistory = row.get("messageHistory", "")
@@ -827,42 +829,43 @@ class LlumoClient:
827
829
  output = row.get("output", "")
828
830
 
829
831
  # Initialize query and context
830
- query = ""
831
- context = ""
832
-
833
- # Process prompt template if provided
834
- if promptTemplate:
835
- # Extract template variables
836
- keys = re.findall(r"{{(.*?)}}", promptTemplate)
837
-
838
- if not all([key in dataframe.columns for key in keys]):
839
- raise LlumoAIError.InvalidPromptTemplate()
840
-
841
- # Populate template and separate query/context
842
- populated_template = promptTemplate
843
- for key in keys:
844
- value = row.get(key, "")
845
- if isinstance(value, str):
846
- length = len(value.split()) * 1.5
847
- if length <= 50:
848
- # Short value - include in query via template
849
- temp_obj = {key: value}
850
- populated_template = getInputPopulatedPrompt(populated_template, temp_obj)
851
- else:
852
- # Long value - add to context
853
- context += f" {key}: {value}, "
854
-
855
- query = populated_template.strip()
856
-
857
- # Add any remaining context from other fields
858
- if not context.strip():
859
- for key, value in row.items():
860
- if key not in keys and isinstance(value, str) and value.strip():
861
- context += f" {key}: {value}, "
862
- else:
863
- # No prompt template - use direct query and context fields
864
- query = row.get("query", "")
865
- context = row.get("context", "")
832
+ # query = ""
833
+ # context = ""
834
+
835
+ # # Process prompt template if provided
836
+ # if promptTemplate:
837
+ # # Extract template variables
838
+ # keys = re.findall(r"{{(.*?)}}", promptTemplate)
839
+
840
+ # if not all([key in dataframe.columns for key in keys]):
841
+ # # raise LlumoAIError.InvalidPromptTemplate()
842
+ # break
843
+
844
+ # # Populate template and separate query/context
845
+ # populated_template = promptTemplate
846
+ # for key in keys:
847
+ # value = row.get(key, "")
848
+ # if isinstance(value, str):
849
+ # length = len(value.split()) * 1.5
850
+ # if length <= 50:
851
+ # # Short value - include in query via template
852
+ # temp_obj = {key: value}
853
+ # populated_template = getInputPopulatedPrompt(populated_template, temp_obj)
854
+ # else:
855
+ # # Long value - add to context
856
+ # context += f" {key}: {value}, "
857
+
858
+ # query = populated_template.strip()
859
+
860
+ # # Add any remaining context from other fields
861
+ # if not context.strip():
862
+ # for key, value in row.items():
863
+ # if key not in keys and isinstance(value, str) and value.strip():
864
+ # context += f" {key}: {value}, "
865
+ # else:
866
+ # # No prompt template - use direct query and context fields
867
+ # query = row.get("query", "")
868
+ # context = row.get("context", "")
866
869
 
867
870
  INPUT_TOKEN_PRICE = 0.0000025
868
871
  OUTPUT_TOKEN_PRICE = 0.00001
@@ -885,7 +888,10 @@ class LlumoClient:
885
888
  "totalTokens": totalTokens,
886
889
  "cost": round(cost, 8),
887
890
  "modelsUsed": "gpt-4o",
888
- "latency":round(random.uniform(1,1.6),2)
891
+ "latency":round(random.uniform(1,1.6),2),
892
+ "promptTemplate": promptTemplate,
893
+ "systemInstructions": systemInstructions
894
+
889
895
 
890
896
  }
891
897
  currentTime = datetime(2025, 8, 2, 10, 20, 15, tzinfo=timezone.utc)
@@ -910,8 +916,7 @@ class LlumoClient:
910
916
  "columnID":rowID,
911
917
  "rowID":columnID,
912
918
  "latency": random.randint(1000, 1500),
913
- "promptTemplate":promptTemplate,
914
- "systemInstructions":systemInstructions
919
+
915
920
 
916
921
  }
917
922
 
@@ -921,7 +926,7 @@ class LlumoClient:
921
926
  for i, batch in enumerate(allBatches, start=1):
922
927
 
923
928
  try:
924
- # print(batch)
929
+ # print(batch)
925
930
  response = postForDebugLogs(record=batch,workspaceID=workspaceID)
926
931
 
927
932
  # failure case inside response
@@ -938,9 +943,6 @@ class LlumoClient:
938
943
 
939
944
  print("Records Uploaded successfully. You may now review your logs at: https://app.llumo.ai/logs")
940
945
 
941
-
942
- # Wait for results
943
-
944
946
  # def evaluateMultiple(
945
947
  # self,
946
948
  # data,
@@ -2082,13 +2084,13 @@ class LlumoClient:
2082
2084
  definationMapping=self.definationMapping,
2083
2085
  )
2084
2086
 
2085
- def get_evaluate_multiple(
2087
+ def getEvaluateMultiple(
2086
2088
  self,
2087
2089
  data,
2088
2090
  evals
2089
2091
  ) -> List:
2090
2092
 
2091
- print("Evaluating multiple data with evals:", data, evals)
2093
+ # print("Evaluating multiple data with evals:", data, evals)
2092
2094
 
2093
2095
  dataID = uuid.uuid4().hex[:36]
2094
2096
 
@@ -2105,7 +2107,7 @@ class LlumoClient:
2105
2107
  "playgroundID": self.playgroundID,
2106
2108
  }
2107
2109
 
2108
- print("payload", payload)
2110
+ # print("payload", payload)
2109
2111
 
2110
2112
  # Create evaluation
2111
2113
  requests.post(
@@ -2186,7 +2188,7 @@ class LlumoClient:
2186
2188
  "reasoning": reasoning,
2187
2189
  }
2188
2190
 
2189
- print(formatted_row)
2191
+ # print(formatted_row)
2190
2192
  formatted_results.append(formatted_row)
2191
2193
 
2192
2194
  return formatted_results
@@ -102,9 +102,10 @@ class LlumoSessionContext(LlumoClient):
102
102
  "totalTokens": "",
103
103
  "cost": "",
104
104
  "modelsUsed": "gpt-4o",
105
+ "promptTemplate": promptTemplate,
106
+ "systemInstructions": systemInstructions
105
107
  },
106
- "promptTemplate":promptTemplate,
107
- "systemInstructions":systemInstructions
108
+
108
109
  }
109
110
 
110
111
  self.threadLlumoRun = _ctxLlumoRun.set(llumoRun)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: llumo
3
- Version: 0.2.41
3
+ Version: 0.2.42
4
4
  Summary: Python SDK for interacting with the Llumo ai API.
5
5
  Home-page: https://www.llumo.ai/
6
6
  Author: Llumo
@@ -2,19 +2,19 @@ llumo/__init__.py,sha256=kkuppu7ZPiVZFdnYzJ9BM3syMbYHOSZLpwKwAvGHsnY,311
2
2
  llumo/callback.py,sha256=XQbImLnd64_B2Iir-FCaJcL5Kmpm3RlXJH2zDRXk_yk,25135
3
3
  llumo/callbacks-0.py,sha256=TEIOCWRvk2UYsTmBMBsnlgpqWvr-2y3a6d0w_e96NRM,8958
4
4
  llumo/chains.py,sha256=6lCgLseh04RUgc6SahhmvQj82quay2Mi1j8gPUlx8Es,2923
5
- llumo/client.py,sha256=YTNdvtv03BVDNHeLypHQadDN2PpXsyOk0dM8hc7P-Ts,83205
5
+ llumo/client.py,sha256=Sf9QaKWIsAHYAX78YQT2U93A0LuwkluKQQvCMg2vRwM,83386
6
6
  llumo/exceptions.py,sha256=1OyhN9YL9LcyUPUsqYHq6Rret0udATZAwMVJaio2_Ec,2123
7
7
  llumo/execution.py,sha256=nWbJ7AvWuUPcOb6i-JzKRna_PvF-ewZTiK8skS-5n3w,1380
8
8
  llumo/functionCalling.py,sha256=D5jYapu1rIvdIJNUYPYMTyhQ1H-6nkwoOLMi6eekfUE,7241
9
9
  llumo/google.py,sha256=6y9YnDFDRHv6-sQNT5LIsV9p31BCN0B9eow5KTRBWfM,2185
10
10
  llumo/helpingFuntions.py,sha256=eMR2Rq8vw4X5sIESOvjOBrEvyYE00Eq7XlQjV66eVcg,29977
11
11
  llumo/llumoLogger.py,sha256=ALM4461jItWcvYL9HzTGmB-X-M77YF_9PTeTPxtmP_E,2223
12
- llumo/llumoSessionContext.py,sha256=XA2SIXKh62NRz1qxkvhpo7ziOhushG2CkJgjUWlmvFw,14880
12
+ llumo/llumoSessionContext.py,sha256=QaiQtB13dITTVINpzEAEVlO-fpW362XkgMjM1W4EHoo,14891
13
13
  llumo/models.py,sha256=aVEZsOOoQx5LeNtwSyBxqvrINq0izH3QWu_YjsMPE6o,2910
14
14
  llumo/openai.py,sha256=VstBzaORe8Tq0feUIIEszzcN1oq6TJfkPviaCr5d3Bw,8950
15
15
  llumo/sockets.py,sha256=pfWz1zTEiwqJhdbSy3i3_Y4WlIdJ3cuac11wMePeBS0,6130
16
- llumo-0.2.41.dist-info/licenses/LICENSE,sha256=tF9yAcfPV9xGT3ViWmC8hPvOo8BEk4ZICbUfcEo8Dlk,182
17
- llumo-0.2.41.dist-info/METADATA,sha256=pamF6aPT4DF9NO1361IN4dcJ63O2YUCxdeMPPut2bd0,1662
18
- llumo-0.2.41.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
19
- llumo-0.2.41.dist-info/top_level.txt,sha256=d5zUTMI99llPtLRB8rtSrqELm_bOqX-bNC5IcwlDk88,6
20
- llumo-0.2.41.dist-info/RECORD,,
16
+ llumo-0.2.42.dist-info/licenses/LICENSE,sha256=tF9yAcfPV9xGT3ViWmC8hPvOo8BEk4ZICbUfcEo8Dlk,182
17
+ llumo-0.2.42.dist-info/METADATA,sha256=v5zWRFLNSHoMFuXVY3kgdaAcsj3L16AWmTQH6sFEs_k,1662
18
+ llumo-0.2.42.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
19
+ llumo-0.2.42.dist-info/top_level.txt,sha256=d5zUTMI99llPtLRB8rtSrqELm_bOqX-bNC5IcwlDk88,6
20
+ llumo-0.2.42.dist-info/RECORD,,
File without changes