olca 0.2.23__tar.gz → 0.2.25__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {olca-0.2.23 → olca-0.2.25}/PKG-INFO +1 -1
- {olca-0.2.23 → olca-0.2.25}/olca/olcacli.py +32 -10
- {olca-0.2.23 → olca-0.2.25}/olca.egg-info/PKG-INFO +1 -1
- {olca-0.2.23 → olca-0.2.25}/pyproject.toml +1 -1
- {olca-0.2.23 → olca-0.2.25}/setup.py +1 -1
- {olca-0.2.23 → olca-0.2.25}/LICENSE +0 -0
- {olca-0.2.23 → olca-0.2.25}/README.md +0 -0
- {olca-0.2.23 → olca-0.2.25}/olca/__init__.py +0 -0
- {olca-0.2.23 → olca-0.2.25}/olca/fusewill_cli.py +0 -0
- {olca-0.2.23 → olca-0.2.25}/olca/fusewill_utils.py +0 -0
- {olca-0.2.23 → olca-0.2.25}/olca.egg-info/SOURCES.txt +0 -0
- {olca-0.2.23 → olca-0.2.25}/olca.egg-info/dependency_links.txt +0 -0
- {olca-0.2.23 → olca-0.2.25}/olca.egg-info/entry_points.txt +0 -0
- {olca-0.2.23 → olca-0.2.25}/olca.egg-info/requires.txt +0 -0
- {olca-0.2.23 → olca-0.2.25}/olca.egg-info/top_level.txt +0 -0
- {olca-0.2.23 → olca-0.2.25}/setup.cfg +0 -0
@@ -12,11 +12,9 @@ import yaml
|
|
12
12
|
SYSTEM_PROMPT_APPEND="""
|
13
13
|
You do what is above and consider the following when doing the task:
|
14
14
|
---
|
15
|
-
*
|
16
|
-
* create a subfolder .olca in the current directory if dont exist and :
|
17
|
-
* Write or append instructions to ./.olca/instructions.txt on how to perform tasks (in terms of reflection and action steps. example: cli syntax to execute something). You read that file to learn how to do your job if it exists. You update it with what you learned and keep it up to date. You dont erase the content of the file. If what you find in it is not related to your task, you ignore it. Dont output all these details you do internally to the standard output. You read it back from time to time to remember what you did and how to make it and what the user wants.
|
15
|
+
* Write or append instructions to ./.olca/instructions.txt on how to perform tasks (in terms of reflection and action steps. example: cli syntax to execute something). You read that file to learn how to do your job if it exists (example: when you starts, you read this to know more on what you learned to do in previous iterations (as it might not be the first time you ran, this file will intruct you where we are. You can also deduce this from the user message)). You update it with what you learned and keep it up to date. You dont erase the content of the file but if what you find in it is not related to your task or is semantically the same, you clean the whole think so its clear. Dont output all these details you do this internally, no output to the stardard output. You read it back from time to time to remember what you did, learned and how to make it and what the user wants.
|
18
16
|
* Produce a report in ./reports/report-olca-[TIMESTAMP].md
|
19
|
-
*
|
17
|
+
* Report to the user if repeated errors are encountered if human tool is accessible (you interact, stating the errors and asking for instructions from the user (you never quit without the user explicitly stating to end the flow)).
|
20
18
|
* Output the iteration number and plan to the standard output during each loop.
|
21
19
|
* If you are given an issue_id, you commit the work to that issue and push your results (dont output the git push to the standard output).
|
22
20
|
* Do not comment on your final results; just output them but keep logging your action steps you do internally (all reflection and action steps).
|
@@ -27,8 +25,8 @@ You do what is above and consider the following when doing the task:
|
|
27
25
|
* Make sure if you Switched to branch, you switch back to main before the end of your script.
|
28
26
|
* Try to observe that you keep doing the same thing over and over again and stop right away if you see that (dont do that if you are developping a story)
|
29
27
|
* Be quiet with trivial output in the terminal.
|
30
|
-
* Write your plan in ./.olca/plan.md
|
31
|
-
* You watch out for basic syntax errors with your args when executing echo commands. (example: Syntax error: Unterminated quoted string)
|
28
|
+
* Write and update your plan in ./.olca/plan.md
|
29
|
+
* You watch out for basic syntax errors with your args when executing echo commands. (example: Syntax error: Unterminated quoted string, make sure to escape your single and double quotes)
|
32
30
|
----
|
33
31
|
REMEMBER: Dont introduce nor conclude, just output results. No comments. you present in a coherent format without preambles or fluff. Never use the word "determination".
|
34
32
|
"""
|
@@ -116,6 +114,24 @@ def get_weather(city: Literal["nyc", "sf"]):
|
|
116
114
|
else:
|
117
115
|
raise AssertionError("Unknown city")
|
118
116
|
|
117
|
+
def ensure_directories_exist(extra_directories:str=None):
|
118
|
+
directories = ['./reports', './log', './.olca']
|
119
|
+
if extra_directories:
|
120
|
+
directories += extra_directories
|
121
|
+
for directory in directories:
|
122
|
+
if not os.path.exists(directory):
|
123
|
+
os.makedirs(directory)
|
124
|
+
|
125
|
+
def extract_extra_directories_from_olca_config_system_and_user_input(system_instructions, user_input):
|
126
|
+
extra_directories = []
|
127
|
+
#parse thru the 2 inputs and search for patterns such as ./story/ (or any other directory)
|
128
|
+
for input in [system_instructions, user_input]:
|
129
|
+
if input:
|
130
|
+
for word in input.split():
|
131
|
+
if word.startswith("./") and word.endswith("/"):
|
132
|
+
extra_directories.append(word)
|
133
|
+
return extra_directories
|
134
|
+
|
119
135
|
|
120
136
|
def print_stream(stream):
|
121
137
|
for s in stream:
|
@@ -135,7 +151,7 @@ def prepare_input(user_input, system_instructions,append_prompt=True, human=Fals
|
|
135
151
|
("user", user_input )
|
136
152
|
]}
|
137
153
|
|
138
|
-
return inputs
|
154
|
+
return inputs,system_instructions,user_input
|
139
155
|
|
140
156
|
OLCA_DESCRIPTION = "OlCA (Orpheus Langchain CLI Assistant) (very Experimental and dangerous)"
|
141
157
|
OLCA_EPILOG = "For more information: https://github.com/jgwill/orpheuspypractice/wiki/olca"
|
@@ -261,11 +277,17 @@ def main():
|
|
261
277
|
graph.config = {}
|
262
278
|
graph.config["recursion_limit"] = recursion_limit
|
263
279
|
|
264
|
-
inputs = prepare_input(user_input, system_instructions, not disable_system_append, human_switch)
|
280
|
+
inputs,system_instructions,user_input = prepare_input(user_input, system_instructions, not disable_system_append, human_switch)
|
281
|
+
|
282
|
+
try:
|
283
|
+
extra_directories=extract_extra_directories_from_olca_config_system_and_user_input(system_instructions, user_input)
|
284
|
+
ensure_directories_exist(extra_directories)
|
285
|
+
except:
|
286
|
+
#We dont want to stop the program if it could not create the extra directories but we want to ensure common olca directories exist
|
287
|
+
ensure_directories_exist()
|
265
288
|
|
266
289
|
|
267
290
|
try:
|
268
|
-
os.makedirs('.olca', exist_ok=True)
|
269
291
|
print_stream(graph.stream(inputs, stream_mode="values"))
|
270
292
|
except GraphRecursionError as e:
|
271
293
|
#print(f"Error: {e}")
|
@@ -281,7 +303,7 @@ def generate_config_example():
|
|
281
303
|
"temperature": float(input("temperature [0]: ") or 0),
|
282
304
|
"human": input("human [true]: ").lower() in ["true", "yes", "y", "1", ""] or True,
|
283
305
|
"tracing": input("tracing [true]: ").lower() in ["true", "yes", "y", "1", ""] or True,
|
284
|
-
"system_instructions": input("system_instructions [
|
306
|
+
"system_instructions": input("system_instructions [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.]: ") 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.",
|
285
307
|
"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/"
|
286
308
|
}
|
287
309
|
with open('olca.yml', 'w') as file:
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
2
2
|
|
3
3
|
setup(
|
4
4
|
name='olca',
|
5
|
-
version = "0.2.
|
5
|
+
version = "0.2.25",
|
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
|