/
Paff
/
declarant
Обзор
Документация
Войти
/
Paff
/
declarant
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
test_api.py
40 строк
1 KB
1pash1985-gif
Unified doc list UI + AI prompt for FORM_A
05 авг 2026, 10:09
05 авг 2026, 10:09
e439f08
Код
Авторство
О чём код?
"""Test ensemble directly.""" import os import sys sys.path.insert(0, '/app/web') import logging logging.basicConfig(level=logging.DEBUG) from ai_ensemble import AIEnsemble from ai_parser import INVOICE_SYSTEM_PROMPT, KIMI_MODEL from config import DEEPSEEK_MODEL print(f'DEEPSEEK_MODEL: {DEEPSEEK_MODEL}') print(f'KIMI_MODEL: {KIMI_MODEL}') sample_invoice = ''' INVOICE #12345 Date: 2024-01-15 From: FRESH FLOWERS BV Item: ROSE RED, Qty: 100 stems, Price: $0.50 Total: $50.00 ''' print('\nTesting ensemble...') ensemble = AIEnsemble() result = ensemble.run( system_prompt=INVOICE_SYSTEM_PROMPT, user_prompt=f'Вот текст инвойса:\n\n{sample_invoice}', temperature=0.1, max_tokens=8192, task_name='test_invoice', ) print(f'\nStatus: {result.status}') print(f'Error: {result.error}') print(f'Debate rounds: {result.debate_rounds}') if result.result and 'supplier' in result.result: print(f'Supplier: {result.result.get("supplier")}') for out in result.model_outputs: print(f' Model: {out.model}, error: {out.error}, parsed: {out.parsed is not None}')