Skip to main content

Azure Cognitive Search Loader

pip install llama-index-readers-azcognitive-search

The AzCognitiveSearchReader Loader returns a set of texts corresponding to documents retrieved from specific index of Azure Cognitive Search. The user initializes the loader with credentials (service name and key) and the index name.

Usage

Here's an example usage of the AzCognitiveSearchReader.

from llama_index.readers.azcognitive_search import AzCognitiveSearchReader

reader = AzCognitiveSearchReader(
    "<Azure_Cognitive_Search_NAME>",
    "<Azure_Cognitive_Search_KEY>",
    "<Index_name>",
)


query_sample = ""
documents = reader.load_data(
    query="<search_term>",
    content_field="<content_field_name>",
    filter="<azure_search_filter>",
)

Usage in combination with langchain

from llama_index.core import VectorStoreIndex, download_loader
from langchain.chains.conversation.memory import ConversationBufferMemory
from langchain.agents import Tool, AgentExecutor, load_tools, initialize_agent

from llama_index.readers.azcognitive_search import AzCognitiveSearchReader

az_loader = AzCognitiveSearchReader(
    COGNITIVE_SEARCH_SERVICE_NAME, COGNITIVE_SEARCH_KEY, INDEX_NAME
)

documents = az_loader.load_data(query, field_name)

index = VectorStoreIndex.from_documents(
    documents, service_context=service_context
)

tools = [
    Tool(
        name="Azure cognitive search index",
        func=lambda q: index.query(q),
        description=f"Useful when you want answer questions about the text on azure cognitive search.",
    ),
]
memory = ConversationBufferMemory(memory_key="chat_history")
agent_chain = initialize_agent(
    tools, llm, agent="zero-shot-react-description", memory=memory
)

result = agent_chain.run(input="How can I contact with my health insurance?")

This loader is designed to be used as a way to load data into LlamaIndex.

Metadata

Release files for llama-index-readers-azcognitive-search 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llama-index-readers-azcognitive-search 0.6.0
File Size Uploaded Provenance Actions
llama_index_readers_azcognitive_search-0.6.0.tar.gz 4.4 kB Without provenance Details for llama_index_readers_azcognitive_search-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for llama-index-readers-azcognitive-search 0.6.0
File Interpreter ABI Platform Actions
llama_index_readers_azcognitive_search-0.6.0-py3-none-any.whl Python 3 none any Details for llama_index_readers_azcognitive_search-0.6.0-py3-none-any.whl

Total release size: 8.6 kB

Release files / llama_index_readers_azcognitive_search-0.6.0.tar.gz

Download URL llama_index_readers_azcognitive_search-0.6.0.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
96a2e07b02e654e500e5b0a53c1d8f483a97f9b7d09da517769d482e891377ff
BLAKE2b-256 checksum
How to use checksums
bf948cd6b6b63c7355d8e2d3c0157e678f9cdc19a05b6017c3f2285bd733dd43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / llama_index_readers_azcognitive_search-0.6.0-py3-none-any.whl

Download URL llama_index_readers_azcognitive_search-0.6.0-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f8fbefa6504a7a4e1a88033c1fe114ac9b0c6984fccbcc8856b0c21058dad03b
BLAKE2b-256 checksum
How to use checksums
76e08baf9d3b3cd58e56a86dc8f4c00c742933336febe682a570b9914813af01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for llama-index-readers-azcognitive-search 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page