olca 0.2.53__py3-none-any.whl → 0.2.55__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
olca/olcacli.py CHANGED
@@ -8,6 +8,9 @@ import yaml
8
8
  from olca.utils import load_environment, initialize_langfuse
9
9
  from olca.tracing import TracingManager
10
10
  from olca.olcahelper import setup_required_directories, initialize_config_file
11
+ import time
12
+ import httpx
13
+ from openai.error import APIConnectionError
11
14
 
12
15
  #jgwill/olca1
13
16
  #olca1_prompt = hub.pull("jgwill/olca1") #Future use
@@ -46,6 +49,7 @@ Example Interaction:
46
49
  ==============================================
47
50
  { PROMPT_FOR_USER_INPUT_SHORT } :
48
51
  </example>
52
+ REMEMBER: Never ask to brainstorm (NEVER USE THAT WORD)
49
53
  """
50
54
  def get_input() -> str:
51
55
  print("----------------------")
@@ -304,7 +308,19 @@ def main():
304
308
  graph_config = {"callbacks": callbacks} if callbacks else {}
305
309
  if recursion_limit:
306
310
  graph_config["recursion_limit"] = recursion_limit
307
- print_stream(graph.stream(inputs, config=graph_config))
311
+
312
+ retry_attempts = 3
313
+ for attempt in range(retry_attempts):
314
+ try:
315
+ print_stream(graph.stream(inputs, config=graph_config))
316
+ break
317
+ except (httpx.ConnectError, APIConnectionError) as e:
318
+ if attempt < retry_attempts - 1:
319
+ print(f"Network error encountered: {e}. Retrying in 5 seconds...")
320
+ time.sleep(5)
321
+ else:
322
+ print("Failed to connect after multiple attempts. Exiting.")
323
+ raise e
308
324
  except GraphRecursionError as e:
309
325
  print("Recursion limit reached. Please increase the 'recursion_limit' in the olca_config.yaml file.")
310
326
  print("For troubleshooting, visit: https://python.langchain.com/docs/troubleshooting/errors/GRAPH_RECURSION_LIMIT")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: olca
3
- Version: 0.2.53
3
+ Version: 0.2.55
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
@@ -1,13 +1,13 @@
1
1
  olca/__init__.py,sha256=3QyLLAys_KiiDIe-cfO_7QyY7di_qCaCS-sVziW2BOw,23
2
2
  olca/fusewill_cli.py,sha256=Gf8CaYs7Uo4NH8QfgRNYalpmSUo047p9rzdkvIABHi8,7872
3
3
  olca/fusewill_utils.py,sha256=IOIElqWCIsNzePlS1FZa5_35vySYLwbMUGW6UhNefIc,6065
4
- olca/olcacli.py,sha256=uyDG10m0094swD4KEUjM6Xvt17KYbOo6m7iNEYw2NYY,13459
4
+ olca/olcacli.py,sha256=3B6r15rMf7IPNWBPV3QLWCRSW6Eero-7A8EY6rcIZbQ,14080
5
5
  olca/olcahelper.py,sha256=WdN6-K-N7-HnB9L_px6TsDKWiTXIusZM2I1d0GNQnFs,3322
6
6
  olca/tracing.py,sha256=GSuXIKmIMQ9V2gLkKcin142Z2QpyS6obsnj8Tf-1zHc,1621
7
7
  olca/utils.py,sha256=zM94HDMDYF95Yd9ubeOK6vuepbQN4kDFh0rTvaVFagI,912
8
- olca-0.2.53.dist-info/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
9
- olca-0.2.53.dist-info/METADATA,sha256=-3uetnzmv-Q1LU7rCEVnbt-nb0pBQagIIc7WdyJaA94,25311
10
- olca-0.2.53.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
11
- olca-0.2.53.dist-info/entry_points.txt,sha256=AhP5FMv6vnOq9C76V_vxRVIO50smnZXG4RIY47oD2_U,103
12
- olca-0.2.53.dist-info/top_level.txt,sha256=bGDtAReS-xlS0F6MM-DyD0IQUqjNdWmgemnM3vNtrpI,5
13
- olca-0.2.53.dist-info/RECORD,,
8
+ olca-0.2.55.dist-info/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
9
+ olca-0.2.55.dist-info/METADATA,sha256=TvQHAredWTZ7EG809FXV0afGD9OnRqkqMouyUGmBwJY,25311
10
+ olca-0.2.55.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
11
+ olca-0.2.55.dist-info/entry_points.txt,sha256=AhP5FMv6vnOq9C76V_vxRVIO50smnZXG4RIY47oD2_U,103
12
+ olca-0.2.55.dist-info/top_level.txt,sha256=bGDtAReS-xlS0F6MM-DyD0IQUqjNdWmgemnM3vNtrpI,5
13
+ olca-0.2.55.dist-info/RECORD,,
File without changes
File without changes