olca 0.2.43__tar.gz → 0.2.45__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: olca
3
- Version: 0.2.43
3
+ Version: 0.2.45
4
4
  Summary: A Python package for experimental usage of Langchain and Human-in-the-Loop
5
5
  Home-page: https://github.com/jgwill/olca
6
6
  Author: Jean GUillaume ISabelle
@@ -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
- api_key_lcpractices2409 = os.getenv(api_keyname)
237
- #print(api_key_lcpractices2409)
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:
@@ -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
@@ -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
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: olca
3
- Version: 0.2.43
3
+ Version: 0.2.45
4
4
  Summary: A Python package for experimental usage of Langchain and Human-in-the-Loop
5
5
  Home-page: https://github.com/jgwill/olca
6
6
  Author: Jean GUillaume ISabelle
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
7
7
 
8
8
  [project]
9
9
  name = "olca"
10
- version = "0.2.43"
10
+ version = "0.2.45"
11
11
 
12
12
  description = "A Python package for experimental usage of Langchain and Human-in-the-Loop"
13
13
  readme = "README.md"
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='olca',
5
- version = "0.2.43",
5
+ version = "0.2.45",
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