diff --git a/common/utils/document_utils.py b/common/utils/document_utils.py
index 7668bfd..a07b910 100644
--- a/common/utils/document_utils.py
+++ b/common/utils/document_utils.py
@@ -21,9 +21,24 @@ from common.services.entitlements import LicenseUsageServices
MB_CONVERTOR = 1_048_576
+def get_file_size(file):
+ try:
+ # Als file een bytes object is of iets anders dat len() ondersteunt
+ file_size = len(file)
+ except TypeError:
+ # Als file een FileStorage object is
+ current_position = file.tell()
+ file.seek(0, os.SEEK_END)
+ file_size = file.tell()
+ file.seek(current_position)
+
+ return file_size
+
+
def create_document_stack(api_input, file, filename, extension, tenant_id):
# Precheck if we can add a document to the stack
- LicenseUsageServices.check_storage_and_embedding_quota(tenant_id, len(file)/MB_CONVERTOR)
+
+ LicenseUsageServices.check_storage_and_embedding_quota(tenant_id, get_file_size(file)/MB_CONVERTOR)
# Create the Document
catalog_id = int(api_input.get('catalog_id'))
@@ -338,7 +353,7 @@ def refresh_document_with_content(doc_id: int, tenant_id: int, file_content: byt
old_doc_vers = DocumentVersion.query.filter_by(doc_id=doc_id).order_by(desc(DocumentVersion.id)).first()
# Precheck if we have enough quota for the new version
- LicenseUsageServices.check_storage_and_embedding_quota(tenant_id, len(file_content) / MB_CONVERTOR)
+ LicenseUsageServices.check_storage_and_embedding_quota(tenant_id, get_file_size(file_content) / MB_CONVERTOR)
# Create new version with same file type as original
extension = old_doc_vers.file_type
diff --git a/config/specialists/traicie/TRAICIE_SELECTION_SPECIALIST/1.0.0.yaml b/config/specialists/traicie/TRAICIE_SELECTION_SPECIALIST/1.0.0.yaml
new file mode 100644
index 0000000..25b0079
--- /dev/null
+++ b/config/specialists/traicie/TRAICIE_SELECTION_SPECIALIST/1.0.0.yaml
@@ -0,0 +1,87 @@
+version: "1.0.0"
+name: "Traicie Selection Specialist"
+framework: "crewai"
+partner: "traicie"
+chat: false
+configuration:
+ name:
+ name: "name"
+ description: "The name the specialist is called upon."
+ type: "str"
+ required: true
+ competencies:
+ name: "competencies"
+ description: "An ordered list of competencies."
+ type: "ordered_list"
+ list_type: "competency_details"
+ required: true
+ tone_of_voice:
+ name: "Tone of Voice"
+ description: "The tone of voice the specialist uses to communicate"
+ type: "enum"
+ allowed_values: ["Professional & Neutral", "Warm & Empathetic", "Energetic & Enthusiastic", "Accessible & Informal", "Expert & Trustworthy", "No-nonsense & Goal-driven"]
+ default: "Professional & Neutral"
+ required: true
+ language_level:
+ name: "Language Level"
+ description: "Language level to be used when communicating, relating to CEFR levels"
+ type: "enum"
+ allowed_values: ["Basic", "Standard", "Professional"]
+ default: "Standard"
+ required: true
+ welcome_message:
+ name: "Welcome Message"
+ description: "Introductory text given by the specialist - but translated according to Tone of Voice, Language Level and Starting Language"
+ type: "text"
+ required: false
+ closing_message:
+ name: "Closing Message"
+ description: "Closing message given by the specialist - but translated according to Tone of Voice, Language Level and Starting Language"
+ type: "text"
+ required: false
+competency_details:
+ title:
+ name: "title"
+ description: "Competency Title"
+ type: "str"
+ required: true
+ description:
+ name: "description"
+ description: "Description (in context of the role) of the competency"
+ type: "text"
+ required: true
+ is_knockout:
+ name: "Is Knockout"
+ description: "Defines if the competency is a knock-out criterium"
+ type: "boolean"
+ required: true
+ default: false
+ assess:
+ name: "Assess"
+ description: "Indication if this competency is to be assessed"
+ type: "boolean"
+ required: true
+ default: true
+arguments:
+ vacancy_text:
+ name: "vacancy_text"
+ type: "text"
+ description: "The Vacancy Text"
+ required: true
+results:
+ competencies:
+ name: "competencies"
+ type: "List[str, str]"
+ description: "List of vacancy competencies and their descriptions"
+ required: false
+agents:
+ - type: "TRAICIE_HR_BP_AGENT"
+ version: "1.0"
+tasks:
+ - type: "TRAICIE_GET_COMPETENCIES_TASK"
+ version: "1.1"
+metadata:
+ author: "Josako"
+ date_added: "2025-05-27"
+ changes: "Updated for unified competencies and ko criteria"
+ description: "Assistant to create a new Vacancy based on Vacancy Text"
\ No newline at end of file
diff --git a/eveai_app/templates/scripts.html b/eveai_app/templates/scripts.html
index 0404023..da03475 100644
--- a/eveai_app/templates/scripts.html
+++ b/eveai_app/templates/scripts.html
@@ -1,4 +1,4 @@
-# dist/main.js contains all used javascript libraries
+{#dist/main.js contains all used javascript libraries#}