olca 0.2.42__tar.gz → 0.2.44__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {olca-0.2.42 → olca-0.2.44}/PKG-INFO +1 -1
- {olca-0.2.42 → olca-0.2.44}/olca/olcacli.py +8 -10
- {olca-0.2.42 → olca-0.2.44}/olca/utils.py +3 -2
- {olca-0.2.42 → olca-0.2.44}/olca.egg-info/PKG-INFO +1 -1
- {olca-0.2.42 → olca-0.2.44}/pyproject.toml +1 -1
- {olca-0.2.42 → olca-0.2.44}/setup.py +1 -1
- {olca-0.2.42 → olca-0.2.44}/LICENSE +0 -0
- {olca-0.2.42 → olca-0.2.44}/README.md +0 -0
- {olca-0.2.42 → olca-0.2.44}/olca/__init__.py +0 -0
- {olca-0.2.42 → olca-0.2.44}/olca/fusewill_cli.py +0 -0
- {olca-0.2.42 → olca-0.2.44}/olca/fusewill_utils.py +0 -0
- {olca-0.2.42 → olca-0.2.44}/olca/tracing.py +0 -0
- {olca-0.2.42 → olca-0.2.44}/olca.egg-info/SOURCES.txt +0 -0
- {olca-0.2.42 → olca-0.2.44}/olca.egg-info/dependency_links.txt +0 -0
- {olca-0.2.42 → olca-0.2.44}/olca.egg-info/entry_points.txt +0 -0
- {olca-0.2.42 → olca-0.2.44}/olca.egg-info/requires.txt +0 -0
- {olca-0.2.42 → olca-0.2.44}/olca.egg-info/top_level.txt +0 -0
- {olca-0.2.42 → olca-0.2.44}/setup.cfg +0 -0
@@ -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
|
@@ -140,7 +141,7 @@ def print_stream(stream):
|
|
140
141
|
# Skip Langfuse internal state messages and size limit warnings
|
141
142
|
if isinstance(s, dict) and ('keep_alive' in s or 'states' in s):
|
142
143
|
continue
|
143
|
-
if isinstance(s, str) and 'Item exceeds size limit' in s:
|
144
|
+
if isinstance(s, str) and ('Item exceeds size limit' in s or 'pending_switch_proposals' in s):
|
144
145
|
continue
|
145
146
|
|
146
147
|
# Handle different response formats
|
@@ -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:
|
@@ -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
|
)
|
@@ -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.44",
|
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
|
File without changes
|