Refactor Review GenAI Prompt (#22353)
CI / AMD64 Build (push) Waiting to run
CI / Assemble and push default build (push) Blocked by required conditions
CI / ARM Build (push) Waiting to run
CI / Jetson Jetpack 6 (push) Waiting to run
CI / AMD64 Extra Build (push) Blocked by required conditions
CI / ARM Extra Build (push) Blocked by required conditions
CI / Synaptics Build (push) Blocked by required conditions

* Improve title to better capture activity

* Improve efficiency of prompt

* Use json format for llama.cpp

* Cleanup prompt

* Add output format for other LLMs
This commit is contained in:
Nicolas Mowen
2026-03-09 19:47:37 -05:00
committed by GitHub
parent e75b8ca6cc
commit 5254bfd00e
7 changed files with 102 additions and 40 deletions
+9 -1
View File
@@ -57,7 +57,12 @@ class LlamaCppClient(GenAIClient):
else None
)
def _send(self, prompt: str, images: list[bytes]) -> Optional[str]:
def _send(
self,
prompt: str,
images: list[bytes],
response_format: Optional[dict] = None,
) -> Optional[str]:
"""Submit a request to llama.cpp server."""
if self.provider is None:
logger.warning(
@@ -96,6 +101,9 @@ class LlamaCppClient(GenAIClient):
**self.provider_options,
}
if response_format:
payload["response_format"] = response_format
response = requests.post(
f"{self.provider}/v1/chat/completions",
json=payload,