Documentation
¶
Overview ¶
Package llmutil holds small helpers shared between LLM-calling code paths.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanLLMResponse ¶
CleanLLMResponse strips reasoning/thinking blocks and markdown code fences from a raw LLM response so the remaining text is ready for JSON parsing.
Thinking blocks:
- <think>...</think>: both tags present; everything between is removed
- ...</think>: orphan closer; everything before it is removed too
Markdown fences: a leading ```lang\n and a trailing ``` are stripped if present. This handles the common "```json\n{...}\n```" wrapping.
func ExtractJSON ¶
ExtractJSON is a last-resort fallback used after CleanLLMResponse + json.Unmarshal fail: it returns the substring from the first '{' to the last '}', or the input unchanged if no braces are found.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.