olca 0.2.53__tar.gz → 0.2.55__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.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
@@ -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
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
7
7
 
8
8
  [project]
9
9
  name = "olca"
10
- version = "0.2.53"
10
+ version = "0.2.55"
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.53",
5
+ version = "0.2.55",
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