olca 0.2.37__tar.gz → 0.2.38__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {olca-0.2.37 → olca-0.2.38}/PKG-INFO +1 -1
- {olca-0.2.37 → olca-0.2.38}/olca/olcacli.py +21 -0
- {olca-0.2.37 → olca-0.2.38}/olca/tracing.py +9 -2
- {olca-0.2.37 → olca-0.2.38}/olca.egg-info/PKG-INFO +1 -1
- {olca-0.2.37 → olca-0.2.38}/pyproject.toml +1 -1
- {olca-0.2.37 → olca-0.2.38}/setup.py +1 -1
- {olca-0.2.37 → olca-0.2.38}/LICENSE +0 -0
- {olca-0.2.37 → olca-0.2.38}/README.md +0 -0
- {olca-0.2.37 → olca-0.2.38}/olca/__init__.py +0 -0
- {olca-0.2.37 → olca-0.2.38}/olca/fusewill_cli.py +0 -0
- {olca-0.2.37 → olca-0.2.38}/olca/fusewill_utils.py +0 -0
- {olca-0.2.37 → olca-0.2.38}/olca.egg-info/SOURCES.txt +0 -0
- {olca-0.2.37 → olca-0.2.38}/olca.egg-info/dependency_links.txt +0 -0
- {olca-0.2.37 → olca-0.2.38}/olca.egg-info/entry_points.txt +0 -0
- {olca-0.2.37 → olca-0.2.38}/olca.egg-info/requires.txt +0 -0
- {olca-0.2.37 → olca-0.2.38}/olca.egg-info/top_level.txt +0 -0
- {olca-0.2.37 → olca-0.2.38}/setup.cfg +0 -0
@@ -5,6 +5,7 @@ import dotenv
|
|
5
5
|
from langchain import hub
|
6
6
|
import argparse
|
7
7
|
import yaml
|
8
|
+
import fusewill_utils as fu
|
8
9
|
|
9
10
|
#jgwill/olca1
|
10
11
|
#olca1_prompt = hub.pull("jgwill/olca1") #Future use
|
@@ -176,10 +177,22 @@ def _parse_args():
|
|
176
177
|
|
177
178
|
from olca.tracing import TracingManager
|
178
179
|
|
180
|
+
def load_environment():
|
181
|
+
# Load .env from current directory
|
182
|
+
dotenv.load_dotenv(dotenv_path=os.path.join(os.getcwd(), ".env"))
|
183
|
+
|
184
|
+
# Try loading from home directory if keys are missing
|
185
|
+
if not all([os.getenv(key) for key in ["LANGFUSE_PUBLIC_KEY", "LANGFUSE_SECRET_KEY", "LANGFUSE_HOST",
|
186
|
+
"LANGCHAIN_API_KEY", "OPENAI_API_KEY"]]):
|
187
|
+
dotenv.load_dotenv(dotenv_path=os.path.expanduser("~/.env"))
|
188
|
+
|
179
189
|
def main():
|
180
190
|
args = _parse_args()
|
181
191
|
olca_config_file = 'olca.yml'
|
182
192
|
|
193
|
+
# Load environment variables first
|
194
|
+
load_environment()
|
195
|
+
|
183
196
|
if args.init:
|
184
197
|
if os.path.exists(olca_config_file):
|
185
198
|
print("Error: Configuration file already exists. Cannot run 'olca init'.")
|
@@ -205,6 +218,14 @@ def main():
|
|
205
218
|
if tracing_enabled and not callbacks:
|
206
219
|
print("Warning: Tracing enabled but no handlers configured")
|
207
220
|
|
221
|
+
if tracing_enabled:
|
222
|
+
# Verify Langfuse configuration
|
223
|
+
if not all([os.getenv(key) for key in ["LANGFUSE_PUBLIC_KEY", "LANGFUSE_SECRET_KEY", "LANGFUSE_HOST"]]):
|
224
|
+
print("Warning: Langfuse environment variables missing")
|
225
|
+
# Verify LangSmith configuration
|
226
|
+
if not os.getenv("LANGCHAIN_API_KEY"):
|
227
|
+
print("Warning: LANGCHAIN_API_KEY not set")
|
228
|
+
|
208
229
|
try:
|
209
230
|
|
210
231
|
api_key_variable = "OPENAI_API_KEY"
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import os
|
2
2
|
from langfuse.callback import CallbackHandler as LangfuseCallbackHandler
|
3
|
+
from langfuse import Langfuse
|
3
4
|
|
4
5
|
class TracingManager:
|
5
6
|
def __init__(self, config):
|
@@ -28,10 +29,16 @@ class TracingManager:
|
|
28
29
|
os.environ["LANGCHAIN_TRACING_V2"] = "true"
|
29
30
|
|
30
31
|
def _setup_langfuse(self):
|
31
|
-
|
32
|
-
|
32
|
+
required_vars = ["LANGFUSE_PUBLIC_KEY", "LANGFUSE_SECRET_KEY", "LANGFUSE_HOST"]
|
33
|
+
if not all(os.getenv(var) for var in required_vars):
|
34
|
+
print("Warning: Missing Langfuse environment variables")
|
33
35
|
return None
|
34
36
|
|
37
|
+
Langfuse(
|
38
|
+
public_key=os.getenv("LANGFUSE_PUBLIC_KEY"),
|
39
|
+
secret_key=os.getenv("LANGFUSE_SECRET_KEY"),
|
40
|
+
host=os.getenv("LANGFUSE_HOST")
|
41
|
+
)
|
35
42
|
return LangfuseCallbackHandler()
|
36
43
|
|
37
44
|
def get_callbacks(self):
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
2
2
|
|
3
3
|
setup(
|
4
4
|
name='olca',
|
5
|
-
version = "0.2.
|
5
|
+
version = "0.2.38",
|
6
6
|
author='Jean GUillaume ISabelle',
|
7
7
|
author_email='jgi@jgwill.com',
|
8
8
|
description='A Python package for experimenting with Langchain agent and interactivity in Terminal modalities.',
|
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
|