Files
microdao-daarion/services/llm-proxy/providers/base_provider.py
Apple 6bd769ef40 feat(city-map): Add 2D City Map with coordinates and agent presence
- Add migration 013_city_map_coordinates.sql with map coordinates, zones, and agents table
- Add /city/map API endpoint in city-service
- Add /city/agents and /city/agents/online endpoints
- Extend presence aggregator to include agents[] in snapshot
- Add AgentsSource for fetching agent data from DB
- Create CityMap component with interactive room tiles
- Add useCityMap hook for fetching map data
- Update useGlobalPresence to include agents
- Add map/list view toggle on /city page
- Add agent badges to room cards and map tiles
2025-11-27 07:00:47 -08:00

38 lines
943 B
Python

from abc import ABC, abstractmethod
from typing import Protocol
from models import ChatMessage, LLMResponse
class BaseProvider(Protocol):
"""Base protocol for LLM providers"""
@abstractmethod
async def chat(
self,
messages: list[ChatMessage],
model_name: str,
max_tokens: int | None = None,
temperature: float = 0.7,
top_p: float = 1.0,
**kwargs
) -> LLMResponse:
"""
Send chat completion request to LLM provider
Args:
messages: List of chat messages
model_name: Physical model name for this provider
max_tokens: Maximum tokens to generate
temperature: Sampling temperature
top_p: Nucleus sampling parameter
**kwargs: Provider-specific parameters
Returns:
LLMResponse with content, usage, and metadata
"""
...