| Name | llama-index-readers-azcognitive-search JSON | 
| Version | 0.4.0  JSON | 
|  | download | 
| home_page | None | 
| Summary | llama-index readers azcognitive_search integration | 
            | upload_time | 2025-07-30 20:50:14 | 
            | maintainer | mrcabellom | 
            
            | docs_url | None | 
            | author | None | 
            
            | requires_python | <4.0,>=3.9 | 
            
            
            | license | None | 
            | keywords |  | 
            | VCS |  | 
            | bugtrack_url |  | 
            | requirements | No requirements were recorded. | 
            
| Travis-CI | No Travis. | 
            | coveralls test coverage | No coveralls. | 
        
        
            
            # Azure Cognitive Search Loader
```bash
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.
```python
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
```python
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](https://github.com/run-llama/llama_index/).
            
         
        Raw data
        
            {
    "_id": null,
    "home_page": null,
    "name": "llama-index-readers-azcognitive-search",
    "maintainer": "mrcabellom",
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Your Name <you@example.com>",
    "download_url": "https://files.pythonhosted.org/packages/1c/9e/f21e51563c94e38b344110102afe7754f7a064578287614db809eeea7fb6/llama_index_readers_azcognitive_search-0.4.0.tar.gz",
    "platform": null,
    "description": "# Azure Cognitive Search Loader\n\n```bash\npip install llama-index-readers-azcognitive-search\n```\n\nThe AzCognitiveSearchReader Loader returns a set of texts corresponding to documents retrieved from specific index of Azure Cognitive Search.\nThe user initializes the loader with credentials (service name and key) and the index name.\n\n## Usage\n\nHere's an example usage of the AzCognitiveSearchReader.\n\n```python\nfrom llama_index.readers.azcognitive_search import AzCognitiveSearchReader\n\nreader = AzCognitiveSearchReader(\n    \"<Azure_Cognitive_Search_NAME>\",\n    \"<Azure_Cognitive_Search_KEY>\",\n    \"<Index_name>\",\n)\n\n\nquery_sample = \"\"\ndocuments = reader.load_data(\n    query=\"<search_term>\",\n    content_field=\"<content_field_name>\",\n    filter=\"<azure_search_filter>\",\n)\n```\n\n## Usage in combination with langchain\n\n```python\nfrom llama_index.core import VectorStoreIndex, download_loader\nfrom langchain.chains.conversation.memory import ConversationBufferMemory\nfrom langchain.agents import Tool, AgentExecutor, load_tools, initialize_agent\n\nfrom llama_index.readers.azcognitive_search import AzCognitiveSearchReader\n\naz_loader = AzCognitiveSearchReader(\n    COGNITIVE_SEARCH_SERVICE_NAME, COGNITIVE_SEARCH_KEY, INDEX_NAME\n)\n\ndocuments = az_loader.load_data(query, field_name)\n\nindex = VectorStoreIndex.from_documents(\n    documents, service_context=service_context\n)\n\ntools = [\n    Tool(\n        name=\"Azure cognitive search index\",\n        func=lambda q: index.query(q),\n        description=f\"Useful when you want answer questions about the text on azure cognitive search.\",\n    ),\n]\nmemory = ConversationBufferMemory(memory_key=\"chat_history\")\nagent_chain = initialize_agent(\n    tools, llm, agent=\"zero-shot-react-description\", memory=memory\n)\n\nresult = agent_chain.run(input=\"How can I contact with my health insurance?\")\n```\n\nThis loader is designed to be used as a way to load data into [LlamaIndex](https://github.com/run-llama/llama_index/).\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "llama-index readers azcognitive_search integration",
    "version": "0.4.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "039634fdd8784d4c2d93690042fe02aca1395b46cb404083f5c7b4e88e88bddd",
                "md5": "119ef74498cfc1e78df6937d906efdaa",
                "sha256": "c9e0858a5755d77bfbca7c1830b6f9f2a5abe0459231f5ce40c99f4ab5e564ef"
            },
            "downloads": -1,
            "filename": "llama_index_readers_azcognitive_search-0.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "119ef74498cfc1e78df6937d906efdaa",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 4213,
            "upload_time": "2025-07-30T20:50:13",
            "upload_time_iso_8601": "2025-07-30T20:50:13.868639Z",
            "url": "https://files.pythonhosted.org/packages/03/96/34fdd8784d4c2d93690042fe02aca1395b46cb404083f5c7b4e88e88bddd/llama_index_readers_azcognitive_search-0.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "1c9ef21e51563c94e38b344110102afe7754f7a064578287614db809eeea7fb6",
                "md5": "e7553634945a07e02175b6eb7694dc41",
                "sha256": "9f4da60dc4173db06e622c94a275d3b1e460c6bb1023aabbcd180104b24e9a70"
            },
            "downloads": -1,
            "filename": "llama_index_readers_azcognitive_search-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "e7553634945a07e02175b6eb7694dc41",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 4439,
            "upload_time": "2025-07-30T20:50:14",
            "upload_time_iso_8601": "2025-07-30T20:50:14.596434Z",
            "url": "https://files.pythonhosted.org/packages/1c/9e/f21e51563c94e38b344110102afe7754f7a064578287614db809eeea7fb6/llama_index_readers_azcognitive_search-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-30 20:50:14",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "llama-index-readers-azcognitive-search"
}