Commit 781ba659 authored by Kantz's avatar Kantz
Browse files

verscuht das decision_LLM zu fixen

parent bc0fbd71
...@@ -36,7 +36,6 @@ def needs_more_context(context_sheet: str) -> dict: ...@@ -36,7 +36,6 @@ def needs_more_context(context_sheet: str) -> dict:
f"{context_sheet}\n\n" f"{context_sheet}\n\n"
} }
) )
messages.append({"role": "user", "content": "Treffe eine Entscheidung. Zu der letzten Nachricht"})
resp, tool_outputs = llm_client.chat_with_tools( resp, tool_outputs = llm_client.chat_with_tools(
messages=messages, messages=messages,
......
...@@ -52,7 +52,14 @@ def chat( ...@@ -52,7 +52,14 @@ def chat(
if settings.temperature is not None: if settings.temperature is not None:
kwargs["options"] = {"temperature": settings.temperature} kwargs["options"] = {"temperature": settings.temperature}
response = client.chat(**_filter_kwargs(client.chat, kwargs)) filtered_kwargs = _filter_kwargs(client.chat, kwargs)
if tools and "tools" not in filtered_kwargs:
raise RuntimeError(
"Configured ollama Python client does not support tool calling (chat(..., tools=...)). "
"Update the 'ollama' package or switch to a backend/model path with tool support."
)
response = client.chat(**filtered_kwargs)
return {"raw": response, "message": _extract_message(response)} return {"raw": response, "message": _extract_message(response)}
......
...@@ -21,14 +21,6 @@ def _resolve_sheet(args: argparse.Namespace) -> dict[str, Any]: ...@@ -21,14 +21,6 @@ def _resolve_sheet(args: argparse.Namespace) -> dict[str, Any]:
return sheet return sheet
raise ValueError("Bitte --sheet oder --chat-id angeben.") raise ValueError("Bitte --sheet oder --chat-id angeben.")
def _last_user_inputs(history: list[dict[str, Any]], count: int) -> list[str]:
if count <= 0:
return []
user_msgs = [msg.get("content", "") for msg in history if msg.get("role") == "user"]
return [text for text in user_msgs[-count:] if text]
def main() -> None: def main() -> None:
parser = argparse.ArgumentParser(description="Isolierter Decision-LLM Test mit Context Sheet.") parser = argparse.ArgumentParser(description="Isolierter Decision-LLM Test mit Context Sheet.")
parser.add_argument("--sheet", help="Pfad zu einem Context Sheet JSON.") parser.add_argument("--sheet", help="Pfad zu einem Context Sheet JSON.")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment