class LLMEndpointOptimizer
- LLMEndpointOptimizer
- EndpointOptimizer
- Reference
- Object
Overview
Enhanced optimizer with LLM-based optimization capabilities for refining non-standard or unconventional paths and parameters
Defined in:
optimizer/llm_optimizer.crConstant Summary
-
LLM_OPTIMIZE_FORMAT =
"{\n \"type\": \"json_schema\",\n \"json_schema\": {\n \"name\": \"optimize_endpoint\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"optimized_url\": {\n \"type\": \"string\"\n },\n \"optimized_params\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"param_type\": {\n \"type\": \"string\"\n },\n \"value\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"name\", \"param_type\", \"value\"],\n \"additionalProperties\": false\n }\n }\n },\n \"required\": [\"optimized_url\", \"optimized_params\"],\n \"additionalProperties\": false\n },\n \"strict\": true\n }\n}" -
LLM response format for optimization. The canonical prompt text lives in LLM::PromptOverrides.llm_optimize_prompt — the older LLM_OPTIMIZE_PROMPT constant that used to live here was a dead duplicate and has been removed.
-
VALID_PARAM_TYPES =
["query", "json", "form", "header", "cookie", "path"] of ::String
Constructors
Instance Method Summary
-
#optimize(endpoints : Array(Endpoint)) : Array(Endpoint)
Enhanced optimization with LLM capabilities
Instance methods inherited from class EndpointOptimizer
add_path_parameters(endpoints : Array(Endpoint)) : Array(Endpoint)
add_path_parameters,
apply_pvalue(param_type, param_name, param_value) : String
apply_pvalue,
combine_url_and_endpoints(endpoints : Array(Endpoint)) : Array(Endpoint)
combine_url_and_endpoints,
normalize_url_shapes(endpoints : Array(Endpoint)) : Array(Endpoint)
normalize_url_shapes,
optimize(endpoints : Array(Endpoint)) : Array(Endpoint)
optimize,
optimize_endpoints(endpoints : Array(Endpoint)) : Array(Endpoint)
optimize_endpoints
Constructor methods inherited from class EndpointOptimizer
new(logger : NoirLogger, options : Hash(String, YAML::Any))
new
Constructor Detail
Instance Method Detail
Enhanced optimization with LLM capabilities