olca 0.2.5__py3-none-any.whl → 0.2.6__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 CHANGED
@@ -6,16 +6,6 @@ from langchain import hub
6
6
  import argparse
7
7
  import yaml
8
8
 
9
- import langsmith
10
- # Initialize LangSmith client
11
- LANGSMITH_API_KEY = os.getenv("LANGSMITH_API_KEY")
12
- LANGCHAIN_API_KEY = os.getenv("LANGCHAIN_API_KEY")
13
- if not LANGSMITH_API_KEY and not LANGCHAIN_API_KEY:
14
- print("Error: LANGSMITH_API_KEY or LANGCHAIN_API_KEY environment variable is not set.")
15
- exit(1)
16
- client = langsmith.Client(api_key=LANGSMITH_API_KEY or LANGCHAIN_API_KEY)
17
-
18
-
19
9
  #jgwill/olca1
20
10
  #olca1_prompt = hub.pull("jgwill/olca1") #Future use
21
11
  #https://smith.langchain.com/hub/jgwill/olca1
@@ -113,8 +103,7 @@ from typing import Literal
113
103
 
114
104
  from langchain_core.tools import tool
115
105
 
116
- from langchain.agents import create_react_agent
117
- #from langgraph.prebuilt import create_react_agent
106
+ from langgraph.prebuilt import create_react_agent
118
107
  from langgraph.errors import GraphRecursionError
119
108
 
120
109
  @tool
@@ -163,37 +152,40 @@ def _parse_args():
163
152
 
164
153
  def main():
165
154
  args = _parse_args()
166
- olca_config_file = 'olca_config.yaml'
167
- olca_new_config_file = 'olca.yml'
155
+ olca_config_file = 'olca.yml'
168
156
 
169
157
  if args.init:
170
- if os.path.exists(olca_new_config_file) or os.path.exists(olca_config_file):
158
+ if os.path.exists(olca_config_file):
171
159
  print("Error: Configuration file already exists. Cannot run 'olca init'.")
172
160
  return
173
161
  if args.yes:
174
- olca_config_file = olca_new_config_file
162
+ pass
175
163
  else:
176
164
  generate_config_example()
177
165
  return
178
166
 
179
- if os.path.exists(olca_new_config_file):
180
- olca_config_file = olca_new_config_file
181
- elif os.path.exists(olca_config_file):
182
- print("Warning: 'olca_config.yaml' is deprecated. Please use 'olca.yml' instead.")
183
- else:
167
+ if not os.path.exists(olca_config_file):
184
168
  generate_config_example()
185
169
  return
186
170
 
187
171
  config = load_config(olca_config_file)
188
172
 
189
173
  # Check for tracing flag in config and CLI
190
- tracing_enabled = config.get('tracing', False) or args.tracing
174
+ tracing_enabled = config.get('tracing', False) or args.tracing or os.getenv("LANGCHAIN_TRACING_V2") == "true"
191
175
  if tracing_enabled:
192
176
  os.environ["LANGCHAIN_TRACING_V2"] = "true"
193
177
  if not os.getenv("LANGCHAIN_API_KEY"):
194
178
  print("Error: LANGCHAIN_API_KEY environment variable is required for tracing. Please set it up at : https://smith.langchain.com/settings")
195
179
  exit(1)
196
-
180
+ # Initialize LangSmith client
181
+ import langsmith
182
+ LANGSMITH_API_KEY = os.getenv("LANGSMITH_API_KEY")
183
+ LANGCHAIN_API_KEY = os.getenv("LANGCHAIN_API_KEY")
184
+ if not LANGSMITH_API_KEY and not LANGCHAIN_API_KEY:
185
+ print("Error: LANGSMITH_API_KEY or LANGCHAIN_API_KEY environment variable is not set.")
186
+ exit(1)
187
+ client = langsmith.Client(api_key=LANGSMITH_API_KEY or LANGCHAIN_API_KEY)
188
+
197
189
  try:
198
190
 
199
191
  api_key_variable = "OPENAI_API_KEY"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: olca
3
- Version: 0.2.5
3
+ Version: 0.2.6
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
@@ -389,7 +389,7 @@ pip install olca
389
389
  To see the available commands and options, use the `--help` flag:
390
390
 
391
391
  ```bash
392
- olca --help
392
+ olca2 --help
393
393
  ```
394
394
 
395
395
 
@@ -0,0 +1,8 @@
1
+ olca/__init__.py,sha256=3QyLLAys_KiiDIe-cfO_7QyY7di_qCaCS-sVziW2BOw,23
2
+ olca/olcacli.py,sha256=NRDqKX9y9GU-JG3o2jEITYAo-TCODsO2ga5p2x8JbyU,11522
3
+ olca-0.2.6.dist-info/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
4
+ olca-0.2.6.dist-info/METADATA,sha256=vWkQb6pJ_kQFKc48_8jM675KXF-WzTfH0zR8Q7Dw8JA,21987
5
+ olca-0.2.6.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
6
+ olca-0.2.6.dist-info/entry_points.txt,sha256=XwHDvSB6qlO1oIEtLCwrVJoVV91S405JL_iXl0G211A,44
7
+ olca-0.2.6.dist-info/top_level.txt,sha256=bGDtAReS-xlS0F6MM-DyD0IQUqjNdWmgemnM3vNtrpI,5
8
+ olca-0.2.6.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- olca/__init__.py,sha256=3QyLLAys_KiiDIe-cfO_7QyY7di_qCaCS-sVziW2BOw,23
2
- olca/olcacli.py,sha256=wSfmHE7ZD1WAISFaDyNbbjeaiLUurRIzEGT8YkXLkiM,11780
3
- olca-0.2.5.dist-info/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
4
- olca-0.2.5.dist-info/METADATA,sha256=bsWHA7QdAE04AeFMadL1dQ1rHVyyeJC6T7KNwbcHTdI,21986
5
- olca-0.2.5.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
6
- olca-0.2.5.dist-info/entry_points.txt,sha256=XwHDvSB6qlO1oIEtLCwrVJoVV91S405JL_iXl0G211A,44
7
- olca-0.2.5.dist-info/top_level.txt,sha256=bGDtAReS-xlS0F6MM-DyD0IQUqjNdWmgemnM3vNtrpI,5
8
- olca-0.2.5.dist-info/RECORD,,
File without changes
File without changes