class
LLM::General
- LLM::General
- Reference
- Object
Overview
General OpenAI-compatible LLM client
Defined in:
llm/general/client.crConstructors
Class Method Summary
-
.extract_agent_action(response_json : JSON::Any) : String
Parse provider response into normalized JSON action payload.
- .parse_tools_cached(tools : String) : JSON::Any
Instance Method Summary
-
#request(prompt : String, format : String = "json")
Make a simple request with a single prompt
-
#request_messages(messages : Array(Hash(String, String)), format : String = "json")
Make a request with chat-style messages
-
#request_messages_with_tools(messages : Array(Hash(String, String)), tools : String)
Request next action with provider-native tool-calling.
Constructor Detail
Class Method Detail
Parse provider response into normalized JSON action payload. If the model returns tool_calls, convert them to: {"action":"<function_name>","args":{...}} Otherwise, return cleaned textual content as-is.
Instance Method Detail
Make a simple request with a single prompt
Make a request with chat-style messages
Request next action with provider-native tool-calling.
tools must be a JSON array string compatible with OpenAI-style chat completions API.