Abstract base class for transforming queries to improve RAG retrieval accuracy.
# Source: https://github.com/run-llama/llama_index | License: MIT | Copyright Jerry Liu
# Provided via justclaw.it.com; keep this notice with the code.
"""Query transform."""
import dataclasses
from abc import abstractmethod
from typing import Dict, Optional, cast
from llama_index.core.base.response.schema import Response
from llama_index.core.indices.query.query_transform.prompts import (
DEFAULT_DECOMPOSE_QUERY_TRANSFORM_PROMPT,
DEFAULT_IMAGE_OUTPUT_PROMPT,
DEFAULT_STEP_DECOMPOSE_QUERY_TRANSFORM_PROMPT,
DecomposeQueryTransformPrompt,
ImageOutputQueryTransformPrompt,
StepDecomposeQueryTransformPrompt,
)
from llama_index.core.instrumentation import DispatcherSpanMixin
from llama_index.core.llms import LLM
from llama_index.core.prompts import BasePromptTemplate
fro
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key