- Move global config files to globals iso global folder, as the name global conflicts with python language
- Creation of Traicie Vancancy Definition specialist - Allow to invoke non-interaction specialists from withing Evie's mgmt interface (eveai_app) - Improvements to crewai specialized classes - Introduction to json editor for showing specialists arguments and results in a better way - Introduction of more complex pagination (adding extra arguments) by adding a global 'get_pagination_html' - Allow follow-up of ChatSession / Specialist execution - Improvement in logging of Specialists (but needs to be finished)
This commit is contained in:
6
common/utils/cache/config_cache.py
vendored
6
common/utils/cache/config_cache.py
vendored
@@ -135,7 +135,7 @@ class BaseConfigVersionTreeCacheHandler(CacheHandler[Dict[str, Any]]):
|
||||
Checks both global and partner-specific directories
|
||||
"""
|
||||
# First check the global path
|
||||
global_path = Path(self._config_dir) / "global" / type_name
|
||||
global_path = Path(self._config_dir) / "globals" / type_name
|
||||
|
||||
# If global path doesn't exist, check if the type exists directly in the root
|
||||
# (for backward compatibility)
|
||||
@@ -145,7 +145,7 @@ class BaseConfigVersionTreeCacheHandler(CacheHandler[Dict[str, Any]]):
|
||||
if not global_path.exists():
|
||||
# Check if it exists in any partner subdirectories
|
||||
partner_dirs = [d for d in Path(self._config_dir).iterdir()
|
||||
if d.is_dir() and d.name != "global"]
|
||||
if d.is_dir() and d.name != "globals"]
|
||||
|
||||
for partner_dir in partner_dirs:
|
||||
partner_type_path = partner_dir / type_name
|
||||
@@ -178,7 +178,7 @@ class BaseConfigVersionTreeCacheHandler(CacheHandler[Dict[str, Any]]):
|
||||
metadata = yaml_data.get('metadata', {})
|
||||
# Add partner information if available
|
||||
partner = None
|
||||
if "global" not in str(file_path):
|
||||
if "globals" not in str(file_path):
|
||||
# Extract partner name from path
|
||||
# Path format: config_dir/partner_name/type_name/version.yaml
|
||||
partner = file_path.parent.parent.name
|
||||
|
||||
@@ -5,6 +5,7 @@ import markdown
|
||||
from markupsafe import Markup
|
||||
from datetime import datetime
|
||||
from common.utils.nginx_utils import prefixed_url_for as puf
|
||||
from flask import current_app, url_for
|
||||
|
||||
|
||||
def to_local_time(utc_dt, timezone_str):
|
||||
@@ -83,8 +84,27 @@ def clean_markdown(text):
|
||||
return text
|
||||
|
||||
|
||||
def prefixed_url_for(endpoint):
|
||||
return puf(endpoint)
|
||||
def prefixed_url_for(endpoint, **kwargs):
|
||||
return puf(endpoint, **kwargs)
|
||||
|
||||
|
||||
def get_pagination_html(pagination, endpoint, **kwargs):
|
||||
"""
|
||||
Generates HTML for pagination with the ability to include additional parameters
|
||||
"""
|
||||
html = ['<nav aria-label="Page navigation"><ul class="pagination justify-content-center">']
|
||||
|
||||
for page in pagination.iter_pages():
|
||||
if page:
|
||||
is_active = 'active' if page == pagination.page else ''
|
||||
url = url_for(endpoint, page=page, **kwargs)
|
||||
current_app.logger.debug(f"URL for page {page}: {url}")
|
||||
html.append(f'<li class="page-item {is_active}"><a class="page-link" href="{url}">{page}</a></li>')
|
||||
else:
|
||||
html.append('<li class="page-item disabled"><span class="page-link">...</span></li>')
|
||||
|
||||
html.append('</ul></nav>')
|
||||
return Markup(''.join(html))
|
||||
|
||||
|
||||
def register_filters(app):
|
||||
@@ -99,3 +119,5 @@ def register_filters(app):
|
||||
app.jinja_env.filters['clean_markdown'] = clean_markdown
|
||||
|
||||
app.jinja_env.globals['prefixed_url_for'] = prefixed_url_for
|
||||
app.jinja_env.globals['get_pagination_html'] = get_pagination_html
|
||||
|
||||
|
||||
Reference in New Issue
Block a user