Skip to content

No op query transformer

A query transformer that returns the input query without modification.

This module defines a query transformer that returns the input query without any modification. This is useful when no transformation is needed for the input query, or as a companion to other query transformers in a pipeline.

Authors

Dimitrij Ray (dimitrij.ray@gdplabs.id)

References

NONE

NoOpQueryTransformer(on_error=ErrorHandling.RAISE)

Bases: BaseQueryTransformer

A query transformer that returns the input query without modification.

Examples:

import asyncio

from gllm_retrieval.query_transformer.no_op_query_transformer import NoOpQueryTransformer

transformer = NoOpQueryTransformer()

single_input = "Find recent research on diffusion transformers."

result = asyncio.run(transformer.transform(single_input))
print(result)

Attributes:

Name Type Description
on_error ErrorHandling

The error handling strategy. Since this transformer performs no actual transformation that can fail, this primarily exists for API consistency. Defaults to ErrorHandling.RAISE.

Initialize the NoOpQueryTransformer.

Parameters:

Name Type Description Default
on_error ErrorHandling

The error handling strategy. Defaults to ErrorHandling.RAISE.

RAISE

from_lm_components(*args, **kwargs) classmethod

Create a NoOpQueryTransformer instance.

Returns:

Name Type Description
NoOpQueryTransformer NoOpQueryTransformer

A new instance of NoOpQueryTransformer.