"""Deterministik, önceden yazılmış yanıtlar dönen sahte LLM. YALNIZCA otomatik testler ve altyapı doğrulaması içindir: ajan döngüsünü, araç çağırmayı, koşucuları ve ölçümleri gerçek bir model olmadan uçtan uca sınamaya yarar. Gerçek model başarımı ölçümlerinde kullanılmaz. """ from __future__ import annotations from typing import Any, Callable, Optional, Union from .base import LLMClient, LLMResponse, ToolCall, ToolSpec Step = Union[LLMResponse, Callable[[list[dict[str, Any]]], LLMResponse]] class ScriptedLLM(LLMClient): def __init__(self, steps: list[Step], model: str = "scripted") -> None: self.steps = list(steps) self.model = model self.calls: list[list[dict[str, Any]]] = [] def chat(self, messages, tools: Optional[list[ToolSpec]] = None, json_mode: bool = False, temperature: float = 0.2) -> LLMResponse: self.calls.append(messages) if not self.steps: return LLMResponse(content="", tool_calls=[ToolCall("finish", {"summary": "script bitti"})]) step = self.steps.pop(0) return step(messages) if callable(step) else step def tool(name: str, **args: Any) -> LLMResponse: return LLMResponse(content="", tool_calls=[ToolCall(name=name, arguments=args)]) def text(content: str) -> LLMResponse: return LLMResponse(content=content)