Spaces:
Running
Running
Update LynxScribe module with recent changes.
Browse files
lynxkite-core/src/lynxkite/core/executors/one_by_one.py
CHANGED
@@ -142,12 +142,12 @@ async def execute(ws: workspace.Workspace, catalog, cache=None):
|
|
142 |
key = make_cache_key((inputs, params))
|
143 |
if key not in cache:
|
144 |
result: ops.Result = op(*inputs, **params)
|
145 |
-
output = await await_if_needed(result.output)
|
146 |
-
cache[key] =
|
147 |
-
|
148 |
else:
|
149 |
result = op(*inputs, **params)
|
150 |
-
|
151 |
except Exception as e:
|
152 |
traceback.print_exc()
|
153 |
node.publish_error(e)
|
|
|
142 |
key = make_cache_key((inputs, params))
|
143 |
if key not in cache:
|
144 |
result: ops.Result = op(*inputs, **params)
|
145 |
+
result.output = await await_if_needed(result.output)
|
146 |
+
cache[key] = result
|
147 |
+
result = cache[key]
|
148 |
else:
|
149 |
result = op(*inputs, **params)
|
150 |
+
output = await await_if_needed(result.output)
|
151 |
except Exception as e:
|
152 |
traceback.print_exc()
|
153 |
node.publish_error(e)
|
lynxkite-lynxscribe/README.md
CHANGED
@@ -5,7 +5,7 @@ LynxKite UI for building LynxScribe chat applications. Also runs the chat applic
|
|
5 |
To run a chat UI for LynxScribe workspaces:
|
6 |
|
7 |
```bash
|
8 |
-
WEBUI_AUTH=false OPENAI_API_BASE_URL=http://localhost:8000/api/service/
|
9 |
```
|
10 |
|
11 |
Or use [Lynx WebUI](https://github.com/biggraph/lynx-webui/) instead of Open WebUI.
|
|
|
5 |
To run a chat UI for LynxScribe workspaces:
|
6 |
|
7 |
```bash
|
8 |
+
WEBUI_AUTH=false OPENAI_API_BASE_URL=http://localhost:8000/api/service/lynxkite_lynxscribe uvx open-webui serve
|
9 |
```
|
10 |
|
11 |
Or use [Lynx WebUI](https://github.com/biggraph/lynx-webui/) instead of Open WebUI.
|
lynxkite-lynxscribe/src/lynxkite_lynxscribe/lynxscribe_ops.py
CHANGED
@@ -2,6 +2,8 @@
|
|
2 |
LynxScribe configuration and testing in LynxKite.
|
3 |
"""
|
4 |
|
|
|
|
|
5 |
from lynxscribe.core.llm.base import get_llm_engine
|
6 |
from lynxscribe.core.vector_store.base import get_vector_store
|
7 |
from lynxscribe.common.config import load_config
|
@@ -221,10 +223,8 @@ def view(input):
|
|
221 |
|
222 |
|
223 |
async def get_chat_api(ws):
|
224 |
-
import pathlib
|
225 |
from lynxkite.core import workspace
|
226 |
|
227 |
-
DATA_PATH = pathlib.Path.cwd() / "data"
|
228 |
path = DATA_PATH / ws
|
229 |
assert path.is_relative_to(DATA_PATH)
|
230 |
assert path.exists(), f"Workspace {path} does not exist"
|
@@ -285,18 +285,19 @@ async def api_service_get(request):
|
|
285 |
return {"error": "Not found"}
|
286 |
|
287 |
|
|
|
|
|
|
|
288 |
def get_lynxscribe_workspaces():
|
289 |
-
import pathlib
|
290 |
from lynxkite.core import workspace
|
291 |
|
292 |
-
DATA_DIR = pathlib.Path.cwd() / "data"
|
293 |
workspaces = []
|
294 |
-
for p in
|
295 |
if p.is_file():
|
296 |
try:
|
297 |
ws = workspace.load(p)
|
298 |
if ws.env == ENV:
|
299 |
-
workspaces.append(p.relative_to(
|
300 |
except Exception:
|
301 |
pass # Ignore files that are not valid workspaces.
|
302 |
workspaces.sort()
|
|
|
2 |
LynxScribe configuration and testing in LynxKite.
|
3 |
"""
|
4 |
|
5 |
+
import os
|
6 |
+
import pathlib
|
7 |
from lynxscribe.core.llm.base import get_llm_engine
|
8 |
from lynxscribe.core.vector_store.base import get_vector_store
|
9 |
from lynxscribe.common.config import load_config
|
|
|
223 |
|
224 |
|
225 |
async def get_chat_api(ws):
|
|
|
226 |
from lynxkite.core import workspace
|
227 |
|
|
|
228 |
path = DATA_PATH / ws
|
229 |
assert path.is_relative_to(DATA_PATH)
|
230 |
assert path.exists(), f"Workspace {path} does not exist"
|
|
|
285 |
return {"error": "Not found"}
|
286 |
|
287 |
|
288 |
+
DATA_PATH = pathlib.Path(os.environ.get("LYNXKITE_DATA", "lynxkite_data"))
|
289 |
+
|
290 |
+
|
291 |
def get_lynxscribe_workspaces():
|
|
|
292 |
from lynxkite.core import workspace
|
293 |
|
|
|
294 |
workspaces = []
|
295 |
+
for p in DATA_PATH.glob("**/*"):
|
296 |
if p.is_file():
|
297 |
try:
|
298 |
ws = workspace.load(p)
|
299 |
if ws.env == ENV:
|
300 |
+
workspaces.append(p.relative_to(DATA_PATH))
|
301 |
except Exception:
|
302 |
pass # Ignore files that are not valid workspaces.
|
303 |
workspaces.sort()
|