olca 0.2.5__tar.gz → 0.2.7__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: olca
3
- Version: 0.2.5
3
+ Version: 0.2.7
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
@@ -363,6 +363,7 @@ Requires-Dist: langchain
363
363
  Requires-Dist: langchain-openai
364
364
  Requires-Dist: langchain-experimental
365
365
  Requires-Dist: click
366
+ Requires-Dist: langgraph
366
367
 
367
368
  # oLCa
368
369
 
@@ -389,7 +390,7 @@ pip install olca
389
390
  To see the available commands and options, use the `--help` flag:
390
391
 
391
392
  ```bash
392
- olca --help
393
+ olca2 --help
393
394
  ```
394
395
 
395
396
 
@@ -23,7 +23,7 @@ pip install olca
23
23
  To see the available commands and options, use the `--help` flag:
24
24
 
25
25
  ```bash
26
- olca --help
26
+ olca2 --help
27
27
  ```
28
28
 
29
29
 
@@ -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"
@@ -222,7 +214,8 @@ def main():
222
214
 
223
215
  system_instructions = config.get('system_instructions', '')
224
216
  user_input = config.get('user_input', '')
225
- model_name=config.get('model_name', "gpt-4o-mini")
217
+ default_model_id = "gpt-4o-mini"
218
+ model_name=config.get('model_name', default_model_id)
226
219
  recursion_limit=config.get('recursion_limit', 15)
227
220
  disable_system_append = _parse_args().disable_system_append
228
221
 
@@ -287,8 +280,8 @@ def generate_config_example():
287
280
  "temperature": float(input("temperature [0]: ") or 0),
288
281
  "human": input("human [true]: ").lower() in ["true", "yes", "y", "1", ""] or True,
289
282
  "tracing": input("tracing [true]: ").lower() in ["true", "yes", "y", "1", ""] or True,
290
- "system_instructions": input("system_instructions [Hello, I am a chatbot. How can I help you today?]: ") or "Hello, I am a chatbot. How can I help you today?",
291
- "user_input": input("user_input [What is the weather in NYC?]: ") or "What is the weather in NYC?"
283
+ "system_instructions": input("system_instructions [Hello, I am a chatbot. How can I help you today?]: ") or "You are interacting using the human tool addressing carefully what the user is asking. You carefully go step by step in your interaction with the user. You are clear and concise in your communication wrapping up the conversation in a coherent manner for the interaction. You make sure to always present what you think is the end-result of the work before quitting the loop and exit the workflow.",
284
+ "user_input": input("user_input [Interact with me to write a story using the 3 act structure that we will save in ./story/]: ") or "Interact with me to write a story using the 3 act structure that we will save in ./story/"
292
285
  }
293
286
  with open('olca.yml', 'w') as file:
294
287
  yaml.dump(config, file)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: olca
3
- Version: 0.2.5
3
+ Version: 0.2.7
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
@@ -363,6 +363,7 @@ Requires-Dist: langchain
363
363
  Requires-Dist: langchain-openai
364
364
  Requires-Dist: langchain-experimental
365
365
  Requires-Dist: click
366
+ Requires-Dist: langgraph
366
367
 
367
368
  # oLCa
368
369
 
@@ -389,7 +390,7 @@ pip install olca
389
390
  To see the available commands and options, use the `--help` flag:
390
391
 
391
392
  ```bash
392
- olca --help
393
+ olca2 --help
393
394
  ```
394
395
 
395
396
 
@@ -10,3 +10,4 @@ langchain
10
10
  langchain-openai
11
11
  langchain-experimental
12
12
  click
13
+ langgraph
@@ -7,7 +7,8 @@ build-backend = "setuptools.build_meta"
7
7
 
8
8
  [project]
9
9
  name = "olca"
10
- version = "0.2.5"
10
+ version = "0.2.7"
11
+
11
12
  description = "A Python package for experimental usage of Langchain and Human-in-the-Loop"
12
13
  readme = "README.md"
13
14
  requires-python = ">=3.6"
@@ -28,6 +29,7 @@ dependencies = [
28
29
  "langchain-openai",
29
30
  "langchain-experimental",
30
31
  "click",
32
+ "langgraph",
31
33
  ]
32
34
  classifiers = [
33
35
  "Programming Language :: Python :: 3",
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='olca',
5
- version = "0.2.5",
5
+ version = "0.2.7",
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.',
@@ -30,7 +30,8 @@ setup(
30
30
  'langsmith',
31
31
  'langchain-ollama',
32
32
  'langgraph',
33
- 'llm'
33
+ 'llm',
34
+ 'langgraph'
34
35
  ],
35
36
  classifiers=[
36
37
  'Programming Language :: Python :: 3',
File without changes
File without changes
File without changes
File without changes
File without changes