Teradata Package for LangChain Function Reference - get_batch_result - Teradata® Package for LangChain - Look here for syntax, methods and examples for the functions included in the Teradata langchain-teradata package.

Teradata® Package for LangChain Function Reference

Deployment
VantageCloud
Edition
Enterprise
Product
Teradata® Package for LangChain
Release Number
20.00.00.01
Published
December 2025
ft:locale
en-US
ft:lastEdition
2025-12-19
dita:id
Langchain-Teradata_FxRef_Lake
Product Category
Teradata Vantage
libs.teradata.langchain_teradata.TeradataVectorStore.get_batch_result = get_batch_result(self, api_name, **kwargs)
DESCRIPTION:
    Retrieves the batch result for the specified API.
    The API name can be one of the following:   
        * similarity-search
        * prepare-response
        * ask
    Applicable only for batch mode operations.
 
PARAMETERS:
    api_name:
        Required Argument.
        Specifies the name of the API.
        Permitted Values:
            * VSApi.SimilaritySearch
            * VSApi.PrepareResponse
            * VSApi.Ask
        Types: Enum(VSApi)
 
RETURNS:
    * teradataml DataFrame containing the batch result for ask, prepare_response.
    * SimilaritySearch object for similarity_search.
 
RAISES:
    TeradataMlException.
 
EXAMPLES:
    # Create an instance of the TeradataVectorStore.
    # Note this step is not needed if vector store already exists.
    >>> vs = TeradataVectorStore.from_datasets(name="vs",
                                               data = "valid_passages",
                                               data_columns = "passage",
                                               key_columns = "pid",
                                               embedding = "amazon.titan-embed-text-v1",
                                               top_k=10,
                                               search_algorithm="HNSW",
                                               vector_column="VectorIndex")
 
    # Example 1: Perform batch similarity search in the Vector Store.
    >>> vs.similarity_search(batch_data="home_depot_train",
                             batch_id_column="product_uid",
                             batch_query_column="search_term")
 
 
    # Get the batch result for the similarity_search API.
    >>> from teradatagenai import VSApi
    >>> res = vs.get_batch_result(api_name=VSApi.SimilaritySearch)
 
    # Example 2: Perform batch prepare_response in the Vector Store.
    >>> prompt= "Structure response in question-answering format
                 Question: 
                 Answer:"
    >>> vs.prepare_response(batch_data="home_depot_train",
                            batch_id_column="product_uid",
                            batch_query_column="search_term",
                            prompt=prompt)
 
    # Get the batch result for the prepare_response API.
    >>> res = vs.get_batch_result(api_name=VSApi.PrepareResponse)
 
    # Example 3: Perform batch ask in the Vector Store.
    >>> vs.ask(batch_data="home_depot_train",
               batch_id_column="product_uid",
               batch_query_column="search_term",
               prompt=prompt)
 
    # Get the batch result for the ask API.
    >>> res = vs.get_batch_result(api_name=VSApi.Ask)