llumo 0.2.3__py3-none-any.whl → 0.2.5__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/functionCalling.py CHANGED
@@ -2,19 +2,19 @@ import os
2
2
  import json
3
3
  import pandas as pd
4
4
  from typing import Callable, List, Dict
5
- from dotenv import load_dotenv
6
5
  import google.generativeai as genai
7
6
  from google.generativeai.types import FunctionDeclaration, Tool
8
7
  from openai import OpenAI
9
8
  from .exceptions import *
10
- # Load environment variables
11
- load_dotenv()
9
+
12
10
  # openai_api = os.getenv("OPENAI_API_KEY")
13
11
  # google_api_key = os.getenv("GOOGLE_API_KEY")
14
12
 
15
13
 
16
14
  class LlumoAgent:
17
- def __init__(self, name: str, description: str, parameters: Dict, function: Callable):
15
+ def __init__(
16
+ self, name: str, description: str, parameters: Dict, function: Callable
17
+ ):
18
18
  self.name = name
19
19
  self.description = description
20
20
  self.parameters = parameters
@@ -30,8 +30,8 @@ class LlumoAgent:
30
30
  parameters={
31
31
  "type": "object",
32
32
  "properties": self.parameters,
33
- "required": list(self.parameters.keys())
34
- }
33
+ "required": list(self.parameters.keys()),
34
+ },
35
35
  )
36
36
 
37
37
  def createOpenaiTool(self):
@@ -44,25 +44,28 @@ class LlumoAgent:
44
44
  "type": "object",
45
45
  "properties": self.parameters,
46
46
  "required": list(self.parameters.keys()),
47
- }
48
- }
47
+ },
48
+ },
49
49
  }
50
50
 
51
51
 
52
52
  class LlumoAgentExecutor:
53
53
 
54
54
  @staticmethod
55
- def run(df: pd.DataFrame, agents: List[LlumoAgent], model: str,model_api_key = None):
55
+ def run(df: pd.DataFrame, agents: List[LlumoAgent], model: str, model_api_key=None):
56
56
  if model.lower() == "google":
57
- return LlumoAgentExecutor.runWithGoogle(df, agents,model_api_key = model_api_key)
57
+ return LlumoAgentExecutor.runWithGoogle(
58
+ df, agents, model_api_key=model_api_key
59
+ )
58
60
  elif model.lower() == "openai":
59
- return LlumoAgentExecutor.runWithOpenAI(df, agents,model_api_key = model_api_key)
61
+ return LlumoAgentExecutor.runWithOpenAI(
62
+ df, agents, model_api_key=model_api_key
63
+ )
60
64
  else:
61
65
  raise ValueError(f"Unsupported model: {model}. Use 'google' or 'openai'.")
62
66
 
63
-
64
67
  @staticmethod
65
- def runWithGoogle(df: pd.DataFrame, agents: List[LlumoAgent],model_api_key = None):
68
+ def runWithGoogle(df: pd.DataFrame, agents: List[LlumoAgent], model_api_key=None):
66
69
  try:
67
70
  genai.configure(api_key=model_api_key)
68
71
  tool_defs = []
@@ -94,7 +97,7 @@ class LlumoAgentExecutor:
94
97
  follow_up_msg = {
95
98
  "function_response": {
96
99
  "name": func_call.name,
97
- "response": result
100
+ "response": result,
98
101
  }
99
102
  }
100
103
 
@@ -119,7 +122,7 @@ class LlumoAgentExecutor:
119
122
  raise RuntimeError(f"Error in runWithGoogle: {e}")
120
123
 
121
124
  @staticmethod
122
- def runWithOpenAI(df: pd.DataFrame, agents: List[LlumoAgent],model_api_key = None):
125
+ def runWithOpenAI(df: pd.DataFrame, agents: List[LlumoAgent], model_api_key=None):
123
126
  try:
124
127
  client = OpenAI(api_key=model_api_key)
125
128
  all_tools = [agent.createOpenaiTool() for agent in agents]
@@ -137,7 +140,7 @@ class LlumoAgentExecutor:
137
140
  model="gpt-4",
138
141
  messages=messages,
139
142
  tools=all_tools,
140
- tool_choice="auto"
143
+ tool_choice="auto",
141
144
  )
142
145
 
143
146
  first_message = initial_response.choices[0].message
@@ -157,15 +160,16 @@ class LlumoAgentExecutor:
157
160
  agent = agent_lookup[tool_name]
158
161
  tool_result = agent.run(**args)
159
162
 
160
- messages.append({
161
- "role": "tool",
162
- "tool_call_id": call.id,
163
- "content": str(tool_result)
164
- })
163
+ messages.append(
164
+ {
165
+ "role": "tool",
166
+ "tool_call_id": call.id,
167
+ "content": str(tool_result),
168
+ }
169
+ )
165
170
 
166
171
  final_response = client.chat.completions.create(
167
- model="gpt-4",
168
- messages=messages
172
+ model="gpt-4", messages=messages
169
173
  )
170
174
  final_output = final_response.choices[0].message.content
171
175
  messages.append({"role": "assistant", "content": final_output})
@@ -187,4 +191,3 @@ class LlumoAgentExecutor:
187
191
 
188
192
  except Exception as e:
189
193
  raise RuntimeError(f"Error in runWithOpenAI: {e}")
190
-
llumo/helpingFuntions.py CHANGED
@@ -7,10 +7,6 @@ import requests
7
7
  import json
8
8
  import base64
9
9
  import os
10
- from dotenv import load_dotenv
11
-
12
-
13
- load_dotenv()
14
10
 
15
11
  subscriptionUrl = "https://app.llumo.ai/api/workspace/record-extra-usage"
16
12
  getStreamdataUrl = "https://app.llumo.ai/api/data-stream/all"
@@ -0,0 +1,52 @@
1
+ Metadata-Version: 2.4
2
+ Name: llumo
3
+ Version: 0.2.5
4
+ Summary: Python SDK for interacting with the Llumo ai API.
5
+ Home-page: https://www.llumo.ai/
6
+ Author: Llumo
7
+ Author-email: product@llumo.ai
8
+ Classifier: Development Status :: 3 - Alpha
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.7
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Requires-Python: >=3.7
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Requires-Dist: requests>=2.0.0
21
+ Requires-Dist: python-socketio
22
+ Requires-Dist: python-dotenv
23
+ Requires-Dist: openai==1.75.0
24
+ Requires-Dist: google-generativeai==0.8.5
25
+ Dynamic: author
26
+ Dynamic: author-email
27
+ Dynamic: classifier
28
+ Dynamic: description
29
+ Dynamic: description-content-type
30
+ Dynamic: home-page
31
+ Dynamic: license-file
32
+ Dynamic: requires-dist
33
+ Dynamic: requires-python
34
+ Dynamic: summary
35
+
36
+ # LLUMO SDK
37
+
38
+ A lightweight Python SDK to interact with the LLUMO API for evaluating LLM responses using analytics like Confidence, Clarity, Context, etc.
39
+
40
+ ## 🔧 Features
41
+
42
+ - API wrapper for LLUMO's analytics endpoints
43
+ - Supports multiple analytics types
44
+
45
+ ## 📦 Installation
46
+
47
+ Clone and install locally:
48
+
49
+ ```bash
50
+ git clone https://github.com/yourusername/llumo-sdk.git
51
+ cd llumo-sdk
52
+ pip install .
@@ -2,12 +2,12 @@ llumo/__init__.py,sha256=O04b4yW1BnOvcHzxWFddAKhtdBEhBNhLdb6xgnpHH_Q,205
2
2
  llumo/client.py,sha256=aCYeUrmEssSqydA_p3nokJ9MkspgitJ0HTmzL7SpkQw,35540
3
3
  llumo/exceptions.py,sha256=iCj7HhtO_ckC2EaVBdXbAudNpuMDsYmmMEV5lwynZ-E,1854
4
4
  llumo/execution.py,sha256=x88wQV8eL99wNN5YtjFaAMCIfN1PdfQVlAZQb4vzgQ0,1413
5
- llumo/functionCalling.py,sha256=QtuTtyoz5rnfNUrNT1kzegNPOrMFjrlgxZfwTqRMdiA,7190
6
- llumo/helpingFuntions.py,sha256=mDGOjeqJI1NOdoaT5FK3tlhWwhpZnk1nCnZOan0AFk0,8886
5
+ llumo/functionCalling.py,sha256=D5jYapu1rIvdIJNUYPYMTyhQ1H-6nkwoOLMi6eekfUE,7241
6
+ llumo/helpingFuntions.py,sha256=G_pqLhYNH3bZ47gA--w6YFNvB443xkrbh8CeQfYxazk,8839
7
7
  llumo/models.py,sha256=YH-qAMnShmUpmKE2LQAzQdpRsaXkFSlOqMxHwU4zBUI,1560
8
8
  llumo/sockets.py,sha256=Qxxqtx3Hg07HLhA4QfcipK1ChiOYhHZBu02iA6MfYlQ,5579
9
- llumo-0.2.3.dist-info/licenses/LICENSE,sha256=tF9yAcfPV9xGT3ViWmC8hPvOo8BEk4ZICbUfcEo8Dlk,182
10
- llumo-0.2.3.dist-info/METADATA,sha256=_Iv2gg-JKGBJvL8nEELMGJNxNUi8fBWqggI8Fas0gOY,426
11
- llumo-0.2.3.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
12
- llumo-0.2.3.dist-info/top_level.txt,sha256=d5zUTMI99llPtLRB8rtSrqELm_bOqX-bNC5IcwlDk88,6
13
- llumo-0.2.3.dist-info/RECORD,,
9
+ llumo-0.2.5.dist-info/licenses/LICENSE,sha256=tF9yAcfPV9xGT3ViWmC8hPvOo8BEk4ZICbUfcEo8Dlk,182
10
+ llumo-0.2.5.dist-info/METADATA,sha256=luOkLN_md2iGVCEBTGs2jZybFrko_XKvmF_Ny04txjg,1490
11
+ llumo-0.2.5.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
12
+ llumo-0.2.5.dist-info/top_level.txt,sha256=d5zUTMI99llPtLRB8rtSrqELm_bOqX-bNC5IcwlDk88,6
13
+ llumo-0.2.5.dist-info/RECORD,,
@@ -1,17 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: llumo
3
- Version: 0.2.3
4
- Summary: Python SDK for interacting with the Llumo ai API.
5
- Home-page: https://www.llumo.ai/
6
- Author: Llumo
7
- Author-email: product@llumo.ai
8
- Requires-Python: >=3.7
9
- Description-Content-Type: text/markdown
10
- License-File: LICENSE
11
- Dynamic: author
12
- Dynamic: author-email
13
- Dynamic: description-content-type
14
- Dynamic: home-page
15
- Dynamic: license-file
16
- Dynamic: requires-python
17
- Dynamic: summary
File without changes