olca 0.2.43__py3-none-any.whl → 0.2.45__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.
- olca/olcacli.py +7 -9
- olca/tracing.py +3 -1
- olca/utils.py +3 -2
- {olca-0.2.43.dist-info → olca-0.2.45.dist-info}/METADATA +1 -1
- olca-0.2.45.dist-info/RECORD +12 -0
- olca-0.2.43.dist-info/RECORD +0 -12
- {olca-0.2.43.dist-info → olca-0.2.45.dist-info}/LICENSE +0 -0
- {olca-0.2.43.dist-info → olca-0.2.45.dist-info}/WHEEL +0 -0
- {olca-0.2.43.dist-info → olca-0.2.45.dist-info}/entry_points.txt +0 -0
- {olca-0.2.43.dist-info → olca-0.2.45.dist-info}/top_level.txt +0 -0
olca/olcacli.py
CHANGED
@@ -6,6 +6,7 @@ from langchain import hub
|
|
6
6
|
import argparse
|
7
7
|
import yaml
|
8
8
|
from olca.utils import load_environment, initialize_langfuse
|
9
|
+
from olca.tracing import TracingManager
|
9
10
|
|
10
11
|
#jgwill/olca1
|
11
12
|
#olca1_prompt = hub.pull("jgwill/olca1") #Future use
|
@@ -179,12 +180,11 @@ def _parse_args():
|
|
179
180
|
parser.add_argument("-H", "--human", action="store_true", help="Human in the loop mode")
|
180
181
|
parser.add_argument("-M", "--math", action="store_true", help="Enable math tool")
|
181
182
|
parser.add_argument("-T", "--tracing", action="store_true", help="Enable tracing")
|
183
|
+
parser.add_argument("--debug", action="store_true", help="Enable debug mode")
|
182
184
|
parser.add_argument("init", nargs='?', help="Initialize olca interactive mode")
|
183
185
|
parser.add_argument("-y", "--yes", action="store_true", help="Accept the new file olca.yml")
|
184
186
|
return parser.parse_args()
|
185
187
|
|
186
|
-
from olca.tracing import TracingManager
|
187
|
-
|
188
188
|
def main():
|
189
189
|
args = _parse_args()
|
190
190
|
olca_config_file = 'olca.yml'
|
@@ -193,7 +193,7 @@ def main():
|
|
193
193
|
load_environment()
|
194
194
|
|
195
195
|
# Initialize Langfuse if needed
|
196
|
-
langfuse = initialize_langfuse()
|
196
|
+
langfuse = initialize_langfuse(debug=True if args.debug else False)
|
197
197
|
|
198
198
|
if args.init:
|
199
199
|
if os.path.exists(olca_config_file):
|
@@ -229,13 +229,11 @@ def main():
|
|
229
229
|
print("Warning: LANGCHAIN_API_KEY not set")
|
230
230
|
|
231
231
|
try:
|
232
|
-
|
233
232
|
api_key_variable = "OPENAI_API_KEY"
|
234
|
-
api_keyname=config.get('api_keyname',"OPENAI_API_KEY_olca")
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
os.environ[api_key_variable] = api_key_lcpractices2409
|
233
|
+
api_keyname = config.get('api_keyname', "OPENAI_API_KEY_olca")
|
234
|
+
api_key = os.getenv(api_keyname)
|
235
|
+
if api_key:
|
236
|
+
os.environ[api_key_variable] = api_key
|
239
237
|
except :
|
240
238
|
#load .env file in current dir or HOME and find OPENAI_API_KEY
|
241
239
|
try:
|
olca/tracing.py
CHANGED
@@ -2,7 +2,9 @@ import os
|
|
2
2
|
from langfuse.callback import CallbackHandler as LangfuseCallbackHandler
|
3
3
|
from langfuse import Langfuse
|
4
4
|
from olca.utils import initialize_langfuse
|
5
|
-
|
5
|
+
import warnings
|
6
|
+
#ignore : WARNING:langfuse:Item exceeds size limit ( OF Langfuse)
|
7
|
+
warnings.filterwarnings("ignore", category=Warning)
|
6
8
|
class TracingManager:
|
7
9
|
def __init__(self, config):
|
8
10
|
self.config = config
|
olca/utils.py
CHANGED
@@ -12,7 +12,7 @@ def load_environment():
|
|
12
12
|
"LANGCHAIN_API_KEY", "OPENAI_API_KEY"]]):
|
13
13
|
dotenv.load_dotenv(dotenv_path=os.path.expanduser("~/.env"))
|
14
14
|
|
15
|
-
def initialize_langfuse():
|
15
|
+
def initialize_langfuse( debug=False):
|
16
16
|
required_vars = ["LANGFUSE_PUBLIC_KEY", "LANGFUSE_SECRET_KEY", "LANGFUSE_HOST"]
|
17
17
|
if not all(os.getenv(var) for var in required_vars):
|
18
18
|
return None
|
@@ -20,5 +20,6 @@ def initialize_langfuse():
|
|
20
20
|
return Langfuse(
|
21
21
|
public_key=os.getenv("LANGFUSE_PUBLIC_KEY"),
|
22
22
|
secret_key=os.getenv("LANGFUSE_SECRET_KEY"),
|
23
|
-
host=os.getenv("LANGFUSE_HOST")
|
23
|
+
host=os.getenv("LANGFUSE_HOST"),
|
24
|
+
debug=debug
|
24
25
|
)
|
@@ -0,0 +1,12 @@
|
|
1
|
+
olca/__init__.py,sha256=3QyLLAys_KiiDIe-cfO_7QyY7di_qCaCS-sVziW2BOw,23
|
2
|
+
olca/fusewill_cli.py,sha256=Gf8CaYs7Uo4NH8QfgRNYalpmSUo047p9rzdkvIABHi8,7872
|
3
|
+
olca/fusewill_utils.py,sha256=IOIElqWCIsNzePlS1FZa5_35vySYLwbMUGW6UhNefIc,6065
|
4
|
+
olca/olcacli.py,sha256=92V9oEJu_EEIxx9FertTYQXss7unZuAAY04DGI6ywTs,15886
|
5
|
+
olca/tracing.py,sha256=p8zi-zWRNifzh1qVkmj2YbMGafFNtIpM-gpydFYQyqg,1402
|
6
|
+
olca/utils.py,sha256=zM94HDMDYF95Yd9ubeOK6vuepbQN4kDFh0rTvaVFagI,912
|
7
|
+
olca-0.2.45.dist-info/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
|
8
|
+
olca-0.2.45.dist-info/METADATA,sha256=5gG8lFLnSCgw8niC3oBclvF8LEbv4gA2rvYSIMiSE3I,25311
|
9
|
+
olca-0.2.45.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
10
|
+
olca-0.2.45.dist-info/entry_points.txt,sha256=AhP5FMv6vnOq9C76V_vxRVIO50smnZXG4RIY47oD2_U,103
|
11
|
+
olca-0.2.45.dist-info/top_level.txt,sha256=bGDtAReS-xlS0F6MM-DyD0IQUqjNdWmgemnM3vNtrpI,5
|
12
|
+
olca-0.2.45.dist-info/RECORD,,
|
olca-0.2.43.dist-info/RECORD
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
olca/__init__.py,sha256=3QyLLAys_KiiDIe-cfO_7QyY7di_qCaCS-sVziW2BOw,23
|
2
|
-
olca/fusewill_cli.py,sha256=Gf8CaYs7Uo4NH8QfgRNYalpmSUo047p9rzdkvIABHi8,7872
|
3
|
-
olca/fusewill_utils.py,sha256=IOIElqWCIsNzePlS1FZa5_35vySYLwbMUGW6UhNefIc,6065
|
4
|
-
olca/olcacli.py,sha256=MrioBfQndwRfFujiIoDwIDCJ-bXUMYpLwhp3E-U9sWI,15829
|
5
|
-
olca/tracing.py,sha256=FnToJVhD7XxP0lBe_Ca7bQJYDHEs9bSaFqZx7rpbSaU,1269
|
6
|
-
olca/utils.py,sha256=l01DkaDw5ENl8tzN8X4Ftgntz321AEAY1gpRX8_5q6Q,879
|
7
|
-
olca-0.2.43.dist-info/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
|
8
|
-
olca-0.2.43.dist-info/METADATA,sha256=4JPiDilDY0B3mVUOKcM7FSIeihksIU-kGwRKhDxVIV0,25311
|
9
|
-
olca-0.2.43.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
10
|
-
olca-0.2.43.dist-info/entry_points.txt,sha256=AhP5FMv6vnOq9C76V_vxRVIO50smnZXG4RIY47oD2_U,103
|
11
|
-
olca-0.2.43.dist-info/top_level.txt,sha256=bGDtAReS-xlS0F6MM-DyD0IQUqjNdWmgemnM3vNtrpI,5
|
12
|
-
olca-0.2.43.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|