Coder preparations

This commit is contained in:
2026-09-22 23:21:59 +03:00
parent 3d1df7fee5
commit 1f2dc25e0b
32 changed files with 3205 additions and 26 deletions
+4 -1
View File
@@ -6,11 +6,14 @@ class LLMClient:
self.model = model
self.client = OpenAI(base_url=base_url, api_key=api_key or "ollama")
def chat_with_schema(self, prompt: str, schema: dict):
def chat_with_schema(self, prompt: str, schema: dict, system: str | None = None) -> str | None:
assert_strict_mode_clean(schema)
kwargs = {
"model": self.model,
"messages": [
{"role": "system", "content": system},
{"role": "user", "content": prompt},
] if system else [
{"role": "user", "content": prompt},
],
"response_format": schema,