olca 0.2.4__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
@@ -162,37 +152,40 @@ def _parse_args():
162
152
 
163
153
  def main():
164
154
  args = _parse_args()
165
- olca_config_file = 'olca_config.yaml'
166
- olca_new_config_file = 'olca.yml'
155
+ olca_config_file = 'olca.yml'
167
156
 
168
157
  if args.init:
169
- if os.path.exists(olca_new_config_file) or os.path.exists(olca_config_file):
158
+ if os.path.exists(olca_config_file):
170
159
  print("Error: Configuration file already exists. Cannot run 'olca init'.")
171
160
  return
172
161
  if args.yes:
173
- olca_config_file = olca_new_config_file
162
+ pass
174
163
  else:
175
164
  generate_config_example()
176
165
  return
177
166
 
178
- if os.path.exists(olca_new_config_file):
179
- olca_config_file = olca_new_config_file
180
- elif os.path.exists(olca_config_file):
181
- print("Warning: 'olca_config.yaml' is deprecated. Please use 'olca.yml' instead.")
182
- else:
167
+ if not os.path.exists(olca_config_file):
183
168
  generate_config_example()
184
169
  return
185
170
 
186
171
  config = load_config(olca_config_file)
187
172
 
188
173
  # Check for tracing flag in config and CLI
189
- 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"
190
175
  if tracing_enabled:
191
176
  os.environ["LANGCHAIN_TRACING_V2"] = "true"
192
177
  if not os.getenv("LANGCHAIN_API_KEY"):
193
178
  print("Error: LANGCHAIN_API_KEY environment variable is required for tracing. Please set it up at : https://smith.langchain.com/settings")
194
179
  exit(1)
195
-
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
+
196
189
  try:
197
190
 
198
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.4
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=Kl40yXAcrySrK9GMpEkjNgKL-V9iVmZnT03tR3GcJE4,11731
3
- olca-0.2.4.dist-info/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
4
- olca-0.2.4.dist-info/METADATA,sha256=U2b28yNhMN5wRJ36iLQNBPt7XObrccFxGxeXrSRDpzY,21986
5
- olca-0.2.4.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
6
- olca-0.2.4.dist-info/entry_points.txt,sha256=XwHDvSB6qlO1oIEtLCwrVJoVV91S405JL_iXl0G211A,44
7
- olca-0.2.4.dist-info/top_level.txt,sha256=bGDtAReS-xlS0F6MM-DyD0IQUqjNdWmgemnM3vNtrpI,5
8
- olca-0.2.4.dist-info/RECORD,,
File without changes
File without changes