llumo 0.2.44__tar.gz → 0.2.46__tar.gz

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.
Files changed (27) hide show
  1. {llumo-0.2.44/llumo.egg-info → llumo-0.2.46}/PKG-INFO +1 -1
  2. {llumo-0.2.44 → llumo-0.2.46}/llumo/client.py +4 -0
  3. llumo-0.2.46/llumo/exceptions.py +105 -0
  4. {llumo-0.2.44 → llumo-0.2.46}/llumo/llumoSessionContext.py +2 -1
  5. {llumo-0.2.44 → llumo-0.2.46/llumo.egg-info}/PKG-INFO +1 -1
  6. llumo-0.2.44/llumo/exceptions.py +0 -68
  7. {llumo-0.2.44 → llumo-0.2.46}/LICENSE +0 -0
  8. {llumo-0.2.44 → llumo-0.2.46}/MANIFEST.in +0 -0
  9. {llumo-0.2.44 → llumo-0.2.46}/README.md +0 -0
  10. {llumo-0.2.44 → llumo-0.2.46}/llumo/__init__.py +0 -0
  11. {llumo-0.2.44 → llumo-0.2.46}/llumo/callback.py +0 -0
  12. {llumo-0.2.44 → llumo-0.2.46}/llumo/callbacks-0.py +0 -0
  13. {llumo-0.2.44 → llumo-0.2.46}/llumo/chains.py +0 -0
  14. {llumo-0.2.44 → llumo-0.2.46}/llumo/execution.py +0 -0
  15. {llumo-0.2.44 → llumo-0.2.46}/llumo/functionCalling.py +0 -0
  16. {llumo-0.2.44 → llumo-0.2.46}/llumo/google.py +0 -0
  17. {llumo-0.2.44 → llumo-0.2.46}/llumo/helpingFuntions.py +0 -0
  18. {llumo-0.2.44 → llumo-0.2.46}/llumo/llumoLogger.py +0 -0
  19. {llumo-0.2.44 → llumo-0.2.46}/llumo/models.py +0 -0
  20. {llumo-0.2.44 → llumo-0.2.46}/llumo/openai.py +0 -0
  21. {llumo-0.2.44 → llumo-0.2.46}/llumo/sockets.py +0 -0
  22. {llumo-0.2.44 → llumo-0.2.46}/llumo.egg-info/SOURCES.txt +0 -0
  23. {llumo-0.2.44 → llumo-0.2.46}/llumo.egg-info/dependency_links.txt +0 -0
  24. {llumo-0.2.44 → llumo-0.2.46}/llumo.egg-info/requires.txt +0 -0
  25. {llumo-0.2.44 → llumo-0.2.46}/llumo.egg-info/top_level.txt +0 -0
  26. {llumo-0.2.44 → llumo-0.2.46}/setup.cfg +0 -0
  27. {llumo-0.2.44 → llumo-0.2.46}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: llumo
3
- Version: 0.2.44
3
+ Version: 0.2.46
4
4
  Summary: Python SDK for interacting with the Llumo ai API.
5
5
  Home-page: https://www.llumo.ai/
6
6
  Author: Llumo
@@ -2423,6 +2423,10 @@ class LlumoClient:
2423
2423
  # 2. Poll for Results
2424
2424
  insight_result = dataPollingFuncForInsight(payload)
2425
2425
  # llumoInsight = formattedInsightResponse(llmResponse=insight_result)
2426
+ if "error" in insight_result[0]:
2427
+ insight = insight_result[0]["rawResponse"]["response"]["candidates"][0]["content"]["parts"][0]["text"]
2428
+
2429
+ return {"llumoInsight": [insight]}
2426
2430
 
2427
2431
  return {"llumoInsight": insight_result}
2428
2432
 
@@ -0,0 +1,105 @@
1
+
2
+ class LlumoAIError(Exception):
3
+ """Base class for all Llumo SDK-related errors."""
4
+
5
+ def __init__(self, message):
6
+ self.message = message
7
+ super().__init__(self.message)
8
+
9
+ @staticmethod
10
+ def InvalidApiKey():
11
+ return LlumoAIError("The provided API key is invalid or unauthorized"
12
+ "To fix this:\n"
13
+ "1. Go to https://app.llumo.ai/getting-started\n"
14
+ "2. Look at the top navigation bar (right side)\n"
15
+ "3. Copy the API key shown under “API Key”\n"
16
+ "4. Paste that key into your SDK configuration"
17
+ )
18
+
19
+ @staticmethod
20
+ def InvalidApiResponse():
21
+ return LlumoAIError("Invalid or UnexpectedError response from the API"
22
+ "We received a response from the API, but it wasn’t in the expected format…”")
23
+
24
+ @staticmethod
25
+ def RequestFailed(detail="The request could not be completed."):
26
+ return LlumoAIError(
27
+ f"We were unable to complete the request to the Llumo API. "
28
+ f"{detail} "
29
+ "Please check your network connection or try again later."
30
+ )
31
+
32
+
33
+ @staticmethod
34
+ def InvalidJsonResponse():
35
+ return LlumoAIError("The API response is not in valid JSON format")
36
+
37
+ @staticmethod
38
+ def UnexpectedError(detail="Metric"):
39
+ return LlumoAIError(
40
+ f"We couldn’t find an evaluation named '{detail}'. "
41
+ f"Please check that the name is correct. "
42
+ f"If you’d like to run '{detail}', you can create a custom evaluation "
43
+ f"with the same name at https://app.llumo.ai/evallm."
44
+ )
45
+
46
+ @staticmethod
47
+ def EvalError(detail="Some error occured while processing"):
48
+ return LlumoAIError(f"error: {detail}")
49
+
50
+ @staticmethod
51
+ def InsufficientCredits(details="Your available credits have been exhausted."):
52
+ return LlumoAIError(
53
+ f"{details} "
54
+ "To continue running evaluations, please upgrade your plan or "
55
+ "increase your usage limits in the LLUMO AI dashboard at: "
56
+ "https://app.llumo.ai/settings."
57
+ )
58
+
59
+ # return LlumoAIError("LLumo hits exhausted")
60
+
61
+ @staticmethod
62
+ def InvalidPromptTemplate():
63
+ return LlumoAIError('''Make sure the prompt template fulfills the following criteria:
64
+ 1. All the variables should be inside double curly braces. Example: Give answer for the {{query}}, based on given {{context}}.
65
+ 2. The variables used in the prompt template must be present in the dataframe columns with the same name..
66
+ ''')
67
+
68
+ @staticmethod
69
+ def modelHitsExhausted(details = "Your credits for the selected model exhausted."):
70
+ return LlumoAIError(details)
71
+
72
+ @staticmethod
73
+ def dependencyError(details):
74
+ return LlumoAIError(details)
75
+
76
+ @staticmethod
77
+ def providerError(details):
78
+ return LlumoAIError(details)
79
+
80
+ @staticmethod
81
+ def emptyLogList(details="No logs were provided for analysis."):
82
+ return LlumoAIError(
83
+ f"{details} "
84
+ "Please pass at least one log entry. "
85
+ "You can find the correct log format at "
86
+ "https://app.llumo.ai/getting-started "
87
+ "under the “Run SDK with zero data egress” section."
88
+ )
89
+
90
+ @staticmethod
91
+ def invalidUserAim(details=""):
92
+ return LlumoAIError(
93
+ "Invalid userAim detected. "
94
+ "Each userAim must match one of the supported categories used for analysis. "
95
+ "Valid options include:\n"
96
+ "[incorrectOutput, incorrectInput, hallucination, ragQuality, "
97
+ "contextMismanagement, toolCallIssues, agentReasoning, stuckAgents, "
98
+ "jsonErrors, highLatency, highCost, safetyBlocks, modelRouting, "
99
+ "systemErrors, promptAdherence]."
100
+ )
101
+
102
+
103
+ # @staticmethod
104
+ # def dateNotFound():
105
+ # return LlumoAIError("Trial end date or subscription end date not found for the given user.")
@@ -11,6 +11,7 @@ from .helpingFuntions import removeLLmStep
11
11
  from .helpingFuntions import addSelectedTools
12
12
  import random
13
13
 
14
+
14
15
  _ctxLogger = contextvars.ContextVar("ctxLogger")
15
16
  _ctxSessionID = contextvars.ContextVar("ctxSessionID")
16
17
  _ctxLlumoRun = contextvars.ContextVar("ctxLlumoRun")
@@ -179,7 +180,7 @@ class LlumoSessionContext(LlumoClient):
179
180
 
180
181
  payload = addSelectedTools(payload)
181
182
  # print("********PAYLOAD AFTER addSelectedTools*********: ", payload)
182
-
183
+
183
184
  response = requests.post(url, headers=headers, json=payload, timeout=20)
184
185
 
185
186
  response.raise_for_status()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: llumo
3
- Version: 0.2.44
3
+ Version: 0.2.46
4
4
  Summary: Python SDK for interacting with the Llumo ai API.
5
5
  Home-page: https://www.llumo.ai/
6
6
  Author: Llumo
@@ -1,68 +0,0 @@
1
-
2
- class LlumoAIError(Exception):
3
- """Base class for all Llumo SDK-related errors."""
4
-
5
- def __init__(self, message):
6
- self.message = message
7
- super().__init__(self.message)
8
-
9
- @staticmethod
10
- def InvalidApiKey():
11
- return LlumoAIError("The provided API key is invalid or unauthorized")
12
-
13
- @staticmethod
14
- def InvalidApiResponse():
15
- return LlumoAIError("Invalid or UnexpectedError response from the API")
16
-
17
- @staticmethod
18
- def RequestFailed(detail="The request to the API failed"):
19
- return LlumoAIError(f"Request to the API failed: {detail}")
20
-
21
- @staticmethod
22
- def InvalidJsonResponse():
23
- return LlumoAIError("The API response is not in valid JSON format")
24
-
25
- @staticmethod
26
- def UnexpectedError(detail="Metric"):
27
- return LlumoAIError(f"Can you please check if {detail} is written correctly. If you want to run {detail} please create a custom eval with same name of app.llumo.ai/evallm ")
28
-
29
- @staticmethod
30
- def EvalError(detail="Some error occured while processing"):
31
- return LlumoAIError(f"error: {detail}")
32
-
33
- @staticmethod
34
- def InsufficientCredits(details):
35
- return LlumoAIError(details)
36
-
37
- # return LlumoAIError("LLumo hits exhausted")
38
-
39
- @staticmethod
40
- def InvalidPromptTemplate():
41
- return LlumoAIError('''Make sure the prompt template fulfills the following criteria:
42
- 1. All the variables should be inside double curly braces. Example: Give answer for the {{query}}, based on given {{context}}.
43
- 2. The variables used in the prompt template must be present in the dataframe columns with the same name..
44
- ''')
45
-
46
- @staticmethod
47
- def modelHitsExhausted(details = "Your credits for the selected model exhausted."):
48
- return LlumoAIError(details)
49
-
50
- @staticmethod
51
- def dependencyError(details):
52
- return LlumoAIError(details)
53
-
54
- @staticmethod
55
- def providerError(details):
56
- return LlumoAIError(details)
57
-
58
- @staticmethod
59
- def emptyLogList(details= "List of log object is empty. Ensure your logs have at least 1 log object."):
60
- return LlumoAIError(details)
61
-
62
- @staticmethod
63
- def invalidUserAim(details= ""):
64
- return LlumoAIError(details)
65
-
66
- # @staticmethod
67
- # def dateNotFound():
68
- # return LlumoAIError("Trial end date or subscription end date not found for the given user.")
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes