morpheus_llm.llm.nodes.retriever_node.RetrieverNode
- class RetrieverNode(*, embedding, service, **similarity_search_kwargs)[source]
Bases:
morpheus_llm._lib.llm.LLMNodeBase
Node for retrieving data from a vector database based on embeddings.
- Parameters
- embeddingtyping.Callable[[list[str]], typing.Coroutine[typing.Any, typing.Any, list[list[float]]]] | None
Callable function for generating vector embeddings. Default is None.
- serviceVectorDBResourceService
Vector database resource service for executing similarity searches.
- similarity_search_kwargsdict
Additional keyword arguments for the similarity search.
Methods
execute
(context)Execute the retrieval process based on the provided context. get_input_names
()Get the input names for the RetrieverNode. - async execute(context)[source]
Execute the retrieval process based on the provided context.
- Parameters
- contextLLMContext
Context object containing necessary information for execution.
- Returns
- LLMContext
Updated context object after the execution.
- get_input_names()[source]
Get the input names for the RetrieverNode.
- Returns
- list[str]
List of input names for the RetrieverNode.