mirror of
https://github.com/furyhawk/ai_agent.git
synced 2026-07-21 10:15:44 +00:00
- Implemented `conversation-store` for managing conversations and messages. - Created `file-preview-store` to handle file preview state. - Added `sidebar-store` for sidebar visibility management. - Developed `theme-store` for theme persistence and management. - Introduced `kb-selection-store` for managing active knowledge base selections with persistence. chore: define API and chat types - Added types for API responses, authentication, chat messages, conversations, and projects. - Defined interfaces for various entities including users, sessions, and message ratings. build: configure TypeScript and testing setup - Set up `tsconfig.json` for TypeScript configuration. - Created `vitest.config.ts` for testing configuration with Vitest. - Added `vitest.setup.ts` for global test setup including mocks for Next.js router and media queries. - Configured Vercel deployment settings in `vercel.json`.
33 lines
784 B
Python
33 lines
784 B
Python
"""Logfire observability configuration."""
|
|
|
|
from typing import Any
|
|
|
|
import logfire
|
|
|
|
from app.core.config import settings
|
|
|
|
|
|
def setup_logfire() -> None:
|
|
"""Configure Logfire instrumentation."""
|
|
logfire.configure(
|
|
token=settings.LOGFIRE_TOKEN,
|
|
service_name=settings.LOGFIRE_SERVICE_NAME,
|
|
environment=settings.LOGFIRE_ENVIRONMENT,
|
|
send_to_logfire="if-token-present",
|
|
)
|
|
|
|
|
|
def instrument_app(app: Any) -> None:
|
|
"""Instrument FastAPI app with Logfire."""
|
|
logfire.instrument_fastapi(app)
|
|
|
|
|
|
def instrument_asyncpg() -> None:
|
|
"""Instrument asyncpg for PostgreSQL."""
|
|
logfire.instrument_asyncpg()
|
|
|
|
|
|
def instrument_pydantic_ai() -> None:
|
|
"""Instrument PydanticAI for AI agent observability."""
|
|
logfire.instrument_pydantic_ai()
|