Merge branch 'main' into feat/end-user-oauth

This commit is contained in:
Charles Yao
2025-11-24 21:29:42 -06:00
23 changed files with 1081 additions and 46 deletions

View File

@ -237,8 +237,7 @@ class IterationNode(LLMUsageTrackingMixin, Node):
) )
) )
# Update the total tokens from this iteration # Accumulate usage from this iteration
self.graph_runtime_state.total_tokens += graph_engine.graph_runtime_state.total_tokens
usage_accumulator[0] = self._merge_usage( usage_accumulator[0] = self._merge_usage(
usage_accumulator[0], graph_engine.graph_runtime_state.llm_usage usage_accumulator[0], graph_engine.graph_runtime_state.llm_usage
) )
@ -265,7 +264,6 @@ class IterationNode(LLMUsageTrackingMixin, Node):
datetime, datetime,
list[GraphNodeEventBase], list[GraphNodeEventBase],
object | None, object | None,
int,
dict[str, VariableUnion], dict[str, VariableUnion],
LLMUsage, LLMUsage,
] ]
@ -292,7 +290,6 @@ class IterationNode(LLMUsageTrackingMixin, Node):
iter_start_at, iter_start_at,
events, events,
output_value, output_value,
tokens_used,
conversation_snapshot, conversation_snapshot,
iteration_usage, iteration_usage,
) = result ) = result
@ -304,7 +301,6 @@ class IterationNode(LLMUsageTrackingMixin, Node):
yield from events yield from events
# Update tokens and timing # Update tokens and timing
self.graph_runtime_state.total_tokens += tokens_used
iter_run_map[str(index)] = (datetime.now(UTC).replace(tzinfo=None) - iter_start_at).total_seconds() iter_run_map[str(index)] = (datetime.now(UTC).replace(tzinfo=None) - iter_start_at).total_seconds()
usage_accumulator[0] = self._merge_usage(usage_accumulator[0], iteration_usage) usage_accumulator[0] = self._merge_usage(usage_accumulator[0], iteration_usage)
@ -336,7 +332,7 @@ class IterationNode(LLMUsageTrackingMixin, Node):
item: object, item: object,
flask_app: Flask, flask_app: Flask,
context_vars: contextvars.Context, context_vars: contextvars.Context,
) -> tuple[datetime, list[GraphNodeEventBase], object | None, int, dict[str, VariableUnion], LLMUsage]: ) -> tuple[datetime, list[GraphNodeEventBase], object | None, dict[str, VariableUnion], LLMUsage]:
"""Execute a single iteration in parallel mode and return results.""" """Execute a single iteration in parallel mode and return results."""
with preserve_flask_contexts(flask_app=flask_app, context_vars=context_vars): with preserve_flask_contexts(flask_app=flask_app, context_vars=context_vars):
iter_start_at = datetime.now(UTC).replace(tzinfo=None) iter_start_at = datetime.now(UTC).replace(tzinfo=None)
@ -363,7 +359,6 @@ class IterationNode(LLMUsageTrackingMixin, Node):
iter_start_at, iter_start_at,
events, events,
output_value, output_value,
graph_engine.graph_runtime_state.total_tokens,
conversation_snapshot, conversation_snapshot,
graph_engine.graph_runtime_state.llm_usage, graph_engine.graph_runtime_state.llm_usage,
) )

View File

@ -140,7 +140,6 @@ class LoopNode(LLMUsageTrackingMixin, Node):
if reach_break_condition: if reach_break_condition:
loop_count = 0 loop_count = 0
cost_tokens = 0
for i in range(loop_count): for i in range(loop_count):
graph_engine = self._create_graph_engine(start_at=start_at, root_node_id=root_node_id) graph_engine = self._create_graph_engine(start_at=start_at, root_node_id=root_node_id)
@ -163,9 +162,6 @@ class LoopNode(LLMUsageTrackingMixin, Node):
# For other outputs, just update # For other outputs, just update
self.graph_runtime_state.set_output(key, value) self.graph_runtime_state.set_output(key, value)
# Update the total tokens from this iteration
cost_tokens += graph_engine.graph_runtime_state.total_tokens
# Accumulate usage from the sub-graph execution # Accumulate usage from the sub-graph execution
loop_usage = self._merge_usage(loop_usage, graph_engine.graph_runtime_state.llm_usage) loop_usage = self._merge_usage(loop_usage, graph_engine.graph_runtime_state.llm_usage)
@ -194,7 +190,6 @@ class LoopNode(LLMUsageTrackingMixin, Node):
pre_loop_output=self._node_data.outputs, pre_loop_output=self._node_data.outputs,
) )
self.graph_runtime_state.total_tokens += cost_tokens
self._accumulate_usage(loop_usage) self._accumulate_usage(loop_usage)
# Loop completed successfully # Loop completed successfully
yield LoopSucceededEvent( yield LoopSucceededEvent(

File diff suppressed because it is too large Load Diff

View File

@ -74,8 +74,8 @@ const translation = {
moreThanMaxLengthLine: 'Zeile {{rowIndex}}: {{varName}} Wert darf nicht mehr als {{maxLength}} Zeichen sein', moreThanMaxLengthLine: 'Zeile {{rowIndex}}: {{varName}} Wert darf nicht mehr als {{maxLength}} Zeichen sein',
atLeastOne: 'Bitte geben Sie mindestens eine Zeile in die hochgeladene Datei ein.', atLeastOne: 'Bitte geben Sie mindestens eine Zeile in die hochgeladene Datei ein.',
}, },
executions: '{{num}} HINRICHTUNGEN', execution: 'Ausführen',
execution: 'AUSFÜHRUNG', executions: '{{num}} Ausführungen',
stopRun: 'Ausführung stoppen', stopRun: 'Ausführung stoppen',
}, },
login: { login: {

View File

@ -53,8 +53,8 @@ const translation = {
completionResult: 'Completion result', completionResult: 'Completion result',
queryPlaceholder: 'Write your query content...', queryPlaceholder: 'Write your query content...',
run: 'Execute', run: 'Execute',
execution: 'EXECUTION', execution: 'Run',
executions: '{{num}} EXECUTIONS', executions: '{{num}} runs',
copy: 'Copy', copy: 'Copy',
resultTitle: 'AI Completion', resultTitle: 'AI Completion',
noData: 'AI will give you what you want here.', noData: 'AI will give you what you want here.',

View File

@ -74,8 +74,8 @@ const translation = {
moreThanMaxLengthLine: 'Fila {{rowIndex}}: el valor de {{varName}} no puede tener más de {{maxLength}} caracteres', moreThanMaxLengthLine: 'Fila {{rowIndex}}: el valor de {{varName}} no puede tener más de {{maxLength}} caracteres',
atLeastOne: 'Por favor, ingresa al menos una fila en el archivo cargado.', atLeastOne: 'Por favor, ingresa al menos una fila en el archivo cargado.',
}, },
execution: 'EJECUCIÓN', execution: 'Ejecutar',
executions: '{{num}} EJECUCIONES', executions: '{{num}} ejecuciones',
stopRun: 'Detener ejecución', stopRun: 'Detener ejecución',
}, },
login: { login: {

View File

@ -70,8 +70,8 @@ const translation = {
moreThanMaxLengthLine: 'ردیف {{rowIndex}}: مقدار {{varName}} نمی‌تواند بیشتر از {{maxLength}} کاراکتر باشد', moreThanMaxLengthLine: 'ردیف {{rowIndex}}: مقدار {{varName}} نمی‌تواند بیشتر از {{maxLength}} کاراکتر باشد',
atLeastOne: 'لطفاً حداقل یک ردیف در فایل بارگذاری شده وارد کنید.', atLeastOne: 'لطفاً حداقل یک ردیف در فایل بارگذاری شده وارد کنید.',
}, },
executions: '{{num}} اعدام',
execution: 'اجرا', execution: 'اجرا',
executions: '{{num}} بار اجرا',
stopRun: 'توقف اجرا', stopRun: 'توقف اجرا',
}, },
login: { login: {

View File

@ -74,8 +74,8 @@ const translation = {
moreThanMaxLengthLine: 'Row {{rowIndex}}: {{varName}} value can not be more than {{maxLength}} characters', moreThanMaxLengthLine: 'Row {{rowIndex}}: {{varName}} value can not be more than {{maxLength}} characters',
atLeastOne: 'Veuillez entrer au moins une ligne dans le fichier téléchargé.', atLeastOne: 'Veuillez entrer au moins une ligne dans le fichier téléchargé.',
}, },
executions: '{{num}} EXÉCUTIONS', execution: 'Exécuter',
execution: 'EXÉCUTION', executions: '{{num}} exécutions',
stopRun: 'Arrêter l\'exécution', stopRun: 'Arrêter l\'exécution',
}, },
login: { login: {

View File

@ -74,8 +74,8 @@ const translation = {
'रॉ {{rowIndex}}: {{varName}} मान {{maxLength}} वर्णों से अधिक नहीं हो सकता', 'रॉ {{rowIndex}}: {{varName}} मान {{maxLength}} वर्णों से अधिक नहीं हो सकता',
atLeastOne: 'कृपया अपलोड की गई फ़ाइल में कम से कम एक पंक्ति भरें।', atLeastOne: 'कृपया अपलोड की गई फ़ाइल में कम से कम एक पंक्ति भरें।',
}, },
execution: 'अनु执行', execution: 'चलाएं',
executions: '{{num}} फाँसी', executions: '{{num}} बार चलाएं',
stopRun: 'निष्पादन रोकें', stopRun: 'निष्पादन रोकें',
}, },
login: { login: {

View File

@ -55,7 +55,8 @@ const translation = {
}, },
field: 'Kebun', field: 'Kebun',
queryTitle: 'Kueri konten', queryTitle: 'Kueri konten',
execution: 'EKSEKUSI', execution: 'Jalankan',
executions: '{{num}} kali dijalankan',
copy: 'Menyalin', copy: 'Menyalin',
title: 'Penyelesaian AI', title: 'Penyelesaian AI',
downloadTemplate: 'Unduh templat di sini', downloadTemplate: 'Unduh templat di sini',

View File

@ -76,8 +76,8 @@ const translation = {
'Riga {{rowIndex}}: il valore di {{varName}} non può essere superiore a {{maxLength}} caratteri', 'Riga {{rowIndex}}: il valore di {{varName}} non può essere superiore a {{maxLength}} caratteri',
atLeastOne: 'Per favore inserisci almeno una riga nel file caricato.', atLeastOne: 'Per favore inserisci almeno una riga nel file caricato.',
}, },
execution: 'ESECUZIONE', execution: 'Esegui',
executions: '{{num}} ESECUZIONI', executions: '{{num}} esecuzioni',
stopRun: 'Ferma l\'esecuzione', stopRun: 'Ferma l\'esecuzione',
}, },
login: { login: {

View File

@ -49,7 +49,7 @@ const translation = {
completionResult: '生成結果', completionResult: '生成結果',
queryPlaceholder: '入力してください', queryPlaceholder: '入力してください',
run: '実行', run: '実行',
execution: '処理中', execution: '実行',
executions: '{{num}}回実行', executions: '{{num}}回実行',
copy: 'コピー', copy: 'コピー',
resultTitle: 'AI 生成結果', resultTitle: 'AI 生成結果',

View File

@ -71,7 +71,7 @@ const translation = {
atLeastOne: '업로드된 파일에는 적어도 한 줄의 입력이 필요합니다.', atLeastOne: '업로드된 파일에는 적어도 한 줄의 입력이 필요합니다.',
}, },
execution: '실행', execution: '실행',
executions: '{{num}} 처형', executions: '{{num}}회 실행',
stopRun: '실행 중지', stopRun: '실행 중지',
}, },
login: { login: {

View File

@ -75,8 +75,8 @@ const translation = {
atLeastOne: atLeastOne:
'Proszę wprowadź co najmniej jeden wiersz w załadowanym pliku.', 'Proszę wprowadź co najmniej jeden wiersz w załadowanym pliku.',
}, },
executions: '{{num}} EGZEKUCJI', execution: 'Uruchom',
execution: 'WYKONANIE', executions: '{{num}} uruchomień',
stopRun: 'Zatrzymaj wykonanie', stopRun: 'Zatrzymaj wykonanie',
}, },
login: { login: {

View File

@ -74,8 +74,8 @@ const translation = {
moreThanMaxLengthLine: 'Linha {{rowIndex}}: o valor de {{varName}} não pode ter mais de {{maxLength}} caracteres', moreThanMaxLengthLine: 'Linha {{rowIndex}}: o valor de {{varName}} não pode ter mais de {{maxLength}} caracteres',
atLeastOne: 'Por favor, insira pelo menos uma linha no arquivo enviado.', atLeastOne: 'Por favor, insira pelo menos uma linha no arquivo enviado.',
}, },
executions: '{{num}} EXECUÇÕES', execution: 'Executar',
execution: 'EXECUÇÃO', executions: '{{num}} execuções',
stopRun: 'Parar execução', stopRun: 'Parar execução',
}, },
login: { login: {

View File

@ -74,8 +74,8 @@ const translation = {
moreThanMaxLengthLine: 'Rândul {{rowIndex}}: valoarea {{varName}} nu poate avea mai mult de {{maxLength}} caractere', moreThanMaxLengthLine: 'Rândul {{rowIndex}}: valoarea {{varName}} nu poate avea mai mult de {{maxLength}} caractere',
atLeastOne: 'Vă rugăm să introduceți cel puțin un rând în fișierul încărcat.', atLeastOne: 'Vă rugăm să introduceți cel puțin un rând în fișierul încărcat.',
}, },
execution: 'EXECUȚIE', execution: 'Rulare',
executions: '{{num}} EXECUȚII', executions: '{{num}} rulări',
stopRun: 'Oprește execuția', stopRun: 'Oprește execuția',
}, },
login: { login: {

View File

@ -74,8 +74,8 @@ const translation = {
moreThanMaxLengthLine: 'Строка {{rowIndex}}: значение {{varName}} не может превышать {{maxLength}} символов', moreThanMaxLengthLine: 'Строка {{rowIndex}}: значение {{varName}} не может превышать {{maxLength}} символов',
atLeastOne: 'Пожалуйста, введите хотя бы одну строку в загруженный файл.', atLeastOne: 'Пожалуйста, введите хотя бы одну строку в загруженный файл.',
}, },
execution: 'ИСПОЛНЕНИЕ', execution: 'Запуск',
executions: '{{num}} ВЫПОЛНЕНИЯ', executions: '{{num}} запусков',
stopRun: 'Остановить выполнение', stopRun: 'Остановить выполнение',
}, },
login: { login: {

View File

@ -71,8 +71,8 @@ const translation = {
moreThanMaxLengthLine: 'Vrstica {{rowIndex}}: vrednost {{varName}} ne sme biti daljša od {{maxLength}} znakov', moreThanMaxLengthLine: 'Vrstica {{rowIndex}}: vrednost {{varName}} ne sme biti daljša od {{maxLength}} znakov',
atLeastOne: 'Prosimo, vnesite vsaj eno vrstico v naloženo datoteko.', atLeastOne: 'Prosimo, vnesite vsaj eno vrstico v naloženo datoteko.',
}, },
execution: 'IZVEDBA', execution: 'Zagon',
executions: '{{num}} IZVRŠITEV', executions: '{{num}} zagonov',
stopRun: 'Ustavi izvajanje', stopRun: 'Ustavi izvajanje',
}, },
login: { login: {

View File

@ -71,7 +71,7 @@ const translation = {
atLeastOne: 'โปรดป้อนอย่างน้อยหนึ่งแถวในไฟล์ที่อัปโหลด', atLeastOne: 'โปรดป้อนอย่างน้อยหนึ่งแถวในไฟล์ที่อัปโหลด',
}, },
execution: 'การดำเนินการ', execution: 'การดำเนินการ',
executions: '{{num}} การประหารชีวิต', executions: '{{num}} ครั้งที่รัน',
stopRun: 'หยุดการทำงาน', stopRun: 'หยุดการทำงาน',
}, },
login: { login: {

View File

@ -70,8 +70,8 @@ const translation = {
moreThanMaxLengthLine: 'Satır {{rowIndex}}: {{varName}} değeri {{maxLength}} karakterden fazla olamaz', moreThanMaxLengthLine: 'Satır {{rowIndex}}: {{varName}} değeri {{maxLength}} karakterden fazla olamaz',
atLeastOne: 'Lütfen yüklenen dosyada en az bir satır girin.', atLeastOne: 'Lütfen yüklenen dosyada en az bir satır girin.',
}, },
execution: 'İFRAZAT', execution: 'Çalıştır',
executions: '{{num}} İDAM', executions: '{{num}} çalıştırma',
stopRun: 'Çalışmayı durdur', stopRun: 'Çalışmayı durdur',
}, },
login: { login: {

View File

@ -70,8 +70,8 @@ const translation = {
moreThanMaxLengthLine: 'Рядок {{rowIndex}}: значення {{varName}} не може містити більше {{maxLength}} символів', moreThanMaxLengthLine: 'Рядок {{rowIndex}}: значення {{varName}} не може містити більше {{maxLength}} символів',
atLeastOne: 'Будь ласка, введіть принаймні один рядок у завантажений файл.', atLeastOne: 'Будь ласка, введіть принаймні один рядок у завантажений файл.',
}, },
execution: 'ВИКОНАННЯ', execution: 'Запуск',
executions: '{{num}} ВИКОНАНЬ', executions: '{{num}} запусків',
stopRun: 'Зупинити виконання', stopRun: 'Зупинити виконання',
}, },
login: { login: {

View File

@ -70,8 +70,8 @@ const translation = {
moreThanMaxLengthLine: 'Dòng {{rowIndex}}: {{varName}} không thể chứa quá {{maxLength}} ký tự', moreThanMaxLengthLine: 'Dòng {{rowIndex}}: {{varName}} không thể chứa quá {{maxLength}} ký tự',
atLeastOne: 'Vui lòng nhập ít nhất một dòng vào tệp đã tải lên.', atLeastOne: 'Vui lòng nhập ít nhất một dòng vào tệp đã tải lên.',
}, },
executions: '{{num}} ÁN TỬ HÌNH', execution: 'Chạy',
execution: 'THI HÀNH', executions: '{{num}} lần chạy',
stopRun: 'Dừng thực thi', stopRun: 'Dừng thực thi',
}, },
login: { login: {

View File

@ -71,7 +71,7 @@ const translation = {
atLeastOne: '上傳檔案的內容不能少於一條', atLeastOne: '上傳檔案的內容不能少於一條',
}, },
execution: '執行', execution: '執行',
executions: '{{num}} 執行', executions: '{{num}} 執行',
stopRun: '停止運行', stopRun: '停止運行',
}, },
login: { login: {