llumo 0.2.17b1__py3-none-any.whl → 0.2.18__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
@@ -618,11 +618,11 @@ class LlumoClient:
618
618
  data,
619
619
  evals: list, # list of eval metric names
620
620
  prompt_template="Give answer to the given query: {{query}} using the given context: {{context}}.",
621
- outputColName="output",
622
621
  createExperiment: bool = False,
623
622
  getDataFrame:bool =False,
624
623
  _tocheck=True,
625
624
  ):
625
+ outputColName="output"
626
626
  if isinstance(data, dict):
627
627
  data = [data]
628
628
  elif not isinstance(data, list):
@@ -1545,7 +1545,68 @@ class LlumoClient:
1545
1545
  return False
1546
1546
 
1547
1547
 
1548
+ def createExperimentWithEvals(
1549
+ self,
1550
+ data,
1551
+ evals: list, # list of eval metric names
1552
+ prompt_template="Give answer to the given query: {{query}} using the given context: {{context}}.",
1553
+ outputColName="output",
1554
+ createExperiment: bool = False,
1555
+ getDataFrame:bool =False,
1556
+ _tocheck=True,
1557
+ ):
1558
+ if isinstance(data, dict):
1559
+ data = [data]
1560
+ elif not isinstance(data, list):
1561
+ raise ValueError("Data should be a dict or a list of dicts.")
1562
+ dataframe = pd.DataFrame(data).astype(str)
1563
+ workspaceID = None
1564
+ email = None
1565
+ self.evalData=[]
1566
+ self.evals=evals
1567
+ self.allBatches = []
1568
+ rowIdMapping = {} # (rowID-columnID-columnID -> (index, evalName))
1569
+ self.validateApiKey(evalName=evals[0])
1570
+ if createExperiment:
1571
+ activePlayground = str(createEvalPlayground(email=self.email, workspaceID=self.workspaceID))
1572
+
1573
+ else:
1574
+ activePlayground = f"{int(time.time() * 1000)}{uuid.uuid4()}".replace(
1575
+ "-", ""
1576
+ )
1577
+ for evalName in evals:
1578
+ self.validateApiKey(evalName=evalName)
1579
+ self.evalData =dataframe.to_dict(orient="records")
1580
+ if createExperiment:
1581
+ print("heading to upload")
1582
+ pd.set_option("future.no_silent_downcasting", True)
1583
+ # df = dataframe.fillna("Some error occured").astype(object)
1584
+ with warnings.catch_warnings():
1585
+ warnings.simplefilter(action='ignore', category=FutureWarning)
1586
+ df = dataframe.fillna("Some error occurred").astype(str)
1548
1587
 
1588
+ df = dataframe.fillna("Some error occured").infer_objects(copy=False)
1589
+ if createPlayground(
1590
+ self.email,
1591
+ self.workspaceID,
1592
+ df,
1593
+ promptText=prompt_template,
1594
+ definationMapping=self.definationMapping,
1595
+ outputColName=outputColName,
1596
+ activePlayground= activePlayground
1597
+ ):
1598
+ print(
1599
+ "LLUMO’s intuitive UI is ready—start exploring and experimenting with your logs now. Visit https://llumo.ai/evallm to see the results."
1600
+ )
1601
+
1602
+ else:
1603
+ if getDataFrame:
1604
+ return LlumoDataFrameResults(dataframe,evals=self.evals,evalData=self.evalData,definationMapping=self.definationMapping)
1605
+ else:
1606
+ data=dataframe.to_dict(orient="records")
1607
+ return LlumoDictResults(data,evals=self.evals,evalData=self.evalData,definationMapping=self.definationMapping)
1608
+
1609
+
1549
1610
  class SafeDict(dict):
1550
1611
  def __missing__(self, key):
1551
1612
  return ""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: llumo
3
- Version: 0.2.17b1
3
+ Version: 0.2.18
4
4
  Summary: Python SDK for interacting with the Llumo ai API.
5
5
  Home-page: https://www.llumo.ai/
6
6
  Author: Llumo
@@ -23,6 +23,7 @@ Requires-Dist: python-dotenv
23
23
  Requires-Dist: openai==1.75.0
24
24
  Requires-Dist: tqdm==4.67.1
25
25
  Requires-Dist: google-generativeai==0.8.5
26
+ Requires-Dist: websocket-client==1.8.0
26
27
  Dynamic: author
27
28
  Dynamic: author-email
28
29
  Dynamic: classifier
@@ -1,6 +1,6 @@
1
1
  llumo/__init__.py,sha256=YVBkF1fiXFBd_zzySi9BDWgX8MJuLBJ-oF8538MrnDU,256
2
2
  llumo/chains.py,sha256=6lCgLseh04RUgc6SahhmvQj82quay2Mi1j8gPUlx8Es,2923
3
- llumo/client.py,sha256=EQu9mbUzD0bkf-KAQz4shSFCIKH4QFgZn97jOPFIKPU,60281
3
+ llumo/client.py,sha256=n1JAjI-I6ZkQlHV5WGTVACTNxncJ6e8vEpHO_dHA34k,62982
4
4
  llumo/exceptions.py,sha256=Vp_MnanHbnd1Yjuoi6WLrKiwwZbJL3znCox2URMmGU4,2032
5
5
  llumo/execution.py,sha256=nWbJ7AvWuUPcOb6i-JzKRna_PvF-ewZTiK8skS-5n3w,1380
6
6
  llumo/functionCalling.py,sha256=D5jYapu1rIvdIJNUYPYMTyhQ1H-6nkwoOLMi6eekfUE,7241
@@ -9,8 +9,8 @@ llumo/helpingFuntions.py,sha256=ORBM5xPPMHc3ENnJOg4i3Enxtor4En5oDj1d0Zu1mLk,2528
9
9
  llumo/models.py,sha256=aVEZsOOoQx5LeNtwSyBxqvrINq0izH3QWu_YjsMPE6o,2910
10
10
  llumo/openai.py,sha256=DGhEwQIJIIycGpw3hYQnyxdj6RFVpZ-gay-fZGqtkhU,3013
11
11
  llumo/sockets.py,sha256=I2JO_eNEctRo_ikgvFVp5zDd-m0VDu04IEUhhsa1Tic,5950
12
- llumo-0.2.17b1.dist-info/licenses/LICENSE,sha256=tF9yAcfPV9xGT3ViWmC8hPvOo8BEk4ZICbUfcEo8Dlk,182
13
- llumo-0.2.17b1.dist-info/METADATA,sha256=pn1RBU-MVeVt5nfkTsVQOQX2ktLSCCVnSKvIctkeIq0,1521
14
- llumo-0.2.17b1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
- llumo-0.2.17b1.dist-info/top_level.txt,sha256=d5zUTMI99llPtLRB8rtSrqELm_bOqX-bNC5IcwlDk88,6
16
- llumo-0.2.17b1.dist-info/RECORD,,
12
+ llumo-0.2.18.dist-info/licenses/LICENSE,sha256=tF9yAcfPV9xGT3ViWmC8hPvOo8BEk4ZICbUfcEo8Dlk,182
13
+ llumo-0.2.18.dist-info/METADATA,sha256=lMYqwGyoxDxu6Zbs5ZS9Gskd3wcHa1IF51rUM6GKbaA,1558
14
+ llumo-0.2.18.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
+ llumo-0.2.18.dist-info/top_level.txt,sha256=d5zUTMI99llPtLRB8rtSrqELm_bOqX-bNC5IcwlDk88,6
16
+ llumo-0.2.18.dist-info/RECORD,,