olca 0.2.30__tar.gz → 0.2.32__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.30
3
+ Version: 0.2.32
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
@@ -177,11 +177,11 @@ def main():
177
177
  if args.yes:
178
178
  pass
179
179
  else:
180
- generate_config_example()
180
+ initialize_config_file()
181
181
  return
182
182
 
183
183
  if not os.path.exists(olca_config_file):
184
- generate_config_example()
184
+ initialize_config_file()
185
185
  return
186
186
 
187
187
  config = load_config(olca_config_file)
@@ -269,6 +269,9 @@ def main():
269
269
  else:
270
270
  tools = load_tools( selected_tools, allow_dangerous_tools=True)
271
271
 
272
+ if human_switch:
273
+ user_input = user_input + " Dont forget to USE THE HUMAN-IN-THE-LOOP TOOL"
274
+ system_instructions= system_instructions + ". Use the human-in-the-loop tool"
272
275
 
273
276
  # Define the graph
274
277
  graph = create_react_agent(model, tools=tools)
@@ -297,7 +300,7 @@ def setup_required_directories(system_instructions, user_input):
297
300
  #We dont want to stop the program if it could not create the extra directories but we want to ensure common olca directories exist
298
301
  ensure_directories_exist()
299
302
 
300
- def generate_config_example():
303
+ def initialize_config_file():
301
304
  try:
302
305
  default_system_instructions = "You are interacting using the human tool addressing carefully what the user is asking."
303
306
  default_user_input = "Interact with me to write a story using the 3 act structure that we will save in ./story/ - Make sure you interact with me and wont quit."
@@ -307,21 +310,28 @@ def generate_config_example():
307
310
  default_temperature = 0
308
311
  use_default_human_input = True
309
312
  use_default_tracing = True
310
-
313
+
311
314
  config = {
312
315
  "api_keyname": input("api_keyname [OPENAI_API_KEY]: ") or "OPENAI_API_KEY",
313
316
  "model_name": input("model_name [gpt-4o-mini]: ") or default_model_name,
314
317
  "recursion_limit": int(input("recursion_limit [12]: ") or default_recursion_limit),
315
318
  "temperature": float(input("temperature [0]: ") or default_temperature),
316
319
  "human": input("human [true]: ").lower() in ["true", "yes", "y", "1", ""] or use_default_human_input,
317
- "tracing": input("tracing [true]: ").lower() in ["true", "yes", "y", "1", ""] or use_default_tracing,
318
- "system_instructions": (
319
- input(f"system_instructions [{default_system_instructions}]: ") or default_system_instructions
320
- ).replace("\n", " ").replace("system_instructions:","system_instructions: |\n\t"),
321
- "user_input": (
322
- input(f"user_input [{default_user_input}]: ") or default_user_input
323
- ).replace("\n", " ").replace("user_input:","user_input: |\n\t")
320
+ "tracing": input("tracing [true]: ").lower() in ["true", "yes", "y", "1", ""] or use_default_tracing
324
321
  }
322
+
323
+ user_system_instructions = input(f"system_instructions [{default_system_instructions}]: ")
324
+ user_system_instructions = user_system_instructions or default_system_instructions
325
+ user_system_instructions = user_system_instructions.replace("\n", " ").replace("\r", " ").replace("\t", " ")
326
+
327
+ user_core_input = input(f"user_input [{default_user_input}]: ")
328
+ user_core_input = user_core_input or default_user_input
329
+ user_core_input = user_core_input.replace("\n", " ").replace("\r", " ").replace("\t", " ")
330
+
331
+
332
+ config["system_instructions"] = user_system_instructions
333
+ config["user_input"] = user_core_input
334
+
325
335
  with open('olca.yml', 'w') as file:
326
336
  yaml.dump(config, file)
327
337
  print("Configuration file 'olca.yml' created successfully.")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: olca
3
- Version: 0.2.30
3
+ Version: 0.2.32
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.30"
10
+ version = "0.2.32"
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.30",
5
+ version = "0.2.32",
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