{ "cells": [ { "cell_type": "code", "execution_count": null, "id": "d2f58b84", "metadata": {}, "outputs": [], "source": [ "# LLM Quest — Interface de Reformulação Epistêmica\n", "# Execute esta célula e a seguinte. A interface abre logo abaixo." ] }, { "cell_type": "code", "execution_count": 3, "id": "d83415b3", "metadata": {}, "outputs": [], "source": [ "import os, sys, warnings\n", "warnings.filterwarnings('ignore')\n", "\n", "project_root = os.path.abspath('')\n", "if project_root not in sys.path:\n", " sys.path.insert(0, project_root)\n", "\n", "from dotenv import load_dotenv\n", "load_dotenv(override=True)\n", "\n", "os.environ['INFERENCE_BACKEND'] = 'claude'" ] }, { "cell_type": "code", "execution_count": 4, "id": "afa0dc7a", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
" ], "text/plain": [ "Digite uma pergunta.
'\n", "\n", " _init()\n", "\n", " from src.rl.inference import reformular, reformular_ptbr\n", " ptbr = (idioma == 'Português')\n", "\n", " try:\n", " r = reformular_ptbr(pergunta, n=8) if ptbr else reformular(pergunta, n=8)\n", " except Exception as e:\n", " return f'Erro: {e}
'\n", "\n", " if ptbr:\n", " entrada, saida = r.q_bad_pt, r.best_pt\n", " sub_in = f'{v:.3f}| # | \n", "EE | \n", "Reformulação | \n", "
|---|