ragrank.integrations.llama_index.llamaindex_llm_wrapper

Module for all of the llamaindex llm models

class ragrank.integrations.llama_index.llamaindex_llm_wrapper.LlamaindexLLMWrapper(*, llm_config: LLMConfig = None, llm: Any)

Wrapper class for Llamaindex Language Models.

llm

The Llamaindex Language Model.

Type:

LLM

Properties:

name (str): Get the name of the Llamaindex LLM Wrapper. llm_name (str): Get the name of the wrapped Llamaindex LLM.

generate_text()

Generate text using the Llamaindex LLM.

generate_text(text: str) LLMResult

Generate text using the Llamaindex LLM.

Parameters:

text (str) – The input text.

Returns:

The generated text result.

Return type:

LLMResult

property llm_name: str

Get the name of the wrapped Llamaindex LLM.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ConfigDict = {'arbitrary_types_allowed': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'llm': FieldInfo(annotation=Any, required=True, description='The Llamaindex Language Model.'), 'llm_config': FieldInfo(annotation=LLMConfig, required=False, default_factory=LLMConfig, repr=False)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

property name: str

Get the name of the Llamaindex LLM Wrapper.

classmethod validator(v: LLM) LlamaindexLLMWrapper

Pydantic validation for Llamaindex LLM instance. Doing this because of the conflict in the v1 pydantic module.

Raises:

TypeError – If the type of the llamaindex llm is not correct.