Merge pull request #325 from ggozad/fix/inspect
Fix broken textual detection in chat & inspect
This commit is contained in:
commit
adcd3bcb92
2 changed files with 33 additions and 50 deletions
|
|
@ -1,4 +1,3 @@
|
|||
# pyright: reportPossiblyUnboundVariable=false
|
||||
import asyncio
|
||||
import json
|
||||
import uuid
|
||||
|
|
@ -7,28 +6,6 @@ from datetime import datetime
|
|||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from haiku.rag.client import HaikuRAG
|
||||
from haiku.rag.config import get_config
|
||||
from haiku.rag.skills.rag import AGENT_PREAMBLE, RAGState
|
||||
from haiku.skills.agent import (
|
||||
SkillToolset,
|
||||
run_agui_stream,
|
||||
)
|
||||
from haiku.skills.models import Skill
|
||||
from haiku.skills.prompts import build_system_prompt
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from textual.app import ComposeResult
|
||||
|
||||
try:
|
||||
import logfire
|
||||
|
||||
logfire.configure(send_to_logfire="if-token-present", console=False)
|
||||
logfire.instrument_pydantic_ai()
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
try:
|
||||
import textual_image.widget # noqa: F401 - import early for renderer detection
|
||||
from ag_ui.core import (
|
||||
ActivitySnapshotEvent,
|
||||
|
|
@ -51,12 +28,26 @@ try:
|
|||
from textual.worker import Worker
|
||||
|
||||
from haiku.rag.chat.widgets.chat_history import ChatHistory, CitationWidget
|
||||
from haiku.rag.client import HaikuRAG
|
||||
from haiku.rag.config import get_config
|
||||
from haiku.rag.skills.rag import AGENT_PREAMBLE, RAGState
|
||||
from haiku.skills.agent import (
|
||||
SkillToolset,
|
||||
run_agui_stream,
|
||||
)
|
||||
from haiku.skills.models import Skill
|
||||
from haiku.skills.prompts import build_system_prompt
|
||||
|
||||
TEXTUAL_AVAILABLE = True
|
||||
try:
|
||||
import logfire
|
||||
|
||||
logfire.configure(send_to_logfire="if-token-present", console=False)
|
||||
logfire.instrument_pydantic_ai()
|
||||
except ImportError:
|
||||
TEXTUAL_AVAILABLE = False
|
||||
App = object # type: ignore
|
||||
SystemCommand = object # type: ignore
|
||||
pass
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from textual.app import ComposeResult
|
||||
|
||||
|
||||
RAG_STATE_NAMESPACE = "rag"
|
||||
|
|
|
|||
|
|
@ -1,29 +1,21 @@
|
|||
# pyright: reportPossiblyUnboundVariable=false
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from haiku.rag.client import HaikuRAG
|
||||
from haiku.rag.config import get_config
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from textual.app import ComposeResult
|
||||
|
||||
try:
|
||||
from textual.app import App
|
||||
from textual.binding import Binding
|
||||
from textual.screen import Screen
|
||||
from textual.widgets import Footer, Header
|
||||
|
||||
from haiku.rag.client import HaikuRAG
|
||||
from haiku.rag.config import get_config
|
||||
from haiku.rag.inspector.widgets.chunk_list import ChunkList
|
||||
from haiku.rag.inspector.widgets.detail_view import DetailView
|
||||
from haiku.rag.inspector.widgets.document_list import DocumentList
|
||||
from haiku.rag.inspector.widgets.search_modal import SearchModal
|
||||
|
||||
TEXTUAL_AVAILABLE = True
|
||||
except ImportError:
|
||||
TEXTUAL_AVAILABLE = False
|
||||
App = object # type: ignore
|
||||
if TYPE_CHECKING:
|
||||
from textual.app import ComposeResult
|
||||
|
||||
|
||||
class InspectorApp(App):
|
||||
|
|
|
|||
Loading…
Reference in a new issue