flock-core 0.4.0b48__py3-none-any.whl → 0.4.0b50__py3-none-any.whl
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.
Potentially problematic release.
This version of flock-core might be problematic. Click here for more details.
- flock/__init__.py +45 -3
- flock/modules/mem0/mem0_module.py +63 -0
- flock/modules/mem0graph/__init__.py +1 -0
- flock/modules/mem0graph/mem0_graph_module.py +63 -0
- flock/webapp/app/api/execution.py +105 -47
- flock/webapp/app/chat.py +315 -24
- flock/webapp/app/config.py +15 -1
- flock/webapp/app/dependencies.py +22 -0
- flock/webapp/app/main.py +414 -14
- flock/webapp/app/services/flock_service.py +38 -13
- flock/webapp/app/services/sharing_models.py +43 -0
- flock/webapp/app/services/sharing_store.py +156 -0
- flock/webapp/static/css/chat.css +57 -0
- flock/webapp/templates/base.html +91 -1
- flock/webapp/templates/chat.html +93 -5
- flock/webapp/templates/partials/_agent_detail_form.html +3 -3
- flock/webapp/templates/partials/_chat_messages.html +1 -1
- flock/webapp/templates/partials/_chat_settings_form.html +22 -0
- flock/webapp/templates/partials/_execution_form.html +28 -1
- flock/webapp/templates/partials/_flock_properties_form.html +2 -2
- flock/webapp/templates/partials/_results_display.html +15 -11
- flock/webapp/templates/partials/_share_chat_link_snippet.html +11 -0
- flock/webapp/templates/partials/_share_link_snippet.html +35 -0
- flock/webapp/templates/partials/_structured_data_view.html +2 -2
- flock/webapp/templates/shared_run_page.html +143 -0
- {flock_core-0.4.0b48.dist-info → flock_core-0.4.0b50.dist-info}/METADATA +4 -2
- {flock_core-0.4.0b48.dist-info → flock_core-0.4.0b50.dist-info}/RECORD +31 -24
- flock/modules/zep/zep_module.py +0 -187
- /flock/modules/{zep → mem0}/__init__.py +0 -0
- {flock_core-0.4.0b48.dist-info → flock_core-0.4.0b50.dist-info}/WHEEL +0 -0
- {flock_core-0.4.0b48.dist-info → flock_core-0.4.0b50.dist-info}/entry_points.txt +0 -0
- {flock_core-0.4.0b48.dist-info → flock_core-0.4.0b50.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{# This snippet is returned by the /ui/htmx/share/generate-link endpoint #}
|
|
2
|
+
{% if share_url %}
|
|
3
|
+
<p style="margin-bottom: 0.5rem;"><strong>Shareable Link generated:</strong></p>
|
|
4
|
+
<input type="text" id="generatedShareLinkInput" value="{{ share_url }}" readonly style="width: 100%; margin-bottom: 0.5rem;">
|
|
5
|
+
{# <button type="button" onclick="copyGeneratedLinkToClipboard()">Copy Link</button> #}
|
|
6
|
+
{# <small id="copyGeneratedStatusMsg" style="margin-left: 0.5rem;"></small> #}
|
|
7
|
+
<p><small>You can select the link above and copy it (Ctrl+C or Cmd+C).</small></p>
|
|
8
|
+
{% elif error_message %}
|
|
9
|
+
<p style="color: var(--pico-form-invalid-color);">Error: {{ error_message }}</p>
|
|
10
|
+
{% else %}
|
|
11
|
+
<p><em>Something went wrong, no link generated.</em></p>
|
|
12
|
+
{% endif %}
|
|
13
|
+
|
|
14
|
+
{#
|
|
15
|
+
<script>
|
|
16
|
+
// Minimal JS for copy if desired - but user asked for JS-free.
|
|
17
|
+
// If you re-add the button, uncomment this.
|
|
18
|
+
function copyGeneratedLinkToClipboard() {
|
|
19
|
+
const input = document.getElementById('generatedShareLinkInput');
|
|
20
|
+
const msg = document.getElementById('copyGeneratedStatusMsg');
|
|
21
|
+
if (!input || !msg) return;
|
|
22
|
+
|
|
23
|
+
input.select();
|
|
24
|
+
input.setSelectionRange(0, 99999); // For mobile devices
|
|
25
|
+
try {
|
|
26
|
+
document.execCommand('copy');
|
|
27
|
+
msg.textContent = 'Copied!';
|
|
28
|
+
setTimeout(() => { msg.textContent = ''; }, 2000);
|
|
29
|
+
} catch (err) {
|
|
30
|
+
console.error('Failed to copy text: ', err);
|
|
31
|
+
msg.textContent = 'Failed to copy.';
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
</script>
|
|
35
|
+
#}
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
{% elif value is none %}
|
|
32
32
|
<em style="color: var(--pico-code-color);">None</em>
|
|
33
33
|
{% else %}
|
|
34
|
-
{# Apply pre-wrap for multi-line strings #}
|
|
35
|
-
<
|
|
34
|
+
{# Apply pre-wrap for multi-line strings and render markdown #}
|
|
35
|
+
<div class="markdown-content" style="word-break: break-word;">{{ value | markdown | safe }}</div>
|
|
36
36
|
{% endif %}
|
|
37
37
|
{% endmacro %}
|
|
38
38
|
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en" data-theme="dark">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Flock Shared Agent: {{ selected_agent_name }}</title>
|
|
7
|
+
|
|
8
|
+
{# Link to Pico.css #}
|
|
9
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css" />
|
|
10
|
+
<link rel="stylesheet" href="/static/css/layout.css">
|
|
11
|
+
<link rel="stylesheet" href="/static/css/header.css">
|
|
12
|
+
<link rel="stylesheet" href="/static/css/sidebar.css">
|
|
13
|
+
<link rel="stylesheet" href="/static/css/components.css">
|
|
14
|
+
<link rel="stylesheet" href="/static/css/chat.css">
|
|
15
|
+
<!-- Font Awesome for icons -->
|
|
16
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
|
|
17
|
+
<!-- Prism.js CSS for syntax highlighting (okaidia theme) -->
|
|
18
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-okaidia.min.css" referrerpolicy="no-referrer" />
|
|
19
|
+
{# Inline generated theme CSS variables #}
|
|
20
|
+
{% if theme_css %}
|
|
21
|
+
<style>
|
|
22
|
+
/* Start Theme CSS */
|
|
23
|
+
/* stylelint-disable */
|
|
24
|
+
{{ theme_css | safe }}
|
|
25
|
+
/* stylelint-enable */
|
|
26
|
+
/* End Theme CSS */
|
|
27
|
+
</style>
|
|
28
|
+
{% endif %}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
{# HTMX script - ensure this is loaded for the page to work #}
|
|
32
|
+
<script src="https://unpkg.com/htmx.org@1.9.10" integrity="sha384-D1Kt99CQMDuVetoL1lrYwg5t+9QdHe7NLX/SoJYkXDFfX37iInKRy5xLSi8nO7UC" crossorigin="anonymous"></script>
|
|
33
|
+
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
|
|
34
|
+
</head>
|
|
35
|
+
<body>
|
|
36
|
+
<main class="main-content">
|
|
37
|
+
<header>
|
|
38
|
+
<hgroup>
|
|
39
|
+
<h2>Run {{ flock.name }} - {{ selected_agent_name }} </h2>
|
|
40
|
+
</hgroup>
|
|
41
|
+
</header>
|
|
42
|
+
|
|
43
|
+
{% if error_message %}
|
|
44
|
+
<article class="error-message" role="alert">
|
|
45
|
+
<strong>Error:</strong> {{ error_message }}
|
|
46
|
+
</article>
|
|
47
|
+
{% endif %}
|
|
48
|
+
|
|
49
|
+
{% if selected_agent_name and not error_message %} {# Only show form if no fatal error and agent is selected #}
|
|
50
|
+
<div style="display: flex; gap: var(--pico-spacing, 1rem);">
|
|
51
|
+
<div style="flex: 1;">
|
|
52
|
+
<article id="execution-form-content">
|
|
53
|
+
<form id="agent-run-form-shared"
|
|
54
|
+
hx-post="/ui/api/flock/htmx/run-shared"
|
|
55
|
+
hx-target="#results-display"
|
|
56
|
+
hx-swap="innerHTML"
|
|
57
|
+
hx-indicator="#run-loading-indicator">
|
|
58
|
+
|
|
59
|
+
{# Hidden input for the fixed agent name #}
|
|
60
|
+
<input type="hidden" name="start_agent_name" value="{{ selected_agent_name }}">
|
|
61
|
+
|
|
62
|
+
{# Add share_id as a hidden input to be sent with the form #}
|
|
63
|
+
<input type="hidden" name="share_id" value="{{ share_id }}">
|
|
64
|
+
|
|
65
|
+
{# flock_definition_str hidden input is no longer needed #}
|
|
66
|
+
{# {% if flock_definition_str %} #}
|
|
67
|
+
{# <input type="hidden" name="flock_definition_str" value="{{ flock_definition_str }}"> #}
|
|
68
|
+
{# {% endif %} #}
|
|
69
|
+
|
|
70
|
+
{# Dynamically generated input fields #}
|
|
71
|
+
{% if input_fields %}
|
|
72
|
+
<h4>Inputs for <code>{{ selected_agent_name }}</code>:</h4>
|
|
73
|
+
{% for field in input_fields %}
|
|
74
|
+
<label for="agent_input_{{ field.name }}">
|
|
75
|
+
{{ field.name }} ({{ field.type }})<br>
|
|
76
|
+
{% if field.description %}<small>{{ field.description }}</small>{% endif %}
|
|
77
|
+
</label>
|
|
78
|
+
{% if field.html_type == "checkbox" %}
|
|
79
|
+
<input type="checkbox" id="agent_input_{{ field.name }}" name="agent_input_{{ field.name }}" role="switch">
|
|
80
|
+
{% elif field.html_type == "textarea" %}
|
|
81
|
+
<textarea id="agent_input_{{ field.name }}" name="agent_input_{{ field.name }}" placeholder="{{ field.placeholder | default('Enter value') }}"></textarea>
|
|
82
|
+
{% else %}
|
|
83
|
+
<input type="{{ field.html_type }}" id="agent_input_{{ field.name }}" name="agent_input_{{ field.name }}" placeholder="Enter {{ field.type }} value">
|
|
84
|
+
{% endif %}
|
|
85
|
+
{% endfor %}
|
|
86
|
+
{% elif flock and selected_agent_name in flock.agents and not flock.agents[selected_agent_name].input %}
|
|
87
|
+
<p>Agent <code>{{ selected_agent_name }}</code> requires no inputs.</p>
|
|
88
|
+
{% elif not error_message %}
|
|
89
|
+
<p>Could not determine inputs for agent <code>{{ selected_agent_name }}</code>. The input signature might be missing or invalid.</p>
|
|
90
|
+
{% endif %}
|
|
91
|
+
|
|
92
|
+
<button type="submit" class="hide-on-request">Run Agent</button>
|
|
93
|
+
<span id="run-loading-indicator" class="htmx-indicator">
|
|
94
|
+
<progress indeterminate></progress> Running...
|
|
95
|
+
</span>
|
|
96
|
+
</form>
|
|
97
|
+
</article>
|
|
98
|
+
</div>
|
|
99
|
+
<section class="right-pane-framed" style="flex: 2; border-left: 1px solid var(--pico-muted-border-color); padding-left: 1.5rem;">
|
|
100
|
+
<header style=" border-bottom: 1px solid var(--pico-muted-border-color); margin-bottom: 1rem;">
|
|
101
|
+
<h5>Execution Results</h5>
|
|
102
|
+
</header>
|
|
103
|
+
<div id="results-display">
|
|
104
|
+
<p><code>Results will appear here after running the Flock.</code></p>
|
|
105
|
+
</div>
|
|
106
|
+
</section>
|
|
107
|
+
</div>
|
|
108
|
+
|
|
109
|
+
{% elif not error_message %}
|
|
110
|
+
<p>This shared link is not configured correctly. No agent specified or an issue occurred loading the configuration.</p>
|
|
111
|
+
{% endif %}
|
|
112
|
+
|
|
113
|
+
<footer class="main-footer">
|
|
114
|
+
<small>Built with FastAPI, HTMX, Pico.CSS by 🤍 white duck 🦆 - Theme: {{ active_theme_name | default('default') }}</small>
|
|
115
|
+
</footer>
|
|
116
|
+
</main>
|
|
117
|
+
|
|
118
|
+
<!-- Prism.js JS (core and autoloader) -->
|
|
119
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-core.min.js" referrerpolicy="no-referrer"></script>
|
|
120
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/autoloader/prism-autoloader.min.js" referrerpolicy="no-referrer"></script>
|
|
121
|
+
<script>
|
|
122
|
+
// Add HTMX event listener for Prism highlighting
|
|
123
|
+
document.addEventListener('htmx:afterSwap', function(event) {
|
|
124
|
+
const resultsDisplay = document.getElementById('results-display');
|
|
125
|
+
// Check if the swapped element is the results display or a child of it
|
|
126
|
+
if (resultsDisplay && (event.detail.target === resultsDisplay || resultsDisplay.contains(event.detail.target))) {
|
|
127
|
+
if (typeof Prism !== 'undefined') {
|
|
128
|
+
// console.log('Prism highlighting triggered for swapped content in results-display.');
|
|
129
|
+
Prism.highlightAllUnder(resultsDisplay);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
// Initial highlight on page load
|
|
135
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
136
|
+
if (typeof Prism !== 'undefined') {
|
|
137
|
+
// console.log('Prism initial highlighting on shared page.');
|
|
138
|
+
Prism.highlightAll();
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
</script>
|
|
142
|
+
</body>
|
|
143
|
+
</html>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flock-core
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.0b50
|
|
4
4
|
Summary: Declarative LLM Orchestration at Scale
|
|
5
5
|
Author-email: Andre Ratzenberger <andre.ratzenberger@whiteduck.de>
|
|
6
6
|
License-File: LICENSE
|
|
@@ -8,6 +8,7 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
8
8
|
Classifier: Operating System :: OS Independent
|
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
|
10
10
|
Requires-Python: >=3.10
|
|
11
|
+
Requires-Dist: aiosqlite>=0.21.0
|
|
11
12
|
Requires-Dist: chromadb>=0.6.3
|
|
12
13
|
Requires-Dist: cloudpickle>=3.1.1
|
|
13
14
|
Requires-Dist: datasets>=3.2.0
|
|
@@ -18,7 +19,9 @@ Requires-Dist: httpx>=0.28.1
|
|
|
18
19
|
Requires-Dist: inspect-ai>=0.3.88
|
|
19
20
|
Requires-Dist: litellm==1.69.3
|
|
20
21
|
Requires-Dist: loguru>=0.7.3
|
|
22
|
+
Requires-Dist: markdown2>=2.5.3
|
|
21
23
|
Requires-Dist: matplotlib>=3.10.0
|
|
24
|
+
Requires-Dist: mem0ai[graph]>=0.1.100
|
|
22
25
|
Requires-Dist: msgpack>=1.1.0
|
|
23
26
|
Requires-Dist: notion-client>=2.3.0
|
|
24
27
|
Requires-Dist: openai==1.75.0
|
|
@@ -47,7 +50,6 @@ Requires-Dist: tiktoken>=0.8.0
|
|
|
47
50
|
Requires-Dist: toml>=0.10.2
|
|
48
51
|
Requires-Dist: tqdm>=4.67.1
|
|
49
52
|
Requires-Dist: uvicorn>=0.34.0
|
|
50
|
-
Requires-Dist: zep-python>=2.0.2
|
|
51
53
|
Provides-Extra: all-tools
|
|
52
54
|
Requires-Dist: azure-identity>=1.23.0; extra == 'all-tools'
|
|
53
55
|
Requires-Dist: azure-search-documents>=11.5.2; extra == 'all-tools'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
flock/__init__.py,sha256=
|
|
1
|
+
flock/__init__.py,sha256=jg2kcXIi1isxTtYdoQGgk0NYSA-BC0J6Xqy41viWpFg,7834
|
|
2
2
|
flock/config.py,sha256=9aUYglHavosdTS212WXW9qc_snZVimvxaXZ3Z5NDGWM,1923
|
|
3
3
|
flock/cli/config.py,sha256=5DvFLObOx3ObisHnc9JfnUBnK83y0CBsUQzXfxPZve0,138
|
|
4
4
|
flock/cli/constants.py,sha256=ZyXtTW91P1hUMkbMwmOwp_JEL5e9-YkcuM3vHM5glP4,978
|
|
@@ -84,6 +84,10 @@ flock/modules/assertion/__init__.py,sha256=Y0cEkx0dujRmy--TDpKoTqFSLzbyFz8BwEOv8
|
|
|
84
84
|
flock/modules/assertion/assertion_module.py,sha256=2p9mIj8yBXRGgfe5pUWYXcLT86Ny13KyWHpRhe0Ehtg,12877
|
|
85
85
|
flock/modules/callback/__init__.py,sha256=Y0cEkx0dujRmy--TDpKoTqFSLzbyFz8BwEOv8kdSUhg,22
|
|
86
86
|
flock/modules/callback/callback_module.py,sha256=FnTYQeL828uQgYlpgGUnwCz0OzW_DKdOnQ3nwQCcu5o,2956
|
|
87
|
+
flock/modules/mem0/__init__.py,sha256=Y0cEkx0dujRmy--TDpKoTqFSLzbyFz8BwEOv8kdSUhg,22
|
|
88
|
+
flock/modules/mem0/mem0_module.py,sha256=KEGWURXcqB4aRUVUcje8Tua2JOcYOHIbC4TkZQ6cvJo,2043
|
|
89
|
+
flock/modules/mem0graph/__init__.py,sha256=Y0cEkx0dujRmy--TDpKoTqFSLzbyFz8BwEOv8kdSUhg,22
|
|
90
|
+
flock/modules/mem0graph/mem0_graph_module.py,sha256=ni1pu5sj2Qk13H-alWFjmwhIwG9_48gje59ZvVpn788,2012
|
|
87
91
|
flock/modules/memory/__init__.py,sha256=Y0cEkx0dujRmy--TDpKoTqFSLzbyFz8BwEOv8kdSUhg,22
|
|
88
92
|
flock/modules/memory/memory_module.py,sha256=zxdA8RIwhwYIytB8bY0VW32j6xDToUuP9RRgk_mpCwo,15046
|
|
89
93
|
flock/modules/memory/memory_parser.py,sha256=FLH7GL8XThvHiCMfX3eQH7Sz-f62fzhAUmO6_gaDI7U,4372
|
|
@@ -92,8 +96,6 @@ flock/modules/output/__init__.py,sha256=Y0cEkx0dujRmy--TDpKoTqFSLzbyFz8BwEOv8kdS
|
|
|
92
96
|
flock/modules/output/output_module.py,sha256=gEn1_khPAJp-hqU6Rxdv1sQz0jTLVSzYJvNbK1uVNCY,7402
|
|
93
97
|
flock/modules/performance/__init__.py,sha256=Y0cEkx0dujRmy--TDpKoTqFSLzbyFz8BwEOv8kdSUhg,22
|
|
94
98
|
flock/modules/performance/metrics_module.py,sha256=j4_xY4HTz_MsaduFCk7mmQAzFtDZ9pTgPxKTEW-d8fE,16993
|
|
95
|
-
flock/modules/zep/__init__.py,sha256=Y0cEkx0dujRmy--TDpKoTqFSLzbyFz8BwEOv8kdSUhg,22
|
|
96
|
-
flock/modules/zep/zep_module.py,sha256=EIs0EMDrmE--rmmkjj7vLhE-pgR_b3uRHp0dc8DiZMc,6135
|
|
97
99
|
flock/platform/docker_tools.py,sha256=fpA7-6rJBjPOUBLdQP4ny2QPgJ_042nmqRn5GtKnoYw,1445
|
|
98
100
|
flock/platform/jaeger_install.py,sha256=MyOMJQx4TQSMYvdUJxfiGSo3YCtsfkbNXcAcQ9bjETA,2898
|
|
99
101
|
flock/routers/__init__.py,sha256=w9uL34Auuo26-q_EGlE8Z9iHsw6S8qutTAH_ZI7pn7M,39
|
|
@@ -456,39 +458,42 @@ flock/tools/zendesk_tools.py,sha256=HQ7qBVSrRfemwolz0IOXl8Z02vJCLE6mTd-cARVdX88,
|
|
|
456
458
|
flock/webapp/__init__.py,sha256=YtRbbyciN3Z2oMB9fdXZuvM3e49R8m2mY5qHLDoapRA,37
|
|
457
459
|
flock/webapp/run.py,sha256=Ekg-mQSl7RUDJAEDTBJMIlLyvhWqWPMjg8hPqmgFREE,8945
|
|
458
460
|
flock/webapp/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
459
|
-
flock/webapp/app/chat.py,sha256=
|
|
460
|
-
flock/webapp/app/config.py,sha256=
|
|
461
|
-
flock/webapp/app/dependencies.py,sha256=
|
|
462
|
-
flock/webapp/app/main.py,sha256=
|
|
461
|
+
flock/webapp/app/chat.py,sha256=NKSsrozVvnvxrLBtJjN4Ps_DMol66nw1eD5E8GmcOLU,26077
|
|
462
|
+
flock/webapp/app/config.py,sha256=lqmneujnNZk-EFJV5cWpvxkqisxH3T3zT_YOI0JYThE,4809
|
|
463
|
+
flock/webapp/app/dependencies.py,sha256=JUcwY1N6SZplU141lMN2wk9dOC9er5HCedrKTJN9wJk,5533
|
|
464
|
+
flock/webapp/app/main.py,sha256=489cZ_N8ZACRSGjY2PQomXM7bKYZL1_6s4BLRl4XSkM,53828
|
|
463
465
|
flock/webapp/app/models_ui.py,sha256=vrEBLbhEp6FziAgBSFOLT1M7ckwadsTdT7qus5_NduE,329
|
|
464
466
|
flock/webapp/app/theme_mapper.py,sha256=QzWwLWpED78oYp3FjZ9zxv1KxCyj43m8MZ0fhfzz37w,34302
|
|
465
467
|
flock/webapp/app/utils.py,sha256=RF8DMKKAj1XPmm4txUdo2OdswI1ATQ7cqUm6G9JFDzA,2942
|
|
466
468
|
flock/webapp/app/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
467
469
|
flock/webapp/app/api/agent_management.py,sha256=5xqO94QjjAYvxImyjKV9EGUQOvo4n3eqs7pGwGPSQJ4,10394
|
|
468
|
-
flock/webapp/app/api/execution.py,sha256=
|
|
470
|
+
flock/webapp/app/api/execution.py,sha256=NNNG_ZqYS80WoLMD7MSCyDhqkkvCVMb_MfIm3dOs_HA,10381
|
|
469
471
|
flock/webapp/app/api/flock_management.py,sha256=1o-6-36kTnUjI3am_BqLpdrcz0aqFXrxE-hQHIFcCsg,4869
|
|
470
472
|
flock/webapp/app/api/registry_viewer.py,sha256=IoInxJiRR0yFlecG_l2_eRc6l35RQQyEDMG9BcBkipY,1020
|
|
471
473
|
flock/webapp/app/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
472
|
-
flock/webapp/app/services/flock_service.py,sha256=
|
|
474
|
+
flock/webapp/app/services/flock_service.py,sha256=G4JQBC6WFO4ajjvZSbedZvlgczsD5fKdbMHVzhG_IaY,14970
|
|
475
|
+
flock/webapp/app/services/sharing_models.py,sha256=hXbi0gy2ARNKBoURRR3ZJSm7Uq5ID1YEgBfzFuhnB3A,2054
|
|
476
|
+
flock/webapp/app/services/sharing_store.py,sha256=jGuPpy4VwXEf1qEn4cQ9p_qkgkBOl3AwhDfyDB3mSRs,7049
|
|
473
477
|
flock/webapp/app/templates/theme_mapper.html,sha256=z8ZY7nmk6PiUGzD_-px7wSXcEnuBM121rMq6u-2oaCo,14249
|
|
474
|
-
flock/webapp/static/css/chat.css,sha256=
|
|
478
|
+
flock/webapp/static/css/chat.css,sha256=jbq1w2BrA9y5R6dPM2ZSXCLDCff82OCPS1F_excYN5E,8167
|
|
475
479
|
flock/webapp/static/css/components.css,sha256=WnicEHy3ptPzggKmyG9_oZp3X30EMJBUW3KEXaiUCUE,6018
|
|
476
480
|
flock/webapp/static/css/header.css,sha256=E9MgItZCk34S65NfMJ001ZsRz4oyFSJex8KvINMtCn0,1043
|
|
477
481
|
flock/webapp/static/css/layout.css,sha256=ocDd7dmezdQzNAQDuQSv1xZ8-pcbNgYLUYJB1SKcfvw,1526
|
|
478
482
|
flock/webapp/static/css/sidebar.css,sha256=gCwLTAiIvmHGksm0rHDpMsOGCDKBMxqx_aEc8ZQcQF8,3066
|
|
479
|
-
flock/webapp/templates/base.html,sha256=
|
|
480
|
-
flock/webapp/templates/chat.html,sha256=
|
|
483
|
+
flock/webapp/templates/base.html,sha256=Eqp-WYI8ZaYr8CiKzfquYLaoWtKJ7vtHHCJBS4b53Tw,9757
|
|
484
|
+
flock/webapp/templates/chat.html,sha256=4g5qgKGmkvFwuTcuf57Q2CSHj2i0MW98PbUZXaaN74I,7303
|
|
481
485
|
flock/webapp/templates/chat_settings.html,sha256=nYz6ihYAUA9zN-Jru565QNl8_eJdoLMWC2LdZJtZ-20,862
|
|
482
486
|
flock/webapp/templates/flock_editor.html,sha256=ysDExf9zMj4SMsSXZUpCtG9EjIv8VJ5xL4IJQOMlb7o,542
|
|
483
487
|
flock/webapp/templates/index.html,sha256=eK7s5Cnh63unqPwq9NGZGEKyvYwkhudfmSn9su3Ctyg,412
|
|
484
488
|
flock/webapp/templates/registry_viewer.html,sha256=suAiWDvBxJ8SsF9MhheuN6MMQUZuIhTlurmbFOcYJfI,3235
|
|
485
|
-
flock/webapp/templates/
|
|
489
|
+
flock/webapp/templates/shared_run_page.html,sha256=VaiCieI1kXP6y1eFprbVh9tG1-5CS-d-z7Kw2cUAeis,7985
|
|
490
|
+
flock/webapp/templates/partials/_agent_detail_form.html,sha256=a-YM1CozCXBRoBEdfAw3tL9X-rjRy4OWeiwxk6Dcjfg,6024
|
|
486
491
|
flock/webapp/templates/partials/_agent_list.html,sha256=comYjOeUxQvlJzS-3D4OruJKlhC3uhCgo-X-nqiOhkA,1037
|
|
487
492
|
flock/webapp/templates/partials/_agent_manager_view.html,sha256=oUJ-t2Mk3o4xjQ_HtHz0glgaHM8eqZpPB4i24ToJiJ8,2565
|
|
488
493
|
flock/webapp/templates/partials/_agent_tools_checklist.html,sha256=T60fb7OrJYHUw0hJLC_otskgvbH9dZXbv5klgWBkSWk,686
|
|
489
494
|
flock/webapp/templates/partials/_chat_container.html,sha256=n4MzCHAYvTw7rpINIW1dw7LgMSC0ifRORTU47We0p4s,804
|
|
490
|
-
flock/webapp/templates/partials/_chat_messages.html,sha256=
|
|
491
|
-
flock/webapp/templates/partials/_chat_settings_form.html,sha256
|
|
495
|
+
flock/webapp/templates/partials/_chat_messages.html,sha256=zJ7Qbi7bcbrjyfncOd3OKImhZ1APWELOQADWJvWGVQc,600
|
|
496
|
+
flock/webapp/templates/partials/_chat_settings_form.html,sha256=JAO1OXw654WusY871MtjfxAeSuraBEH_taf1tQ2zKhA,4479
|
|
492
497
|
flock/webapp/templates/partials/_create_flock_form.html,sha256=nQVbuTWqOQ59q5zyGXkuBixikvCkaZIPVW8CRF6wCm0,2806
|
|
493
498
|
flock/webapp/templates/partials/_dashboard_flock_detail.html,sha256=c7srF0nL8ETmP0ATsIxF8MMHMtHVXJqWVzdrnu2i-1Q,1012
|
|
494
499
|
flock/webapp/templates/partials/_dashboard_flock_file_list.html,sha256=hevhRzK94tHJC6j8_iLc0ORCOb0wEYHCpRWecXB-5io,795
|
|
@@ -496,21 +501,23 @@ flock/webapp/templates/partials/_dashboard_flock_properties_preview.html,sha256=
|
|
|
496
501
|
flock/webapp/templates/partials/_dashboard_upload_flock_form.html,sha256=lQxR75yLgeRdm1vSkpGGgkhhfQ5JQvu14jx1y-QZUAM,956
|
|
497
502
|
flock/webapp/templates/partials/_dynamic_input_form_content.html,sha256=WYr2M7Mb5vKITFhIVXXEHppRx9IjGew91yLo1_I9kkI,1230
|
|
498
503
|
flock/webapp/templates/partials/_env_vars_table.html,sha256=6TFUWvkYwzwodqXZ0yJhH_NU6L4tz7V09mDamSfDI8c,1082
|
|
499
|
-
flock/webapp/templates/partials/_execution_form.html,sha256=
|
|
504
|
+
flock/webapp/templates/partials/_execution_form.html,sha256=296AFx0WSbCzX8t-L1pRl8s0AUzeOb2fmTiRlcwYoIg,3274
|
|
500
505
|
flock/webapp/templates/partials/_execution_view_container.html,sha256=XuphmZKYf2IYSeA9XHqtnwAntBylrFASDXVlLBJUeDk,1031
|
|
501
506
|
flock/webapp/templates/partials/_flock_file_list.html,sha256=FjIxAqB0OxA0mQ8f2jBX1_M_AM5ea7gCA8PEjPpiZVc,1209
|
|
502
|
-
flock/webapp/templates/partials/_flock_properties_form.html,sha256=
|
|
507
|
+
flock/webapp/templates/partials/_flock_properties_form.html,sha256=alOsGYzktVX6aYtfxRHganBfipkzx5Kk4RxF6C0IHhk,2891
|
|
503
508
|
flock/webapp/templates/partials/_flock_upload_form.html,sha256=h2dIPwPeTg5dv_ubrZiwBXReF0NjzJ6eKSwwz7mbQQs,960
|
|
504
509
|
flock/webapp/templates/partials/_header_flock_status.html,sha256=reNB4Prsu9lObz5tFhGk3AMe4bNw92gDJZUKABVaVBM,158
|
|
505
510
|
flock/webapp/templates/partials/_load_manager_view.html,sha256=2u4lufQMEpUlQOThUzo1zrE3AulDQ-aErruS6t91W44,2909
|
|
506
511
|
flock/webapp/templates/partials/_registry_table.html,sha256=z4EW5G3DTknymBeSlpL2PZLcb2143P35upMnmHFfeJs,715
|
|
507
512
|
flock/webapp/templates/partials/_registry_viewer_content.html,sha256=iQyxaLUzz1IcZouRLcMg73k-xcOZvOHVPfpuU7uXgYo,1891
|
|
508
|
-
flock/webapp/templates/partials/_results_display.html,sha256=
|
|
513
|
+
flock/webapp/templates/partials/_results_display.html,sha256=zwWF7uhYfOSsPWDdG9A11ccBBgu-Pz6cupvJ1f4xTB0,2103
|
|
509
514
|
flock/webapp/templates/partials/_settings_env_content.html,sha256=Q1Xr6wLHLlqiduqNk6PyF1B4juP-vvqLOLZyiHHNRLc,572
|
|
510
515
|
flock/webapp/templates/partials/_settings_theme_content.html,sha256=-y5vGRKBZf3Cp5DDE1M4Qw-yunuMtCG54Sa7r60XfJE,807
|
|
511
516
|
flock/webapp/templates/partials/_settings_view.html,sha256=7Uy2EfAgVJ2Kac5S6nkeaIEr2tSagVyR5CBbf07fbSQ,1349
|
|
517
|
+
flock/webapp/templates/partials/_share_chat_link_snippet.html,sha256=N83lNAbkZiDfzZYviKwURPGGErSZhRlxnNzUqXsB7lE,793
|
|
518
|
+
flock/webapp/templates/partials/_share_link_snippet.html,sha256=6en9lOdtu8FwVbtmkJzSQpHQ1WFXHnCbe84FDgAEF3U,1533
|
|
512
519
|
flock/webapp/templates/partials/_sidebar.html,sha256=uA-SZKfVpxImT8Acpw2hhpJbOk1BlaLeSzRjleYfuSE,4450
|
|
513
|
-
flock/webapp/templates/partials/_structured_data_view.html,sha256=
|
|
520
|
+
flock/webapp/templates/partials/_structured_data_view.html,sha256=TEaXcMGba9ruxEc_MLxygIO1qWcuSTo1FnosFtGSKWI,2101
|
|
514
521
|
flock/webapp/templates/partials/_theme_preview.html,sha256=81vP5z8958LjhGWGwjVAVw3zW0uvYwfcXlU30i9exmo,867
|
|
515
522
|
flock/workflow/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
516
523
|
flock/workflow/activities.py,sha256=fyvefDOWZhhj5gCYIHR9Aqm2DbE6XI6-sXESFnnYRuc,9911
|
|
@@ -519,8 +526,8 @@ flock/workflow/agent_execution_activity.py,sha256=Gy6FtuVAjf0NiUXmC3syS2eJpNQF4R
|
|
|
519
526
|
flock/workflow/flock_workflow.py,sha256=iSUF_soFvWar0ffpkzE4irkDZRx0p4HnwmEBi_Ne2sY,9666
|
|
520
527
|
flock/workflow/temporal_config.py,sha256=3_8O7SDEjMsSMXsWJBfnb6XTp0TFaz39uyzSlMTSF_I,3988
|
|
521
528
|
flock/workflow/temporal_setup.py,sha256=YIHnSBntzOchHfMSh8hoLeNXrz3B1UbR14YrR6soM7A,1606
|
|
522
|
-
flock_core-0.4.
|
|
523
|
-
flock_core-0.4.
|
|
524
|
-
flock_core-0.4.
|
|
525
|
-
flock_core-0.4.
|
|
526
|
-
flock_core-0.4.
|
|
529
|
+
flock_core-0.4.0b50.dist-info/METADATA,sha256=iqhiWpNagA97dhguRWqDQOhMmlb3-PGKFYT-v0LY_aU,17879
|
|
530
|
+
flock_core-0.4.0b50.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
531
|
+
flock_core-0.4.0b50.dist-info/entry_points.txt,sha256=rWaS5KSpkTmWySURGFZk6PhbJ87TmvcFQDi2uzjlagQ,37
|
|
532
|
+
flock_core-0.4.0b50.dist-info/licenses/LICENSE,sha256=iYEqWy0wjULzM9GAERaybP4LBiPeu7Z1NEliLUdJKSc,1072
|
|
533
|
+
flock_core-0.4.0b50.dist-info/RECORD,,
|
flock/modules/zep/zep_module.py
DELETED
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import uuid
|
|
2
|
-
from typing import Any
|
|
3
|
-
|
|
4
|
-
from pydantic import Field
|
|
5
|
-
from zep_python.client import Zep
|
|
6
|
-
from zep_python.types import Message as ZepMessage, SessionSearchResult
|
|
7
|
-
|
|
8
|
-
from flock.core.context.context import FlockContext
|
|
9
|
-
from flock.core.flock_agent import FlockAgent
|
|
10
|
-
from flock.core.flock_module import FlockModule, FlockModuleConfig
|
|
11
|
-
from flock.core.flock_registry import flock_component
|
|
12
|
-
from flock.core.logging.logging import get_logger
|
|
13
|
-
|
|
14
|
-
logger = get_logger("module.zep")
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class ZepModuleConfig(FlockModuleConfig):
|
|
18
|
-
"""Configuration for the Zep module."""
|
|
19
|
-
|
|
20
|
-
zep_url: str = "http://localhost:8000"
|
|
21
|
-
zep_api_key: str = "apikey"
|
|
22
|
-
min_fact_rating: float = Field(
|
|
23
|
-
default=0.7, description="Minimum rating for facts to be considered"
|
|
24
|
-
)
|
|
25
|
-
enable_read: bool = True
|
|
26
|
-
enable_write: bool = False
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
@flock_component(config_class=ZepModuleConfig)
|
|
30
|
-
class ZepModule(FlockModule):
|
|
31
|
-
"""Module that adds Zep capabilities to a Flock agent."""
|
|
32
|
-
|
|
33
|
-
name: str = "zep"
|
|
34
|
-
config: ZepModuleConfig = ZepModuleConfig()
|
|
35
|
-
session_id: str | None = None
|
|
36
|
-
user_id: str | None = None
|
|
37
|
-
|
|
38
|
-
def __init__(self, name, config: ZepModuleConfig) -> None:
|
|
39
|
-
"""Initialize Zep module."""
|
|
40
|
-
super().__init__(name=name, config=config)
|
|
41
|
-
logger.debug("Initializing Zep module")
|
|
42
|
-
zep_client = Zep(
|
|
43
|
-
base_url=self.config.zep_url, api_key=self.config.zep_api_key
|
|
44
|
-
)
|
|
45
|
-
self.user_id = self.name
|
|
46
|
-
self._setup_user(zep_client)
|
|
47
|
-
self.session_id = str(uuid.uuid4())
|
|
48
|
-
self._setup_session(zep_client)
|
|
49
|
-
|
|
50
|
-
def _setup_user(self, zep_client: Zep) -> None:
|
|
51
|
-
"""Set up user in Zep."""
|
|
52
|
-
if not zep_client or not self.user_id:
|
|
53
|
-
raise ValueError("Zep service or user_id not initialized")
|
|
54
|
-
|
|
55
|
-
try:
|
|
56
|
-
user = zep_client.user.get(user_id=self.user_id)
|
|
57
|
-
if not user:
|
|
58
|
-
zep_client.user.add(user_id=self.user_id)
|
|
59
|
-
except Exception:
|
|
60
|
-
zep_client.user.add(user_id=self.user_id)
|
|
61
|
-
|
|
62
|
-
def _setup_session(self, zep_client: Zep) -> None:
|
|
63
|
-
"""Set up new session."""
|
|
64
|
-
if not zep_client or not self.user_id or not self.session_id:
|
|
65
|
-
raise ValueError(
|
|
66
|
-
"Zep service, user_id, or session_id not initialized"
|
|
67
|
-
)
|
|
68
|
-
|
|
69
|
-
zep_client.memory.add_session(
|
|
70
|
-
user_id=self.user_id,
|
|
71
|
-
session_id=self.session_id,
|
|
72
|
-
)
|
|
73
|
-
|
|
74
|
-
def get_client(self) -> Zep:
|
|
75
|
-
"""Get Zep client."""
|
|
76
|
-
return Zep(
|
|
77
|
-
base_url=self.config.zep_url, api_key=self.config.zep_api_key
|
|
78
|
-
)
|
|
79
|
-
|
|
80
|
-
def get_memory(self, zep_client: Zep) -> str | None:
|
|
81
|
-
"""Get memory for the current session."""
|
|
82
|
-
if not zep_client or not self.session_id:
|
|
83
|
-
logger.error("Zep service or session_id not initialized")
|
|
84
|
-
return None
|
|
85
|
-
|
|
86
|
-
try:
|
|
87
|
-
memory = zep_client.memory.get(
|
|
88
|
-
self.session_id, min_rating=self.config.min_fact_rating
|
|
89
|
-
)
|
|
90
|
-
if memory:
|
|
91
|
-
return f"{memory.relevant_facts}"
|
|
92
|
-
except Exception as e:
|
|
93
|
-
logger.error(f"Error fetching memory: {e}")
|
|
94
|
-
return None
|
|
95
|
-
|
|
96
|
-
return None
|
|
97
|
-
|
|
98
|
-
def split_text(
|
|
99
|
-
self, text: str | None, max_length: int = 1000
|
|
100
|
-
) -> list[ZepMessage]:
|
|
101
|
-
"""Split text into smaller chunks."""
|
|
102
|
-
result: list[ZepMessage] = []
|
|
103
|
-
if not text:
|
|
104
|
-
return result
|
|
105
|
-
if len(text) <= max_length:
|
|
106
|
-
return [ZepMessage(role="user", content=text, role_type="user")]
|
|
107
|
-
for i in range(0, len(text), max_length):
|
|
108
|
-
result.append(
|
|
109
|
-
ZepMessage(
|
|
110
|
-
role="user",
|
|
111
|
-
content=text[i : i + max_length],
|
|
112
|
-
role_type="user",
|
|
113
|
-
)
|
|
114
|
-
)
|
|
115
|
-
return result
|
|
116
|
-
|
|
117
|
-
def add_to_memory(self, text: str, zep_client: Zep) -> None:
|
|
118
|
-
"""Add text to memory."""
|
|
119
|
-
if not zep_client or not self.session_id:
|
|
120
|
-
logger.error("Zep service or session_id not initialized")
|
|
121
|
-
return
|
|
122
|
-
|
|
123
|
-
messages = self.split_text(text)
|
|
124
|
-
zep_client.memory.add(session_id=self.session_id, messages=messages)
|
|
125
|
-
|
|
126
|
-
def search_memory(
|
|
127
|
-
self, query: str, zep_client: Zep
|
|
128
|
-
) -> list[SessionSearchResult]:
|
|
129
|
-
"""Search memory for a query."""
|
|
130
|
-
if not zep_client or not self.user_id:
|
|
131
|
-
logger.error("Zep service or user_id not initialized")
|
|
132
|
-
return []
|
|
133
|
-
|
|
134
|
-
response = zep_client.memory.search_sessions(
|
|
135
|
-
text=query,
|
|
136
|
-
user_id=self.user_id,
|
|
137
|
-
search_scope="facts",
|
|
138
|
-
min_fact_rating=self.config.min_fact_rating,
|
|
139
|
-
)
|
|
140
|
-
if not response.results:
|
|
141
|
-
return []
|
|
142
|
-
return response.results
|
|
143
|
-
|
|
144
|
-
async def on_post_evaluate(
|
|
145
|
-
self,
|
|
146
|
-
agent: FlockAgent,
|
|
147
|
-
inputs: dict[str, Any],
|
|
148
|
-
context: FlockContext | None = None,
|
|
149
|
-
result: dict[str, Any] | None = None,
|
|
150
|
-
) -> dict[str, Any]:
|
|
151
|
-
"""Format and display the output."""
|
|
152
|
-
if not self.config.enable_write:
|
|
153
|
-
return result
|
|
154
|
-
logger.debug("Saving data to memory")
|
|
155
|
-
zep_client = Zep(
|
|
156
|
-
base_url=self.config.zep_url, api_key=self.config.zep_api_key
|
|
157
|
-
)
|
|
158
|
-
self.add_to_memory(str(result), zep_client)
|
|
159
|
-
return result
|
|
160
|
-
|
|
161
|
-
async def on_pre_evaluate(
|
|
162
|
-
self,
|
|
163
|
-
agent: FlockAgent,
|
|
164
|
-
inputs: dict[str, Any],
|
|
165
|
-
context: FlockContext | None = None,
|
|
166
|
-
) -> dict[str, Any]:
|
|
167
|
-
"""Format and display the output."""
|
|
168
|
-
if not self.config.enable_read:
|
|
169
|
-
return inputs
|
|
170
|
-
|
|
171
|
-
zep_client = Zep(
|
|
172
|
-
base_url=self.config.zep_url, api_key=self.config.zep_api_key
|
|
173
|
-
)
|
|
174
|
-
|
|
175
|
-
logger.debug("Searching memory")
|
|
176
|
-
facts = self.search_memory(str(inputs), zep_client)
|
|
177
|
-
|
|
178
|
-
# Add memory to inputs
|
|
179
|
-
facts_str = ""
|
|
180
|
-
if facts:
|
|
181
|
-
for fact in facts:
|
|
182
|
-
facts_str += fact.fact.fact + "\n"
|
|
183
|
-
logger.debug("Found facts in memory: {}", facts_str)
|
|
184
|
-
agent.input = agent.input + ", memory"
|
|
185
|
-
inputs["memory"] = facts_str
|
|
186
|
-
|
|
187
|
-
return inputs
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|